Class TLcdGXYAsynchronousEditableLabelsLayerTreeNodeWrapper
- All Implemented Interfaces:
ILcdPropertyChangeSource,ILcdSelection<Object>,ILcdGXYAsynchronousLayerWrapper,ILcdGXYEditableLabelsLayer,ILcdGXYLayer,ILcdLayer,ILcdLayered,ILcdLayerTreeNode,Serializable
TLcdGXYAsynchronousEditableLabelsLayerWrapper extension for
layer nodes.
It only protects the functionality offered by the ILcdGXYEditableLabelsLayer interface.
The node functionality is not protected from asynchronous painting, and should therefore not be
accessed in paint-specific methods.- Since:
- 9.0
- See Also:
-
Field Summary
Fields inherited from interface com.luciad.view.gxy.ILcdGXYEditableLabelsLayer
PLACED_LABELS -
Constructor Summary
ConstructorsConstructorDescriptionCreates a layer node decorator that delegates painting to an asynchronous paint queue.TLcdGXYAsynchronousEditableLabelsLayerTreeNodeWrapper(ILcdGXYEditableLabelsLayer aDecoratedLayer, ILcdGXYAsynchronousPaintQueue aPaintQueue) Creates a layer node decorator that delegates painting to an asynchronous paint queue. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddHierarchyLayeredListener(ILcdLayeredListener aListener) Registers the givenILcdLayeredListenerto receiveTLcdLayeredEvents from all theILcdLayerTreeNodes contained in the tree with this node as root node.voidRegisters the givenPropertyChangeListenerto receivePropertyChangeEvents from all theILcdLayers contained in the tree with this node as root node.voidRegisters the givenILcdSelectionListenerto receiveTLcdSelectionChangedEvents from all theILcdLayers contained in the tree with this node as root node.booleanAdds a new node to the tree as a child of this node.booleanAdds a new node to the tree as a child of this node.voidaddLayeredListener(ILcdLayeredListener aLayeredListener) Registers the givenILcdLayeredListenerto be notified when layers are added, removed or moved.booleancontainsLayer(ILcdLayer aLayer) Returns whether thisILcdLayeredcontains the given layer.Returns the initial layer index provider, which can be used to determine the best index when a layer is added without specifying an index.getLayer(int aIndex) Returns theILcdLayerin thisILcdLayeredwith indexaIndex.intReturns the index if the given layer is in the list.booleanReturns whether a node should be painted on top of its children when the node is added to a view, or beneath its child layers.intReturns the number ofILcdLayerobjects in thisILcdLayered.Returns theILcdLayerof thisILcdLayeredthat contains the givenILcdModel.layers()Returns anEnumerationof allILcdLayerobjects currently in thisILcdLayered, starting from the bottom layer to the top layer.Returns anEnumerationof allILcdLayerobjects currently in thisILcdLayered, starting from the top layer to the bottom layer.voidmoveLayerAt(int aIndex, ILcdLayer aLayer) Moves the given layer (which is already inILcdLayered) to the existing index aIndex.voidRemoves all theILcdLayerobjects from thisILcdLayered.voidUnregisters the givenILcdLayeredListenerfrom receivingTLcdLayeredEvents for the tree with this node as root node.voidUnregisters the givenPropertyChangeListenerfrom receivingPropertyChangeEvents for the tree with this node as root node.voidUnregisters the givenILcdSelectionListenerfrom receivingTLcdSelectionChangedEvents for the tree with this node as root node.voidremoveLayer(int aIndex) Removes the node at indexaIndexfrom this node and sends the appropriateTLcdLayeredEvent.voidremoveLayer(ILcdLayer aLayer) Removes aLayer from thisILcdLayered.voidremoveLayeredListener(ILcdLayeredListener aLayeredListener) Unregisters the givenILcdLayeredListenerfrom receiving layered events for theILcdLayered.voidsetInitialLayerIndexProvider(ILcdInitialLayerIndexProvider aInitialLayerIndexProvider) Sets an initial layer index provider, which can be used to determine the best index when a layer is added without specifying an index.voidsetPaintOnTopOfChildrenHint(boolean aPaintOnTopOfChildrenHint) 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.Methods inherited from class com.luciad.view.gxy.asynchronous.TLcdGXYAsynchronousEditableLabelsLayerWrapper
applyOnInteract, applyOnInteractLabels, getAsynchronousGXYLayerChangeTracker, getGXYLabelEditor, getGXYLabelingAlgorithm, getLabelLocations, getSynchronousGXYLayerChangeTracker, isLabelsEditable, isLabelsEditableSupported, paint, setAsynchronous, setGXYAsynchronousPaintQueue, setLabelsEditableMethods inherited from class com.luciad.view.gxy.asynchronous.TLcdGXYAsynchronousLayerWrapper
addPropertyChangeListener, addSelectionListener, applyOnInteract, clearSelection, fireCollectedSelectionChanges, firePropertyChangeEvent, getBounds, getGXYAsynchronousPaintQueue, getGXYEditor, getGXYLabelPainter, getGXYLayer, getGXYPainter, getGXYPen, getIcon, getLabel, getLabelMapScaleRange, getLabelScaleRange, getMapScaleRange, getModel, getModelXYWorldTransfoClass, getScaleRange, getSelectionCount, invokeAndWaitOnGXYLayer, invokeLaterOnGXYLayer, invokeLaterOnGXYLayerInEDT, invokeNowOnGXYLayer, isAsynchronous, isEditable, isEditableSupported, isLabeled, isLabeledSupported, isSelectable, isSelectableSupported, isSelected, isTraceOn, isVisible, removePropertyChangeListener, removeSelectionListener, selectedObjects, selectObject, setEditable, setIcon, setLabel, setLabeled, setSelectable, setTraceOn, setVisible, stopPaintingMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.luciad.view.gxy.ILcdGXYLayer
applyOnInteract, getBounds, getGXYEditor, getGXYLabelPainter, getGXYPainter, getGXYPen, getLabelMapScaleRange, getLabelScaleRange, getMapScaleRange, getModelXYWorldTransfoClass, getScaleRange, isLabeled, isLabeledSupported, setLabeled, stopPaintingMethods inherited from interface com.luciad.view.ILcdLayer
clearSelection, fireCollectedSelectionChanges, getIcon, getLabel, getModel, isEditable, isEditableSupported, isSelectable, isSelectableSupported, isVisible, selectObject, setEditable, setIcon, setLabel, setSelectable, setVisibleMethods inherited from interface com.luciad.view.ILcdLayered
addLayeredListener, getLayers, removeLayeredListenerMethods inherited from interface com.luciad.view.ILcdLayerTreeNode
addPropertyChangeListener, removePropertyChangeListenerMethods inherited from interface com.luciad.util.ILcdSelection
addSelectionListener, getSelectedObjects, getSelectionCount, isSelected, removeSelectionListener, selectedObjects
-
Constructor Details
-
TLcdGXYAsynchronousEditableLabelsLayerTreeNodeWrapper
public TLcdGXYAsynchronousEditableLabelsLayerTreeNodeWrapper(ILcdGXYEditableLabelsLayer aDecoratedLayer) Creates a layer node decorator that delegates painting to an asynchronous paint queue. After construction, a paint queue must be set usingTLcdGXYAsynchronousEditableLabelsLayerWrapper.setGXYAsynchronousPaintQueue(ILcdGXYAsynchronousPaintQueue)- Parameters:
aDecoratedLayer- the layer node to decorate. The node must implement ILcdLayerTreeNode.
-
TLcdGXYAsynchronousEditableLabelsLayerTreeNodeWrapper
public TLcdGXYAsynchronousEditableLabelsLayerTreeNodeWrapper(ILcdGXYEditableLabelsLayer aDecoratedLayer, ILcdGXYAsynchronousPaintQueue aPaintQueue) Creates a layer node decorator that delegates painting to an asynchronous paint queue.- Parameters:
aDecoratedLayer- the layer node to decorate. The node must implement ILcdLayerTreeNode. Paint-sensitive state changes are propagated to and from the wrapper.aPaintQueue- the paint queue that handles the asynchronous paint calls
-
-
Method Details
-
addHierarchyLayeredListener
Description copied from interface:ILcdLayerTreeNodeRegisters the given
ILcdLayeredListenerto receiveTLcdLayeredEvents from all theILcdLayerTreeNodes 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 (seeILcdLayerTreeNode.addLayeredListener(ILcdLayeredListener).The source
ILcdLayeredof the event can be retrieved by callingTLcdLayeredEvent.getLayered()on the receivedTLcdLayeredEvent.- Specified by:
addHierarchyLayeredListenerin interfaceILcdLayerTreeNode- Parameters:
aListener- the listener
-
removeHierarchyLayeredListener
Description copied from interface:ILcdLayerTreeNodeUnregisters the given
ILcdLayeredListenerfrom receivingTLcdLayeredEvents for the tree with this node as root node.- Specified by:
removeHierarchyLayeredListenerin interfaceILcdLayerTreeNode- Parameters:
aListener- the listener
-
addHierarchyPropertyChangeListener
Description copied from interface:ILcdLayerTreeNodeRegisters the given
PropertyChangeListenerto receivePropertyChangeEvents from all theILcdLayers 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 (seeILcdLayerTreeNode.addPropertyChangeListener(java.beans.PropertyChangeListener)).The source layer of the event can be retrieved by calling
EventObject.getSource()on the receivedPropertyChangeEvent.- Specified by:
addHierarchyPropertyChangeListenerin interfaceILcdLayerTreeNode- Parameters:
aListener- the listener
-
removeHierarchyPropertyChangeListener
Description copied from interface:ILcdLayerTreeNodeUnregisters the given
PropertyChangeListenerfrom receivingPropertyChangeEvents for the tree with this node as root node.- Specified by:
removeHierarchyPropertyChangeListenerin interfaceILcdLayerTreeNode- Parameters:
aListener- the listener
-
addHierarchySelectionListener
Description copied from interface:ILcdLayerTreeNodeRegisters the given
ILcdSelectionListenerto receiveTLcdSelectionChangedEvents from all theILcdLayers 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 (seeILcdSelection.addSelectionListener(com.luciad.util.ILcdSelectionListener)).The source layer of the event can be retrieved by calling
TLcdSelectionChangedEvent.getSelection()on the receivedTLcdSelectionChangedEvent.- Specified by:
addHierarchySelectionListenerin interfaceILcdLayerTreeNode- Parameters:
aListener- the listener
-
removeHierarchySelectionListener
Description copied from interface:ILcdLayerTreeNodeUnregisters the given
ILcdSelectionListenerfrom receivingTLcdSelectionChangedEvents for the tree with this node as root node.- Specified by:
removeHierarchySelectionListenerin interfaceILcdLayerTreeNode- Parameters:
aListener- the listener
-
removeAllLayers
public void removeAllLayers()Description copied from interface:ILcdLayerTreeNodeRemoves all theILcdLayerobjects from thisILcdLayered.This method will generate a
TLcdLayeredEventindicating a layer was removed for every child layer.- Specified by:
removeAllLayersin interfaceILcdLayered- Specified by:
removeAllLayersin interfaceILcdLayerTreeNode
-
addLayeredListener
Description copied from interface:ILcdLayerTreeNodeRegisters the given
ILcdLayeredListenerto 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
ALcdWeakLayeredListenerinstance 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)).- Specified by:
addLayeredListenerin interfaceILcdLayered- Specified by:
addLayeredListenerin interfaceILcdLayerTreeNode- Parameters:
aLayeredListener- the listener that from now on will be notified of all changes to theILcdLayered- See Also:
-
removeLayeredListener
Description copied from interface:ILcdLayerTreeNodeUnregisters the givenILcdLayeredListenerfrom receiving layered events for theILcdLayered.It is not possible to remove a hierarchy listener with this method. Use
ILcdLayerTreeNode.removeHierarchyLayeredListener(ILcdLayeredListener)for this purpose.- Specified by:
removeLayeredListenerin interfaceILcdLayered- Specified by:
removeLayeredListenerin interfaceILcdLayerTreeNode- Parameters:
aLayeredListener- the listener that will no longer be notified of changes to theILcdLayered- See Also:
-
layerCount
public int layerCount()Description copied from interface:ILcdLayerTreeNodeReturns the number ofILcdLayerobjects in thisILcdLayered.This number does not include this layer node. It is the number of child layers of this node that is returned.
- Specified by:
layerCountin interfaceILcdLayered- Specified by:
layerCountin interfaceILcdLayerTreeNode- Returns:
- the number of
ILcdLayerobjects in thisILcdLayered.
-
layers
Description copied from interface:ILcdLayerTreeNodeReturns anEnumerationof allILcdLayerobjects currently in thisILcdLayered, starting from the bottom layer to the top layer.This enumeration does not include this layer node, but only the child layers.
- Specified by:
layersin interfaceILcdLayered- Specified by:
layersin interfaceILcdLayerTreeNode- Returns:
- an
Enumerationof allILcdLayerobjects currently in thisILcdLayered, starting from the bottom layer to the top layer.
-
layersBackwards
Description copied from interface:ILcdLayerTreeNodeReturns anEnumerationof allILcdLayerobjects currently in thisILcdLayered, starting from the top layer to the bottom layer.This enumeration does not include this layer node, but only the child layers.
- Specified by:
layersBackwardsin interfaceILcdLayered- Specified by:
layersBackwardsin interfaceILcdLayerTreeNode- Returns:
- an
Enumerationof allILcdLayerobjects currently in thisILcdLayered, starting from the top layer to the bottom layer.
-
getLayer
Description copied from interface:ILcdLayeredReturns theILcdLayerin thisILcdLayeredwith indexaIndex.- Specified by:
getLayerin interfaceILcdLayered- Parameters:
aIndex- the position of the layer to retrieve in theILcdLayered.- Returns:
- the
ILcdLayerin thisILcdLayeredwith indexaIndex. - Throws:
ArrayIndexOutOfBoundsException- if the given index is invalid
-
layerOf
Description copied from interface:ILcdLayeredReturns theILcdLayerof thisILcdLayeredthat contains the givenILcdModel.- Specified by:
layerOfin interfaceILcdLayered- Parameters:
aModel- the model to check for in thisILcdLayered.- Returns:
- the
ILcdLayerof thisILcdLayeredthat contains the givenILcdModel. - Throws:
NoSuchElementException- if there is no layer containing the given model
-
indexOf
Description copied from interface:ILcdLayeredReturns the index if the given layer is in the list.- Specified by:
indexOfin interfaceILcdLayered- Parameters:
aLayer- the layer whose index to return- Returns:
- the index of
aLayer - Throws:
NoSuchElementException- ifaLayeris not in the list
-
containsLayer
Description copied from interface:ILcdLayerTreeNodeReturns whether thisILcdLayeredcontains the given layer. More formally, returnstrueif and only if theILcdLayeredcontains at least one layerlsuch 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.- Specified by:
containsLayerin interfaceILcdLayered- Specified by:
containsLayerin interfaceILcdLayerTreeNode- Parameters:
aLayer- the layer to check whether it is in this layered.- Returns:
- true if
aLayeris in thisILcdLayered, false otherwise.
-
removeLayer
Description copied from interface:ILcdLayeredRemoves aLayer from thisILcdLayered.- Specified by:
removeLayerin interfaceILcdLayered- Parameters:
aLayer- the layer to remove.- Throws:
NoSuchElementException
-
moveLayerAt
public void moveLayerAt(int aIndex, ILcdLayer aLayer) throws NoSuchElementException, ArrayIndexOutOfBoundsException Description copied from interface:ILcdLayeredMoves the given layer (which is already inILcdLayered) 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
aLayerbefore the move. If previousIndex < aIndex, then the index of allILcdLayerobjects in from previousIndex + 1 to aIndex is decremented with 1. If previousIndex > aIndex, then the index of allILcdLayerobjects in from aIndex to previousIndex -1 is incremented with 1.- Specified by:
moveLayerAtin interfaceILcdLayered- Parameters:
aIndex- the index of the position where to move the layer.aLayer- the layer to move.- Throws:
NoSuchElementException- ifaLayeris not in thisILcdLayered.ArrayIndexOutOfBoundsException- ifaIndexis not an index of one of the layers of thisILcdLayered.
-
addLayer
Description copied from interface:ILcdLayerTreeNodeAdds 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
aNewChildNodemust not already be an element of the tree. This method should also generate aTLcdLayeredEventto warn its listeners that a node has been added.- Specified by:
addLayerin interfaceILcdLayerTreeNode- Parameters:
aNewChildNode- the node which must be added as a child- Returns:
truewhen the layer was successfully added to this node,falseif the node already contained layeraNewChildNode- Throws:
IllegalArgumentException- when the node is already an element of the tree
-
addLayer
public boolean addLayer(ILcdLayer aNewChildNode, int aIndex) throws IndexOutOfBoundsException, IllegalArgumentException Description copied from interface:ILcdLayerTreeNodeAdds a new node to the tree as a child of this node. The child will be inserted at index
aIndexin the child list of this node. Notice that in order to avoid loops in the treeaNewChildNodemust not already be an element of the tree. This method should also generate aTLcdLayeredEventto warn its listeners that a node has been added.- Specified by:
addLayerin interfaceILcdLayerTreeNode- Parameters:
aNewChildNode- the new childaIndex- the index in the child list of this node for the new child- Returns:
truewhen the layer was successfully added to this node,falseif the node already contained layeraNewChildNode- Throws:
IndexOutOfBoundsException- whenindex >ILcdLayerTreeNode.layerCount()IllegalArgumentException- when the node is already an element of the tree
-
removeLayer
public void removeLayer(int aIndex) Description copied from interface:ILcdLayerTreeNodeRemoves the node at index
aIndexfrom this node and sends the appropriateTLcdLayeredEvent.- Specified by:
removeLayerin interfaceILcdLayerTreeNode- Parameters:
aIndex- the index of the child node which has to be removed
-
setPaintOnTopOfChildrenHint
public void setPaintOnTopOfChildrenHint(boolean aPaintOnTopOfChildrenHint) Description copied from interface:ILcdLayerTreeNodeSets 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.
- Specified by:
setPaintOnTopOfChildrenHintin interfaceILcdLayerTreeNode- Parameters:
aPaintOnTopOfChildrenHint-truewhen a node should be painted on top of its children,falsewhen the node should be painted underneath its child layers- See Also:
-
isPaintOnTopOfChildrenHint
public boolean isPaintOnTopOfChildrenHint()Description copied from interface:ILcdLayerTreeNodeReturns whether a node should be painted on top of its children when the node is added to a view, or beneath its child layers.
- Specified by:
isPaintOnTopOfChildrenHintin interfaceILcdLayerTreeNode- Returns:
truewhen a node should be painted on top of its children,falsewhen the node should be painted underneath its child layers- See Also:
-
getInitialLayerIndexProvider
Description copied from interface:ILcdLayerTreeNodeReturns 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.- Specified by:
getInitialLayerIndexProviderin interfaceILcdLayerTreeNode- Returns:
- the initial layer index provider. Can be
null - See Also:
-
setInitialLayerIndexProvider
Description copied from interface:ILcdLayerTreeNodeSets an initial layer index provider, which can be used to determine the best index when a layer is added without specifying an index.
- Specified by:
setInitialLayerIndexProviderin interfaceILcdLayerTreeNode- Parameters:
aInitialLayerIndexProvider- The new initial layer index provider. May benull- See Also:
-