TLcdGXYLayerTreeNode
insteadpublic class TLcdGXYLayerList extends Object implementsILcdGXYLayerList
ILcdGXYLayerList
.
It provides functionality to:
Since a layer list is an implementation of ILcdGXYLayer
, it is regarded as such by the view to which
it is added. Some care should thus be taken for certain operations:
By overriding the method canAddSubGXYLayer(ILcdGXYLayer)
method the layers to add to this list can be
restricted, which would for example enable the creation of a layer list that represents a theme.
Modifier and Type | Field and Description |
---|---|
static boolean |
TRACEON
Deprecated.
Indicates whether tracing information should be generated on the log or not.
|
Constructor and Description |
---|
TLcdGXYLayerList()
Deprecated.
Creates a layer list with no layers.
|
TLcdGXYLayerList(TLcdModelList aModelList,
ILcdGXYLayerFactory aGXYLayerFactory)
Deprecated.
Constructor to create a TLcdGXYLayerList based on an existing TLcdModelList.
|
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(PropertyChangeListener aListener)
Deprecated.
Adds a listener that will be notified of any changes of properties of this list.
|
void |
addSelectionListener(ILcdSelectionListener aListener)
Deprecated.
Adds a listener that will be notified of changes to the selection of sublayers in this list.
|
void |
addSubGXYLayer(ILcdGXYLayer aSubGXYLayer,
boolean aIsAdjusting)
Deprecated.
Adds the given
ILcdGXYLayer as a sublayer to this ILcdGXYLayerList . |
void |
addSubGXYLayer(ILcdGXYLayer aSubGXYLayer,
ILcdFilter aObjectInLayerFilter,
boolean aIsAdjusting)
Deprecated.
Adds the given
ILcdGXYLayer as a sublayer, accompanied by a filter to determine whether an object is
in the sublayers model or not. |
int |
applyOnInteract(ILcdFunction aFunction,
Rectangle aBounds,
boolean aStrictInteract,
ILcdGXYView aGXYView)
Deprecated.
Passes the function to apply to all of the visible sub layers as long as the function returns true for objects
in that sublayer.
|
boolean |
canAddSubGXYLayer(ILcdGXYLayer aSubGXYLayer)
Deprecated.
Returns whether the sublayer can be added, meaning it has the same
ILcdModelXYWorldTransfo class set as the layers already in the list, and
its ILcdModel has the same ILcdModelReference . |
void |
clearSelection(int aDispatchEventMode)
Deprecated.
Clears the selection on all sublayers.
|
boolean |
containsSubGXYLayer(ILcdGXYLayer aSubGXYLayer)
Deprecated.
Checks whether the sublayer is in this
ILcdGXYLayerList . |
void |
fireCollectedSelectionChanges()
Deprecated.
Fires events for all selection events collected by all sublayers.
|
protected void |
firePropertyChange(PropertyChangeEvent aEvent)
Deprecated.
Fire an existing PropertyChangeEvent to any registered listeners.
|
ILcdBounds |
getBounds(int aMode,
ILcdGXYView aGXYView)
Deprecated.
Returns the union of the bounds of the sublayers.
|
ILcdGXYEditor |
getGXYEditor(Object aObject)
Deprecated.
Finds a suitable editor for the given object by requesting the sublayers for a suitable editor.
|
ILcdGXYLabelPainter |
getGXYLabelPainter(Object aObject)
Deprecated.
Finds a suitable label painter for the given object by requesting the sublayers for a suitable label painter.
|
ILcdGXYPainter |
getGXYPainter(Object aObject)
Deprecated.
Finds a suitable painter for the given object by requesting the sublayers for a suitable painter.
|
ILcdGXYPen |
getGXYPen()
Deprecated.
Returns the pen used for all basic drawing operations for all sublayers.
|
ILcdIcon |
getIcon()
Deprecated.
Returns a small graphical representation for this layer list.
|
String |
getLabel()
Deprecated.
Returns the short textual representation for this list.
|
ILcdInterval |
getLabelScaleRange()
Deprecated.
Returns the union of all label scale ranges of the sublayers.
|
ILcdModel |
getModel()
Deprecated.
Returns a model list that contains all models of the layers in this list as submodels.
|
Class |
getModelXYWorldTransfoClass()
Deprecated.
Returns the class of the transformation used to transform model coordinates to view coordinates.
|
ILcdFilter |
getObjectInLayerFilter(ILcdGXYLayer aSubGXYLayer)
Deprecated.
Returns the filter used to find objects in the given sublayer.
|
ILcdInterval |
getScaleRange()
Deprecated.
Returns the union of all scale ranges of the sublayers.
|
int |
getSelectionCount()
Deprecated.
Returns the sum of all selection counts of all sublayers.
|
ILcdGXYLayer |
getSubGXYLayer(int aIndex)
Deprecated.
Returns the sublayer at the location with the given index in the list.
|
int |
getSubGXYLayerCount()
Deprecated.
Returns the number of sublayers in this
ILcdGXYLayerList . |
int |
indexOf(ILcdGXYLayer aSubGXYLayer)
Deprecated.
Gets the index of the given sublayer.
|
void |
insertSubGXYLayerAt(int aIndex,
ILcdGXYLayer aSubGXYLayer,
boolean aIsAdjusting)
Deprecated.
Inserts the given
ILcdGXYLayer as a sublayer at the given index. |
void |
insertSubGXYLayerAt(int aIndex,
ILcdGXYLayer aSubGXYLayer,
ILcdFilter aObjectInLayerFilter,
boolean aIsAdjusting)
Deprecated.
Inserts the given
ILcdGXYLayer as a sublayer at the given index, accompanied by a filter to determine
whether an object is in the sublayers model or not. |
boolean |
isEditable()
Deprecated.
Returns whether at least one of the sublayers is editable.
|
boolean |
isEditableSupported()
Deprecated.
Returns whether at least one of the sublayers supports editing.
|
boolean |
isLabeled()
Deprecated.
Returns whether at least one of the sublayers is labeled.
|
boolean |
isLabeledSupported()
Deprecated.
Returns whether at least one of the sublayers supports labeling.
|
protected boolean |
isObjectInLayer(Object aObject,
ILcdGXYLayer aGXYLayer)
Deprecated.
Determines if the given layers model contains the given object, by checking if the object passes
the filter associated with the layer.
|
boolean |
isSelectable()
Deprecated.
Returns whether at least one of the sublayers is selectable.
|
boolean |
isSelectableSupported()
Deprecated.
Returns whether at least on the sublayers supports selection.
|
boolean |
isSelected(Object aObject)
Deprecated.
Returns whether an object is selected in any of the sublayers.
|
boolean |
isVisible()
Deprecated.
Returns whether at least one of the sublayers is visible.
|
void |
moveSubGXYLayerAt(int aIndex,
ILcdGXYLayer aSubGXYLayer,
boolean aIsAdjusting)
Deprecated.
Moves the given
ILcdGXYLayer at the given index. |
void |
paint(Graphics aGraphics,
int aMode,
ILcdGXYView aGXYView)
Deprecated.
Paints all sublayers, one by one.
|
void |
removeAllSubGXYLayers(boolean aIsAdjusting)
Deprecated.
Removes all sublayers from this list.
|
void |
removePropertyChangeListener(PropertyChangeListener aListener)
Deprecated.
Removes a listener that will no longer be notified of any changes of properties of this list.
|
void |
removeSelectionListener(ILcdSelectionListener aListener)
Deprecated.
Removes a listener that will no longer be notified of changes to the selection of sublayers in this list.
|
void |
removeSubGXYLayer(ILcdGXYLayer aSubGXYLayer,
boolean aIsAdjusting)
Deprecated.
Removes the sublayer from this list.
|
Enumeration |
selectedObjects()
Deprecated.
Returns a collection of all selected objects in all sublayers.
|
void |
selectObject(Object aObject,
boolean aSelection,
int aDispatchEventMode)
Deprecated.
Selects or deselects an object in the last sublayer in which it appears.
|
void |
setEditable(boolean aEditable)
Deprecated.
Sets all sublayers editable.
|
void |
setGXYPen(ILcdGXYPen aGXYPen)
Deprecated.
The pen to use for all basic drawing operations for all sublayers.
|
void |
setIcon(ILcdIcon aIcon)
Deprecated.
Sets the small graphical representation for this layer list.
|
void |
setLabel(String aLabel)
Deprecated.
Sets the short textual representation for this list.
|
void |
setLabeled(boolean aLabeled)
Deprecated.
Sets all sublayers labeled or not labeled.
|
void |
setSelectable(boolean aSelectable)
Deprecated.
Sets all sublayers selectable at once.
|
void |
setVisible(boolean aVisible)
Deprecated.
Sets the visibility of all sublayers at once.
|
void |
stopPainting()
Deprecated.
Stops painting on all sublayers.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getLabelMapScaleRange, getMapScaleRange
getSelectedObjects
public static boolean TRACEON
public TLcdGXYLayerList()
setGXYPen(ILcdGXYPen)
public TLcdGXYLayerList(TLcdModelList aModelList, ILcdGXYLayerFactory aGXYLayerFactory)
canAddSubGXYLayer(ILcdGXYLayer)
will be added.
Note that in order to render this list, the pen should be set explicitly with setGXYPen(ILcdGXYPen)
.aModelList
- Model set for which the layer list has to be created.aGXYLayerFactory
- Layer factory for creating layers for the individual models of the set.canAddSubGXYLayer(ILcdGXYLayer)
protected void firePropertyChange(PropertyChangeEvent aEvent)
aEvent
- The PropertyChangeEvent object.public int getSubGXYLayerCount()
ILcdGXYLayerList
ILcdGXYLayerList
.getSubGXYLayerCount
in interface ILcdGXYLayerList
ILcdGXYLayerList
.public void addSubGXYLayer(ILcdGXYLayer aSubGXYLayer, boolean aIsAdjusting) throws IllegalArgumentException
ILcdGXYLayer
as a sublayer to this ILcdGXYLayerList
.
This implementation delegates to
addSubGXYLayer(ILcdGXYLayer, com.luciad.util.ILcdFilter, boolean)
with a null filter.addSubGXYLayer
in interface ILcdGXYLayerList
aSubGXYLayer
- the ILcdGXYLayer
to add to the list.aIsAdjusting
- true if more changes will be made immediately after this.IllegalArgumentException
- if the layer could not be added when failing canAddSubGXYLayer(ILcdGXYLayer)
.canAddSubGXYLayer(ILcdGXYLayer)
,
addSubGXYLayer(ILcdGXYLayer, com.luciad.util.ILcdFilter, boolean)
public void addSubGXYLayer(ILcdGXYLayer aSubGXYLayer, ILcdFilter aObjectInLayerFilter, boolean aIsAdjusting) throws IllegalArgumentException
ILcdGXYLayer
as a sublayer, accompanied by a filter to determine whether an object is
in the sublayers model or not.
Note that this can have an influence on the properties of the layer list. For example, when all sublayers currently
in the list are not visible, but the sublayer to be added is visible, the layer list property visible will
change from false to true.addSubGXYLayer
in interface ILcdGXYLayerList
aSubGXYLayer
- the ILcdGXYLayer
to add to the list.aObjectInLayerFilter
- the ILcdFilter
used to determine if an object is contained in this layer.aIsAdjusting
- true if more changes will be made immediately after this.IllegalArgumentException
- if the layer could not be added when failing
canAddSubGXYLayer(ILcdGXYLayer)
.canAddSubGXYLayer(ILcdGXYLayer)
,
isVisible()
public void insertSubGXYLayerAt(int aIndex, ILcdGXYLayer aSubGXYLayer, boolean aIsAdjusting) throws IllegalArgumentException
ILcdGXYLayer
as a sublayer at the given index.
This implementation delegates to insertSubGXYLayerAt(int, ILcdGXYLayer, com.luciad.util.ILcdFilter, boolean)
with a null filter.insertSubGXYLayerAt
in interface ILcdGXYLayerList
aIndex
- the index of the location in the list where this layer should be placed.aSubGXYLayer
- the ILcdGXYLayer
to insert into the list.aIsAdjusting
- true if more changes will be made immediately after this.IllegalArgumentException
- will be thrown if this ILcdGXYLayerList
contains
at least one ILcdGXYLayer
and the ILcdModelXYWorldTransfo
class
are different.public void insertSubGXYLayerAt(int aIndex, ILcdGXYLayer aSubGXYLayer, ILcdFilter aObjectInLayerFilter, boolean aIsAdjusting) throws IllegalArgumentException
ILcdGXYLayer
as a sublayer at the given index, accompanied by a filter to determine
whether an object is in the sublayers model or not.
Note that this can have an influence on the properties of the layer list. For example, when all sublayers currently
in the list are not visible, but the sublayer to be inserted is visible, the layer list property visible will
change from false to true.insertSubGXYLayerAt
in interface ILcdGXYLayerList
aIndex
- the index of the location in the list where this layer should be placed.aSubGXYLayer
- the sublayer.aObjectInLayerFilter
- the ILcdFilter
used to determine if an object is contained in this layer.aIsAdjusting
- true if more changes will be made immediately after this.IllegalArgumentException
- if the layer could not be added when failing
canAddSubGXYLayer(ILcdGXYLayer)
.canAddSubGXYLayer(ILcdGXYLayer)
,
isVisible()
public boolean canAddSubGXYLayer(ILcdGXYLayer aSubGXYLayer)
ILcdModelXYWorldTransfo
class set as the layers already in the list, and
its ILcdModel
has the same ILcdModelReference
.
This method is called from all methods adding or inserting sublayers to the layer list.aSubGXYLayer
- the sublayer.addSubGXYLayer(ILcdGXYLayer, boolean)
,
addSubGXYLayer(ILcdGXYLayer, com.luciad.util.ILcdFilter, boolean)
public ILcdGXYLayer getSubGXYLayer(int aIndex)
ILcdGXYLayerList
getSubGXYLayer
in interface ILcdGXYLayerList
aIndex
- the index of the location in the list.ILcdGXYLayer
at the location with the given index.public int indexOf(ILcdGXYLayer aSubGXYLayer) throws NoSuchElementException
ILcdGXYLayerList
indexOf
in interface ILcdGXYLayerList
aSubGXYLayer
- the sublayer to find the index of.NoSuchElementException
- when the given sublayer is not in this ILcdGXYLayerList
.public void moveSubGXYLayerAt(int aIndex, ILcdGXYLayer aSubGXYLayer, boolean aIsAdjusting) throws NoSuchElementException, ArrayIndexOutOfBoundsException
ILcdGXYLayer
at the given index. If aIsAdjusting is true, then
a PropertyChanged event will be sent, no event will be sent otherwise.moveSubGXYLayerAt
in interface ILcdGXYLayerList
aIndex
- the index of the new location in the ILcdGXYLayerList
.aSubGXYLayer
- the sublayer to move.aIsAdjusting
- true if more changes will be made immediately after this.NoSuchElementException
- when the given sublayer is not in this ILcdGXYLayerList
.ArrayIndexOutOfBoundsException
- when the given index is negative or not smaller than the number of sublayers.public void removeSubGXYLayer(ILcdGXYLayer aSubGXYLayer, boolean aIsAdjusting) throws NoSuchElementException
ILcdGXYLayerList
removeSubGXYLayer
in interface ILcdGXYLayerList
aSubGXYLayer
- the sublayer.aIsAdjusting
- true if more changes will be made immediately after this.NoSuchElementException
- when the given sublayer is not in this ILcdGXYLayerList
.public void removeAllSubGXYLayers(boolean aIsAdjusting)
ILcdGXYLayerList
removeAllSubGXYLayers
in interface ILcdGXYLayerList
aIsAdjusting
- true if more changes will be made immediately after this.public boolean containsSubGXYLayer(ILcdGXYLayer aSubGXYLayer)
ILcdGXYLayerList
ILcdGXYLayerList
.containsSubGXYLayer
in interface ILcdGXYLayerList
aSubGXYLayer
- the sublayer.ILcdGXYLayerList
, false otherwise.public ILcdFilter getObjectInLayerFilter(ILcdGXYLayer aSubGXYLayer)
ILcdGXYLayerList
getObjectInLayerFilter
in interface ILcdGXYLayerList
aSubGXYLayer
- the sublayer for which all elements in its model should pass the filter.ILcdFilter
that selects the elements in the given sublayer.public void paint(Graphics aGraphics, int aMode, ILcdGXYView aGXYView)
paint
in interface ILcdGXYLayer
aGraphics
- the Graphics to paint on.aMode
- indicates what should be painted and how it should be painted.aGXYView
- the view to paint for.ILcdGXYLayer.getGXYPainter(Object)
,
ILcdGXYLayer.getGXYLabelPainter(Object)
,
ILcdGXYLayer.getScaleRange()
,
ILcdGXYLayer.getLabelScaleRange()
,
ILcdGXYLayer.stopPainting()
public ILcdModel getModel()
public int getSelectionCount()
getSelectionCount
in interface ILcdSelection<Object>
public int applyOnInteract(ILcdFunction aFunction, Rectangle aBounds, boolean aStrictInteract, ILcdGXYView aGXYView)
applyOnInteract
in interface ILcdGXYLayer
aFunction
- the function to apply to all objects in the models of the sublayers. Note that this function
may be wrapped and sublayers must not assume that this function is applied directly to them.aBounds
- the view bounds containing the objects to which the function will be applied.aStrictInteract
- whether or not only objects strictly interacting with the view bounds should be taken
into accountaGXYView
- the view in which the objects are rendered.ILcdGXYLayer.applyOnInteract(com.luciad.util.ILcdFunction, java.awt.Rectangle, boolean, ILcdGXYView)
public void setLabel(String aLabel)
public String getLabel()
public Enumeration selectedObjects()
selectedObjects
in interface ILcdSelection<Object>
public ILcdBounds getBounds(int aMode, ILcdGXYView aGXYView) throws TLcdNoBoundsException
getBounds
in interface ILcdGXYLayer
aMode
- the layer mode to generate the bounds for.aGXYView
- the view in which this layer list is displayed.TLcdNoBoundsException
- when the list contains no layers, or when all the sublayers of
the list generated a no bounds exception.ILcdGXYLayer.getBounds(int, ILcdGXYView)
public boolean isSelected(Object aObject)
isSelected
in interface ILcdSelection<Object>
aObject
- the object to check.false
otherwise.public void stopPainting()
stopPainting
in interface ILcdGXYLayer
paint
public boolean isVisible()
isVisible
in interface ILcdLayer
false
if all sublayers are invisible.ILcdLayer.setVisible(boolean)
public void addSelectionListener(ILcdSelectionListener aListener)
addSelectionListener
in interface ILcdSelection<Object>
aListener
- a listener that will be notified of changes to the selection of sublayers in this list.public ILcdInterval getScaleRange()
getScaleRange
in interface ILcdGXYLayer
ILcdGXYLayer.getMapScaleRange()
public void setVisible(boolean aVisible)
setVisible
in interface ILcdLayer
aVisible
- true to make all sublayers visible at once, false to make them all invisible at once.ILcdLayer.isVisible()
public void removeSelectionListener(ILcdSelectionListener aListener)
removeSelectionListener
in interface ILcdSelection<Object>
aListener
- a listener that no longer will be notified of changes to the selection of sublayers in this list.public ILcdInterval getLabelScaleRange()
getLabelScaleRange
in interface ILcdGXYLayer
ILcdGXYLayer.getLabelMapScaleRange()
public boolean isSelectableSupported()
isSelectableSupported
in interface ILcdLayer
ILcdLayer.setSelectable(boolean)
,
ILcdLayer.selectObject(java.lang.Object, boolean, int)
protected boolean isObjectInLayer(Object aObject, ILcdGXYLayer aGXYLayer)
aObject
- the object to findaGXYLayer
- the ILcdGXYLayer to checkgetObjectInLayerFilter(com.luciad.view.gxy.ILcdGXYLayer)
public ILcdGXYPainter getGXYPainter(Object aObject)
getGXYPainter
in interface ILcdGXYLayer
aObject
- the object to find a painter for. Note that it would be possible to request a painter
for an object that is not in any of the sublayers.public boolean isSelectable()
isSelectable
in interface ILcdLayer
ILcdSelection
,
ILcdLayer.setSelectable(boolean)
public ILcdGXYEditor getGXYEditor(Object aObject)
getGXYEditor
in interface ILcdGXYLayer
aObject
- the object to find a editor for. Note that it would be possible to request an editor
for an object that is not in any of the sublayers.public void setSelectable(boolean aSelectable)
setSelectable
in interface ILcdLayer
aSelectable
- true to set all sublayers selectable at once, false to set all sublayers not selectable at once.ILcdLayer.isSelectable()
,
ILcdLayer.isSelectableSupported()
public ILcdGXYLabelPainter getGXYLabelPainter(Object aObject)
getGXYLabelPainter
in interface ILcdGXYLayer
aObject
- the object to find a label painter for. Note that it would be possible to request a label painter
for an object that is not in any of the sublayers.public boolean isEditableSupported()
isEditableSupported
in interface ILcdLayer
ILcdLayer.setEditable(boolean)
public ILcdGXYPen getGXYPen()
getGXYPen
in interface ILcdGXYLayer
setGXYPen(ILcdGXYPen)
public void setGXYPen(ILcdGXYPen aGXYPen)
setGXYPen
in interface ILcdGXYLayerList
aGXYPen
- the pen to use for all basic drawing operations for all sublayers.getGXYPen()
public boolean isEditable()
isEditable
in interface ILcdLayer
ILcdLayer.setEditable(boolean)
public void setIcon(ILcdIcon aIcon)
setIcon
in interface ILcdLayer
aIcon
- a small graphical representation for this layer list.ILcdLayer.getIcon()
public ILcdIcon getIcon()
public void setEditable(boolean aEditable)
setEditable
in interface ILcdLayer
aEditable
- true to make all sublayers editable, false to make all sublayers non editable.ILcdLayer.isEditableSupported()
,
ILcdLayer.isEditable()
public Class getModelXYWorldTransfoClass()
getModelXYWorldTransfoClass
in interface ILcdGXYLayer
public void selectObject(Object aObject, boolean aSelection, int aDispatchEventMode)
selectObject
in interface ILcdLayer
aObject
- the object to select or deselectaSelection
- whether to select or deselect the objectaDispatchEventMode
- indication of whether the selection listeners should be notified.ILcdFireEventMode
public boolean isLabeledSupported()
isLabeledSupported
in interface ILcdGXYLayer
public void fireCollectedSelectionChanges()
fireCollectedSelectionChanges
in interface ILcdLayer
public boolean isLabeled()
isLabeled
in interface ILcdGXYLayer
ILcdGXYLayer.isLabeledSupported()
public void setLabeled(boolean aLabeled)
setLabeled
in interface ILcdGXYLayer
aLabeled
- true to set all sublayers labeled, false to set all sublayers not labeled.public void clearSelection(int aDispatchEventMode)
clearSelection
in interface ILcdLayer
aDispatchEventMode
- designates whether listeners should be notified of this clearance.ILcdFireEventMode
public void addPropertyChangeListener(PropertyChangeListener aListener)
addPropertyChangeListener
in interface ILcdPropertyChangeSource
aListener
- will be notified when one of the properties of the list changes.removePropertyChangeListener(java.beans.PropertyChangeListener)
public void removePropertyChangeListener(PropertyChangeListener aListener)
removePropertyChangeListener
in interface ILcdPropertyChangeSource
aListener
- will no longer be notified when one of the properties of the list changes.addPropertyChangeListener(java.beans.PropertyChangeListener)