public abstract class Layer extends ExtensibleObject
Rendering
.Modifier | Constructor and Description |
---|---|
protected |
Layer(LayerType layerType) |
protected |
Layer(LayerType layerType,
PropertySet configuration)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addListener(LayerListener listener)
Adds a change listener to this layer.
|
void |
dispose()
Disposes all allocated resources.
|
protected void |
disposeChildren()
Disposes the child layers of this layer.
|
protected void |
disposeLayer()
Disposes the layer.
|
protected void |
fireLayerDataChanged(Rectangle2D modelRegion) |
protected void |
fireLayerPropertyChanged(PropertyChangeEvent event) |
protected void |
fireLayerPropertyChanged(String propertyName,
Object oldValue,
Object newValue) |
protected void |
fireLayersAdded(Layer[] layers) |
protected void |
fireLayersRemoved(Layer[] layers) |
int |
getChildIndex(String id)
Gets the index of the first child layer having the given identifier.
|
List<Layer> |
getChildren()
Gets the child layers of this layer.
|
protected Rectangle2D |
getChildrenModelBounds()
Gets the bounds (bounding box) of the child layers in model coordinates.
|
Composite |
getComposite()
Returns the composite of this layer.
|
PropertySet |
getConfiguration()
Returns the configuration which can be used by the layer type to recreate this layer.
|
protected <T> T |
getConfigurationProperty(String propertyName,
T defaultValue) |
String |
getId() |
protected Rectangle2D |
getLayerModelBounds()
Gets the bounds (bounding box) of this layer in model coordinates.
|
LayerType |
getLayerType() |
LayerListener[] |
getListeners() |
Rectangle2D |
getModelBounds()
Gets the model bounds (bounding box) of the layer in model coordinates.
|
String |
getName() |
Layer |
getParent() |
double |
getSwipePercent()
Returns the swipe position of this layer.
|
double |
getTransparency()
Returns the transparency of this layer.
|
boolean |
isCollectionLayer() |
boolean |
isVisible() |
void |
regenerate()
Regenerates the layer.
|
void |
removeListener(LayerListener listener)
Removes a change listener from this layer.
|
void |
render(Rendering rendering)
Renders the layer.
|
void |
render(Rendering rendering,
LayerFilter filter)
Renders the layer.
|
protected void |
renderChildren(Rendering rendering,
LayerFilter filter)
Renders the child layers of this layer.
|
protected void |
renderLayer(Rendering rendering)
Renders the layer.
|
void |
setComposite(Composite composite)
Sets the composite of this layer.
|
void |
setId(String id) |
void |
setName(String name) |
void |
setSwipePercent(double swipePercent)
Sets the swipe position of this layer to a new value.
|
void |
setTransparency(double transparency)
Sets the transparency of this layer to a new value.
|
void |
setVisible(boolean visible) |
String |
toString() |
getExtension
protected Layer(LayerType layerType)
protected Layer(LayerType layerType, PropertySet configuration)
name = getClass().getName()
visible = true
transparency = 0.0
swipePercent = 1.0
layerType
- the layer type.configuration
- the configuration used by the layer type to create this layer.public LayerType getLayerType()
public PropertySet getConfiguration()
public Layer getParent()
null
if this layer is not a child of any other layer.public boolean isCollectionLayer()
public List<Layer> getChildren()
public String getName()
public void setName(String name)
name
- The name.public String getId()
public void setId(String id)
id
- An identifier which can be used to search for special layers.public int getChildIndex(String id)
id
- The identifier.-1
if no such layer exists.public boolean isVisible()
true
, if this layer is visible.public void setVisible(boolean visible)
visible
- true
, if this layer is visible.public double getTransparency()
public void setTransparency(double transparency)
transparency
- the new transparency value of this layer.public double getSwipePercent()
public void setSwipePercent(double swipePercent)
swipePercent
- the new swipe position value of this layer.public Composite getComposite()
public void setComposite(Composite composite)
composite
- the new composite of this layer.protected final <T> T getConfigurationProperty(String propertyName, T defaultValue)
public final Rectangle2D getModelBounds()
getLayerModelBounds()
and getChildrenModelBounds()
.null
if this layer
and all children have no specified boundary.protected Rectangle2D getLayerModelBounds()
getModelBounds()
.
The default implementation returns null
.null
if this layer
has no specified boundary.protected Rectangle2D getChildrenModelBounds()
getModelBounds()
.
The default implementation returns the union bounds (if any) of all child layers.null
none of the children have a specified boundary.public final void render(Rendering rendering)
render(rendering,null)
.rendering
- The rendering to which the layer will be rendered.render(com.bc.ceres.grender.Rendering, LayerFilter)
public final void render(Rendering rendering, LayerFilter filter)
renderLayer(com.bc.ceres.grender.Rendering)
followed by
renderChildren(com.bc.ceres.grender.Rendering, LayerFilter)
are called.rendering
- The rendering to which the layer will be rendered.filter
- An optional layer filter. May be null
.protected void renderLayer(Rendering rendering)
render(com.bc.ceres.grender.Rendering)
.
The default implementation does nothing.rendering
- The rendering to which the layer will be rendered.protected void renderChildren(Rendering rendering, LayerFilter filter)
render(com.bc.ceres.grender.Rendering)
.
The default implementation calls render(com.bc.ceres.grender.Rendering)
on all child layers.rendering
- The rendering to which the layer will be rendered.filter
- A layer filter. May be null
.public final void dispose()
disposeChildren()
followed by disposeLayer()
.protected void disposeLayer()
dispose()
.
The default implementation does nothing.protected void disposeChildren()
public void addListener(LayerListener listener)
listener
- The listener.public void removeListener(LayerListener listener)
listener
- The listener.public LayerListener[] getListeners()
protected void fireLayerPropertyChanged(String propertyName, Object oldValue, Object newValue)
protected void fireLayerPropertyChanged(PropertyChangeEvent event)
protected void fireLayerDataChanged(Rectangle2D modelRegion)
protected void fireLayersAdded(Layer[] layers)
protected void fireLayersRemoved(Layer[] layers)
public void regenerate()
Copyright © 2014–2022 European Space Agency (ESA). All rights reserved.