GXY view
, or use Lightspeed layers.public class TLspGXYLayerTreeNodeAdapter extends TLspGXYLayerAdapter implements ILcdLayerTreeNode
ILcdGXYLayer
to an ILspView
,
with layer tree node functionality.
Layers added to this node must implement ILspLayer
.ILspLayer.LayerType
Constructor and Description |
---|
TLspGXYLayerTreeNodeAdapter(ILcdGXYLayer aGXYLayer)
Deprecated.
Creates an adapter for the given layer.
|
TLspGXYLayerTreeNodeAdapter(ILcdGXYLayer aGXYLayer,
ILspLayer.LayerType aLayerType)
Deprecated.
Creates an adapter for the given layer.
|
Modifier and Type | Method and Description |
---|---|
void |
addHierarchyLayeredListener(ILcdLayeredListener aListener)
Deprecated.
Registers the given
ILcdLayeredListener to receive
TLcdLayeredEvent s from all the ILcdLayerTreeNode s contained in the
tree with this node as root node. |
void |
addHierarchyPropertyChangeListener(PropertyChangeListener aListener)
Deprecated.
Registers the given
PropertyChangeListener to
receive PropertyChangeEvent s from all the ILcdLayer s contained in the
tree with this node as root node. |
void |
addHierarchySelectionListener(ILcdSelectionListener aListener)
Deprecated.
Registers the given
ILcdSelectionListener to
receive TLcdSelectionChangedEvent s from all the ILcdLayer s contained
in the tree with this node as root node. |
boolean |
addLayer(ILcdLayer aNewChildNode)
Deprecated.
Adds a new node to the tree as a child of this node.
|
boolean |
addLayer(ILcdLayer aNewChildNode,
int aIndex)
Deprecated.
Adds a new node to the tree as a child of this node.
|
void |
addLayeredListener(ILcdLayeredListener aListener)
Deprecated.
Registers the given
ILcdLayeredListener to be notified when layers are added, removed or moved. |
boolean |
containsLayer(ILcdLayer aLayer)
Deprecated.
Returns whether this
ILcdLayered contains the given layer. |
ILcdInitialLayerIndexProvider |
getInitialLayerIndexProvider()
Deprecated.
Returns the initial layer index provider, which can be used to determine the best index when
a layer is added without specifying an index.
|
ILcdLayer |
getLayer(int aIndex)
Deprecated.
Returns the
ILcdLayer in this ILcdLayered
with index aIndex . |
int |
indexOf(ILcdLayer aLayer)
Deprecated.
Returns the index if the given layer is in the list.
|
boolean |
isEditableSupported()
Deprecated.
Override some of the methods of TLspLayer to first check the model of this layer.
|
boolean |
isPaintOnTopOfChildrenHint()
Deprecated.
Returns whether a node should be painted on top of its children when the node is added to a
view, or beneath its child layers.
|
boolean |
isSelectableSupported()
Deprecated.
Returns
true if this layer supports selecting objects, false otherwise. |
int |
layerCount()
Deprecated.
Returns the number of
ILcdLayer objects in this ILcdLayered . |
ILcdLayer |
layerOf(ILcdModel aModel)
Deprecated.
Returns the
ILcdLayer of this ILcdLayered that contains the given ILcdModel . |
Enumeration<?> |
layers()
Deprecated.
Returns an
Enumeration of all ILcdLayer objects currently
in this ILcdLayered ,
starting from the bottom layer to the top layer. |
Enumeration<?> |
layersBackwards()
Deprecated.
Returns an
Enumeration of all ILcdLayer objects currently in this ILcdLayered ,
starting from the top layer to the bottom layer. |
void |
moveLayerAt(int aIndex,
ILcdLayer aLayer)
Deprecated.
Moves the given layer (which is already in
ILcdLayered ) to the existing index
aIndex. |
void |
removeAllLayers()
Deprecated.
Removes all the
ILcdLayer objects from this ILcdLayered . |
void |
removeHierarchyLayeredListener(ILcdLayeredListener aListener)
Deprecated.
Unregisters the given
ILcdLayeredListener from
receiving TLcdLayeredEvent s for the tree with this node as root node. |
void |
removeHierarchyPropertyChangeListener(PropertyChangeListener aListener)
Deprecated.
Unregisters the given
PropertyChangeListener from
receiving PropertyChangeEvent s for the tree with this node as root node. |
void |
removeHierarchySelectionListener(ILcdSelectionListener aListener)
Deprecated.
Unregisters the given
ILcdSelectionListener
from receiving TLcdSelectionChangedEvent s for the tree with this node as root
node. |
void |
removeLayer(ILcdLayer aLayer)
Deprecated.
Removes aLayer from this
ILcdLayered . |
void |
removeLayer(int aIndex)
Deprecated.
Removes the node at index
aIndex from this node and sends the appropriate
TLcdLayeredEvent . |
void |
removeLayeredListener(ILcdLayeredListener aListener)
Deprecated.
Unregisters the given
ILcdLayeredListener from receiving layered events for
the ILcdLayered . |
void |
setInitialLayerIndexProvider(ILcdInitialLayerIndexProvider aInitialLayerIndexProvider)
Deprecated.
Sets an initial layer index provider, which can be used to determine the best index when a
layer is added without specifying an index.
|
void |
setPaintOnTopOfChildrenHint(boolean aPaintOnTopOfChildrenHint)
Deprecated.
Sets whether a node should be painted on top of its children when the node is added to a
view, or beneath its child layers.
|
addEditingStateListener, addSelectionListener, clearSelection, editedObjectChanged, editedObjectsChanged, fireCollectedSelectionChanges, fireStatusEvent, getEditor, getFilter, getGXYLayer, getGXYLayerLabelingAlgorithm, getIcon, getLabel, getLayerType, getMapScaleRange, getModel, getModelXYZWorldTransformation, getObjectsWithPaintState, getPainter, getPaintRepresentations, getRequiredOpenGLProfile, getSelectionCount, getStyler, invokeAndWaitOnGXYLayer, invokeLaterOnGXYLayer, isEditable, isEditable, isSelectable, isSelected, isSnapTarget, isVisible, isVisible, isVisible, paint, query, removeEditingStateListener, removeSelectionListener, selectedObjects, selectObject, selectObjects, setEditable, setEditable, setFilter, setGXYLayerLabelingAlgorithm, setIcon, setLabel, setMapScaleRange, setModel, setSelectable, setSnapTarget, setVisible, setVisible, setVisible, toString
addLayerStateListener, addPaintRepresentation, addPropertyChangeListener, addStatusListener, createModelXYZWorldTransformation, fireLayerStateChange, fireLayerStateChange, fireLayerStateChange, fireLayerStateChange, firePropertyChange, getBounds, getCurrentViews, getLayerStyle, invalidate, isSynchronous, registerView, removeLayerStateListener, removePaintRepresentation, removePropertyChangeListener, removeStatusListener, setLayerStyle, setSynchronous, unregisterView
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addPropertyChangeListener, removePropertyChangeListener
clearSelection, fireCollectedSelectionChanges, getIcon, getLabel, getModel, isEditable, isSelectable, isVisible, selectObject, setEditable, setIcon, setLabel, setSelectable, setVisible
addSelectionListener, getSelectedObjects, getSelectionCount, isSelected, removeSelectionListener, selectedObjects
addLayeredListener, getLayers, removeLayeredListener
addLayerStateListener, addStatusListener, getBounds, getCurrentViews, getLayerStyle, getMapScaleProvider, invalidate, registerView, removeLayerStateListener, removeStatusListener, setLayerStyle, unregisterView
addPropertyChangeListener, removePropertyChangeListener
public TLspGXYLayerTreeNodeAdapter(ILcdGXYLayer aGXYLayer)
aGXYLayer
- the layer to adaptpublic TLspGXYLayerTreeNodeAdapter(ILcdGXYLayer aGXYLayer, ILspLayer.LayerType aLayerType)
aGXYLayer
- the layer to adaptaLayerType
- the LayerType
of the new layer.public boolean addLayer(ILcdLayer aNewChildNode) throws IllegalArgumentException
ILcdLayerTreeNode
Adds a new node to the tree as a child of this node. This newly added node will normally be
the last child node, but that can be implementation specific. Implementations could for example
decide to use the initial layer index provider to
determine the best index to add the layer. Notice that in order to avoid loops in the tree
aNewChildNode
must not already be an element of the tree. This method should also
generate a TLcdLayeredEvent
to warn its listeners that a node has been
added.
addLayer
in interface ILcdLayerTreeNode
aNewChildNode
- the node which must be added as a childtrue
when the layer was successfully added to this node, false
if the node already contained layer aNewChildNode
IllegalArgumentException
- when the node is already an element of the treepublic boolean addLayer(ILcdLayer aNewChildNode, int aIndex) throws IndexOutOfBoundsException, IllegalArgumentException
ILcdLayerTreeNode
Adds a new node to the tree as a child of this node. The child will be inserted at index
aIndex
in the child list of this node. Notice that in order to avoid loops in the
tree aNewChildNode
must not already be an element of the tree. This method should
also generate a TLcdLayeredEvent
to warn its listeners that a node has
been added.
addLayer
in interface ILcdLayerTreeNode
aNewChildNode
- the new childaIndex
- the index in the child list of this node for the new childtrue
when the layer was successfully added to this node, false
if the node already contained layer aNewChildNode
IndexOutOfBoundsException
- when index > ILcdLayerTreeNode.layerCount()
IllegalArgumentException
- when the node is already an element of the treepublic void removeLayer(ILcdLayer aLayer)
ILcdLayered
ILcdLayered
.removeLayer
in interface ILcdLayered
aLayer
- the layer to remove.public void removeLayer(int aIndex)
ILcdLayerTreeNode
Removes the node at index aIndex
from this node and sends the appropriate
TLcdLayeredEvent
.
removeLayer
in interface ILcdLayerTreeNode
aIndex
- the index of the child node which has to be removedpublic ILcdLayer getLayer(int aIndex) throws IndexOutOfBoundsException
ILcdLayered
ILcdLayer
in this ILcdLayered
with index aIndex
.getLayer
in interface ILcdLayered
aIndex
- the position of the layer to retrieve in the ILcdLayered
.ILcdLayer
in this ILcdLayered
with index aIndex
.ArrayIndexOutOfBoundsException
- if the given index is invalidIndexOutOfBoundsException
public int layerCount()
ILcdLayerTreeNode
ILcdLayer
objects in this ILcdLayered
.
This number does not include this layer node. It is the number of child layers of this node that is returned.
layerCount
in interface ILcdLayered
layerCount
in interface ILcdLayerTreeNode
ILcdLayer
objects in this ILcdLayered
.public Enumeration<?> layers()
ILcdLayerTreeNode
Enumeration
of all ILcdLayer
objects currently
in this ILcdLayered
,
starting from the bottom layer to the top layer.
This enumeration does not include this layer node, but only the child layers.
layers
in interface ILcdLayered
layers
in interface ILcdLayerTreeNode
Enumeration
of all ILcdLayer
objects currently
in this ILcdLayered
,
starting from the bottom layer to the top layer.public void moveLayerAt(int aIndex, ILcdLayer aLayer)
ILcdLayered
ILcdLayered
) to the existing index
aIndex.
When a layer is moved down, all layers in between the previous and future position of the given layer
(including the layer at index aIndex) are moved one position up.
When a layer is moved up, all layers in between the previous and future position of the given layer
(including the layer at index aIndex) are moved one position down.
More formally, let previousIndex be the index of aLayer
before the move.
If previousIndex < aIndex, then the index of all ILcdLayer
objects
in from previousIndex + 1 to aIndex is decremented with 1.
If previousIndex > aIndex, then the index of all ILcdLayer
objects
in from aIndex to previousIndex -1 is incremented with 1.
moveLayerAt
in interface ILcdLayered
aIndex
- the index of the position where to move the layer.aLayer
- the layer to move.public int indexOf(ILcdLayer aLayer)
ILcdLayered
indexOf
in interface ILcdLayered
aLayer
- the layer whose index to returnaLayer
public void addLayeredListener(ILcdLayeredListener aListener)
ILcdLayerTreeNode
Registers the given ILcdLayeredListener
to be notified when layers are added, removed or moved.
In case you need to register a listener which keeps a reference to an object with a shorter life-time than this layered,
you can use a ALcdWeakLayeredListener
instance as layered listener.
This layer will only be informed when child layers are added, removed or moved in this layer node. To
receive the events of the whole hierarchical structure, the listener must be added as a hierarchical
listener (see ILcdLayerTreeNode.addHierarchyLayeredListener(ILcdLayeredListener)
).
addLayeredListener
in interface ILcdLayered
addLayeredListener
in interface ILcdLayerTreeNode
aListener
- the listener that from now on will be notified of all changes
to the ILcdLayered
ILcdLayered.removeLayeredListener(com.luciad.view.ILcdLayeredListener)
public void removeLayeredListener(ILcdLayeredListener aListener)
ILcdLayerTreeNode
ILcdLayeredListener
from receiving layered events for
the ILcdLayered
.
It is not possible to remove a hierarchy listener with this method. Use ILcdLayerTreeNode.removeHierarchyLayeredListener(ILcdLayeredListener)
for this purpose.
removeLayeredListener
in interface ILcdLayered
removeLayeredListener
in interface ILcdLayerTreeNode
aListener
- the listener that will no longer be notified of changes
to the ILcdLayered
ILcdLayered.addLayeredListener(ILcdLayeredListener)
public void addHierarchyLayeredListener(ILcdLayeredListener aListener)
ILcdLayerTreeNode
Registers the given ILcdLayeredListener
to receive
TLcdLayeredEvent
s from all the ILcdLayerTreeNode
s contained in the
tree with this node as root node. If the listener should only receive events for changes
occurring in this node, it should be registered as a regular listener (see ILcdLayerTreeNode.addLayeredListener(ILcdLayeredListener)
.
The source ILcdLayered
of the event can be retrieved by calling TLcdLayeredEvent.getLayered()
on the received TLcdLayeredEvent
.
addHierarchyLayeredListener
in interface ILcdLayerTreeNode
aListener
- the listenerpublic void removeHierarchyLayeredListener(ILcdLayeredListener aListener)
ILcdLayerTreeNode
Unregisters the given ILcdLayeredListener
from
receiving TLcdLayeredEvent
s for the tree with this node as root node.
removeHierarchyLayeredListener
in interface ILcdLayerTreeNode
aListener
- the listenerpublic void addHierarchyPropertyChangeListener(PropertyChangeListener aListener)
ILcdLayerTreeNode
Registers the given PropertyChangeListener
to
receive PropertyChangeEvent
s from all the ILcdLayer
s contained in the
tree with this node as root node. If the listener should only receive events for changes
occurring in this layer, it should be registered as a regular listener (see ILcdLayerTreeNode.addPropertyChangeListener(java.beans.PropertyChangeListener)
).
The source layer of the event can be retrieved by calling EventObject.getSource()
on the received PropertyChangeEvent
.
addHierarchyPropertyChangeListener
in interface ILcdLayerTreeNode
aListener
- the listenerpublic void removeHierarchyPropertyChangeListener(PropertyChangeListener aListener)
ILcdLayerTreeNode
Unregisters the given PropertyChangeListener
from
receiving PropertyChangeEvent
s for the tree with this node as root node.
removeHierarchyPropertyChangeListener
in interface ILcdLayerTreeNode
aListener
- the listenerpublic void addHierarchySelectionListener(ILcdSelectionListener aListener)
ILcdLayerTreeNode
Registers the given ILcdSelectionListener
to
receive TLcdSelectionChangedEvent
s from all the ILcdLayer
s contained
in the tree with this node as root node. If the listener should only receive events for
selection changes occurring in this layer, it should be registered as a regular listener (see
ILcdSelection.addSelectionListener(com.luciad.util.ILcdSelectionListener)
).
The source layer of the event can be retrieved by calling TLcdSelectionChangedEvent.getSelection()
on the received TLcdSelectionChangedEvent
.
addHierarchySelectionListener
in interface ILcdLayerTreeNode
aListener
- the listenerpublic void removeHierarchySelectionListener(ILcdSelectionListener aListener)
ILcdLayerTreeNode
Unregisters the given ILcdSelectionListener
from receiving TLcdSelectionChangedEvent
s for the tree with this node as root
node.
removeHierarchySelectionListener
in interface ILcdLayerTreeNode
aListener
- the listenerpublic void removeAllLayers()
ILcdLayerTreeNode
ILcdLayer
objects from this ILcdLayered
.
This method will generate a TLcdLayeredEvent
indicating a layer was removed for
every child layer.
removeAllLayers
in interface ILcdLayered
removeAllLayers
in interface ILcdLayerTreeNode
public Enumeration<?> layersBackwards()
ILcdLayerTreeNode
Enumeration
of all ILcdLayer
objects currently in this ILcdLayered
,
starting from the top layer to the bottom layer.
This enumeration does not include this layer node, but only the child layers.
layersBackwards
in interface ILcdLayered
layersBackwards
in interface ILcdLayerTreeNode
Enumeration
of all ILcdLayer
objects currently in this ILcdLayered
,
starting from the top layer to the bottom layer.public ILcdLayer layerOf(ILcdModel aModel) throws NoSuchElementException
ILcdLayered
ILcdLayer
of this ILcdLayered
that contains the given ILcdModel
.layerOf
in interface ILcdLayered
aModel
- the model to check for in this ILcdLayered
.ILcdLayer
of this ILcdLayered
that contains the given ILcdModel
.NoSuchElementException
- if there is no layer containing the given modelpublic boolean containsLayer(ILcdLayer aLayer)
ILcdLayerTreeNode
ILcdLayered
contains the given layer.
More formally, returns true
if and only if the ILcdLayered
contains at least one layer l
such that
(aLayer==null ? l==null : aLayer.equals(l)).
Calling this method with this node as parameter will return false
, since this method only
checks the child layers and not the layer node itself.
containsLayer
in interface ILcdLayered
containsLayer
in interface ILcdLayerTreeNode
aLayer
- the layer to check whether it is in this layered.aLayer
is in this ILcdLayered
,
false otherwise.public void setPaintOnTopOfChildrenHint(boolean aPaintOnTopOfChildrenHint)
ILcdLayerTreeNode
Sets whether a node should be painted on top of its children when the node is added to a view, or beneath its child layers. Notice that this is only a hint, hence the paint order of the node and its children is not guaranteed.
This property must be set before the node is added to the view. Otherwise it will have no effect. Changing it afterwards will have no effect, unless the node is removed and re-added to the view.
The default behavior is to paint nodes underneath the child layers.
setPaintOnTopOfChildrenHint
in interface ILcdLayerTreeNode
aPaintOnTopOfChildrenHint
- true
when a node should be painted on top of its
children, false
when the node should be painted
underneath its child layersILcdLayerTreeNode.isPaintOnTopOfChildrenHint()
public boolean isPaintOnTopOfChildrenHint()
ILcdLayerTreeNode
Returns whether a node should be painted on top of its children when the node is added to a view, or beneath its child layers.
isPaintOnTopOfChildrenHint
in interface ILcdLayerTreeNode
true
when a node should be painted on top of its children,
false
when the node should be painted underneath its child layersILcdLayerTreeNode.setPaintOnTopOfChildrenHint(boolean)
public ILcdInitialLayerIndexProvider getInitialLayerIndexProvider()
ILcdLayerTreeNode
Returns the initial layer index provider, which can be used to determine the best index when a layer is added without specifying an index.
It is however up to the implementation to decide whether it uses the
ILcdInitialLayerIndexProvider
.
getInitialLayerIndexProvider
in interface ILcdLayerTreeNode
null
ILcdLayerTreeNode.setInitialLayerIndexProvider(ILcdInitialLayerIndexProvider)
public void setInitialLayerIndexProvider(ILcdInitialLayerIndexProvider aInitialLayerIndexProvider)
ILcdLayerTreeNode
Sets an initial layer index provider, which can be used to determine the best index when a layer is added without specifying an index.
setInitialLayerIndexProvider
in interface ILcdLayerTreeNode
aInitialLayerIndexProvider
- The new initial layer index provider. May be
null
ILcdLayerTreeNode.getInitialLayerIndexProvider()
public boolean isEditableSupported()
isEditableSupported
in interface ILcdLayer
isEditableSupported
in class TLspGXYLayerAdapter
true
ILcdLayer.setEditable(boolean)
public boolean isSelectableSupported()
ILcdLayer
true
if this layer supports selecting objects, false
otherwise.isSelectableSupported
in interface ILcdLayer
isSelectableSupported
in class TLspGXYLayerAdapter
true
ILcdLayer.setSelectable(boolean)
,
ILcdLayer.selectObject(java.lang.Object, boolean, int)