org.esa.beam.framework.datamodel
Class VectorDataNode

java.lang.Object
  extended by com.bc.ceres.core.ExtensibleObject
      extended by org.esa.beam.framework.datamodel.ProductNode
          extended by org.esa.beam.framework.datamodel.VectorDataNode
All Implemented Interfaces:
com.bc.ceres.core.Extensible

public class VectorDataNode
extends ProductNode

A container which allows to store vector data in the BEAM product model.

This is a preliminary API under construction for BEAM 4.7. Not intended for public use.

Since:
BEAM 4.7
Version:
$Revision$ $Date$
Author:
Norman Fomferra
See Also:
Product.getVectorDataGroup()

Field Summary
static String PROPERTY_NAME_DEFAULT_STYLE_CSS
           
static String PROPERTY_NAME_FEATURE_COLLECTION
           
static String PROPERTY_NAME_STYLE_CSS
           
 
Fields inherited from class org.esa.beam.framework.datamodel.ProductNode
PROPERTY_NAME_DESCRIPTION, PROPERTY_NAME_NAME
 
Constructor Summary
VectorDataNode(String name, org.geotools.feature.FeatureCollection<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> featureCollection)
          Constructs a new vector data node for the given feature collection.
VectorDataNode(String name, org.geotools.feature.FeatureCollection<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> featureCollection, PlacemarkDescriptor placemarkDescriptor)
          Constructs a new vector data node for the given feature collection.
VectorDataNode(String name, org.opengis.feature.simple.SimpleFeatureType featureType)
          Constructs a new vector data node for the given feature collection.
 
Method Summary
 void acceptVisitor(ProductVisitor visitor)
          Accepts the given visitor.
 void dispose()
          Releases all of the resources used by this object instance and all of its owned children.
 void fireFeaturesAdded(org.opengis.feature.simple.SimpleFeature... features)
          Informs clients which have registered a ProductNodeListener with the Product containing this VectorDataNode, that one or more OpenGIS SimpleFeatures have been added to the underlying FeatureCollection.
 void fireFeaturesChanged(org.opengis.feature.simple.SimpleFeature... features)
          Informs clients which have registered a ProductNodeListener with the Product containing this VectorDataNode, that one or more OpenGIS SimpleFeatures from from the underlying FeatureCollection have been changed.
 void fireFeaturesRemoved(org.opengis.feature.simple.SimpleFeature... features)
          Informs clients which have registered a ProductNodeListener with the Product containing this VectorDataNode, that one or more OpenGIS SimpleFeatures have been removed from the underlying FeatureCollection.
 String getDefaultCSS()
          Deprecated. since BEAM 4.10, use getDefaultStyleCss()
 String getDefaultStyleCss()
           
 org.geotools.geometry.jts.ReferencedEnvelope getEnvelope()
          Gets the bounding box for the features in this feature collection.
 org.geotools.feature.FeatureCollection<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> getFeatureCollection()
           
 org.opengis.feature.simple.SimpleFeatureType getFeatureType()
           
 PlacemarkDescriptor getPlacemarkDescriptor()
           
 PlacemarkGroup getPlacemarkGroup()
           
 long getRawStorageSize(ProductSubsetDef subsetDef)
          Gets an estimated, raw storage size in bytes of this product node.
 String getStyleCss()
           
 boolean isInternalNode()
          Deprecated. Since BEAM 4.10. No use.
 boolean isPermanent()
          Internal API.
 void setDefaultCSS(String defaultCSS)
          Deprecated. since BEAM 4.10, use setDefaultStyleCss()
 void setDefaultStyleCss(String defaultStyleCss)
           
 void setModified(boolean modified)
          Sets this node's modified flag.
protected  void setOwner(ProductNode owner)
          Called when this node is added to or removed from a product.
 void setPermanent(boolean permanent)
          Internal API.
 void setStyleCss(String styleCss)
           
 
Methods inherited from class org.esa.beam.framework.datamodel.ProductNode
fireProductNodeChanged, fireProductNodeChanged, getDescription, getDisplayName, getName, getOwner, getProduct, getProductReader, getProductReaderSafe, getProductRefString, getProductSafe, getProductWriter, getProductWriterSafe, getRawStorageSize, isModified, isPartOfSubset, isValidNodeName, removeFromFile, setDescription, setName, toString, updateExpression
 
Methods inherited from class com.bc.ceres.core.ExtensibleObject
getExtension
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PROPERTY_NAME_FEATURE_COLLECTION

public static final String PROPERTY_NAME_FEATURE_COLLECTION
See Also:
Constant Field Values

PROPERTY_NAME_STYLE_CSS

public static final String PROPERTY_NAME_STYLE_CSS
See Also:
Constant Field Values

PROPERTY_NAME_DEFAULT_STYLE_CSS

public static final String PROPERTY_NAME_DEFAULT_STYLE_CSS
See Also:
Constant Field Values
Constructor Detail

VectorDataNode

public VectorDataNode(String name,
                      org.opengis.feature.simple.SimpleFeatureType featureType)
Constructs a new vector data node for the given feature collection.

Parameters:
name - The node name.
featureType - The feature type.
Throws:
IllegalArgumentException - if the given name is not a valid node identifier

VectorDataNode

public VectorDataNode(String name,
                      org.geotools.feature.FeatureCollection<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> featureCollection)
Constructs a new vector data node for the given feature collection.

Parameters:
name - The node name.
featureCollection - A feature collection.
Throws:
IllegalArgumentException - if the given name is not a valid node identifier

VectorDataNode

public VectorDataNode(String name,
                      org.geotools.feature.FeatureCollection<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> featureCollection,
                      PlacemarkDescriptor placemarkDescriptor)
Constructs a new vector data node for the given feature collection.

Parameters:
name - The node name.
featureCollection - A feature collection.
placemarkDescriptor - The placemark descriptor
Throws:
IllegalArgumentException - if the given name is not a valid node identifier
Method Detail

setOwner

protected void setOwner(ProductNode owner)
Called when this node is added to or removed from a product. Overridden in order to create placemarks for features that are still without a placemark counterpart.

Overrides:
setOwner in class ProductNode
Parameters:
owner - the new owner

getPlacemarkDescriptor

public PlacemarkDescriptor getPlacemarkDescriptor()

getPlacemarkGroup

public PlacemarkGroup getPlacemarkGroup()

setModified

public void setModified(boolean modified)
Description copied from class: ProductNode
Sets this node's modified flag.

If the modified flag changes to true and this node has an owner, the owner's modified flag is also set to true.

Overrides:
setModified in class ProductNode
Parameters:
modified - whether or not this node is beeing marked as modified.
See Also:
Product.fireNodeChanged(org.esa.beam.framework.datamodel.ProductNode, java.lang.String, java.lang.Object, java.lang.Object)

fireFeaturesAdded

public void fireFeaturesAdded(org.opengis.feature.simple.SimpleFeature... features)
Informs clients which have registered a ProductNodeListener with the Product containing this VectorDataNode, that one or more OpenGIS SimpleFeatures have been added to the underlying FeatureCollection.

The method fires a product node property change event, where the propertyName is PROPERTY_NAME_FEATURE_COLLECTION, the oldValue is null, and the newValue is the array of features added.

Parameters:
features - The feature(s) added.

fireFeaturesRemoved

public void fireFeaturesRemoved(org.opengis.feature.simple.SimpleFeature... features)
Informs clients which have registered a ProductNodeListener with the Product containing this VectorDataNode, that one or more OpenGIS SimpleFeatures have been removed from the underlying FeatureCollection.

The method fires a product node property change event, where the propertyName is PROPERTY_NAME_FEATURE_COLLECTION, the oldValue is the array of features removed, and the newValue is null.

Parameters:
features - The feature(s) removed.

fireFeaturesChanged

public void fireFeaturesChanged(org.opengis.feature.simple.SimpleFeature... features)
Informs clients which have registered a ProductNodeListener with the Product containing this VectorDataNode, that one or more OpenGIS SimpleFeatures from from the underlying FeatureCollection have been changed.

The method fires a product node property change event, where the propertyName is PROPERTY_NAME_FEATURE_COLLECTION, and both oldValue and newValue are the same array of features changed.

Parameters:
features - The feature(s) changed.

getFeatureType

public org.opengis.feature.simple.SimpleFeatureType getFeatureType()
Returns:
The feature type (= feature source schema).

getFeatureCollection

public org.geotools.feature.FeatureCollection<org.opengis.feature.simple.SimpleFeatureType,org.opengis.feature.simple.SimpleFeature> getFeatureCollection()
Returns:
The feature collection.

getEnvelope

public org.geotools.geometry.jts.ReferencedEnvelope getEnvelope()
Gets the bounding box for the features in this feature collection.

Returns:
the envelope of the geometries contained by this feature collection.

getRawStorageSize

public long getRawStorageSize(ProductSubsetDef subsetDef)
Description copied from class: ProductNode
Gets an estimated, raw storage size in bytes of this product node.

Specified by:
getRawStorageSize in class ProductNode
Parameters:
subsetDef - if not null the subset may limit the size returned
Returns:
the size in bytes.

getDefaultStyleCss

public String getDefaultStyleCss()

setDefaultStyleCss

public void setDefaultStyleCss(String defaultStyleCss)

getStyleCss

public String getStyleCss()

setStyleCss

public void setStyleCss(String styleCss)

acceptVisitor

public void acceptVisitor(ProductVisitor visitor)
Description copied from class: ProductNode
Accepts the given visitor. This method implements the well known 'Visitor' design pattern of the gang-of-four. The visitor pattern allows to define new operations on the product data model without the need to add more code to it. The new operation is implemented by the visitor.

Specified by:
acceptVisitor in class ProductNode
Parameters:
visitor - the visitor

dispose

public void dispose()
Releases all of the resources used by this object instance and all of its owned children. Its primary use is to allow the garbage collector to perform a vanilla job.

This method should be called only if it is for sure that this object instance will never be used again. The results of referencing an instance of this class after a call to dispose() are undefined.

Overrides of this method should always call super.dispose(); after disposing this instance.

Overrides:
dispose in class ProductNode

isInternalNode

@Deprecated
public boolean isInternalNode()
Deprecated. Since BEAM 4.10. No use.

Returns:
true if the feature type's name starts with "org.esa.beam."

getDefaultCSS

@Deprecated
public String getDefaultCSS()
Deprecated. since BEAM 4.10, use getDefaultStyleCss()


setDefaultCSS

@Deprecated
public void setDefaultCSS(String defaultCSS)
Deprecated. since BEAM 4.10, use setDefaultStyleCss()


isPermanent

public boolean isPermanent()
Internal API. Don't use.

Returns:
If true, prevents this node from being removed.

setPermanent

public void setPermanent(boolean permanent)
Internal API. Don't use.

Parameters:
permanent - If true, prevents this node from being removed.


Copyright © 2002-2013 Brockmann Consult GmbH. All Rights Reserved.