public abstract class ALspLabelLocations extends Object
ALspLabelLocations
is the central place where information is kept about the
position of labels and whether or not they are visible. It can store locations and their
visibility for multiple layers.
For a label, this information is updated using
setLabelLocations
: updates the locations and resets all visibilitiesupdateLabelLocations
: updates the locations and visibilities of the given labels onlygetLabelLocation
to get information for one labelgetLabelLocations
to get information for a set of labelsIt is up to the implementation of this class how this information is stored. One implementation may store the information inside the domain objects, while another implementation may store this information external to the domain object in some sort of map.
Modifier and Type | Class and Description |
---|---|
static class |
ALspLabelLocations.LocationInfo
Encapsulates a label and its location and visibility.
|
Constructor and Description |
---|
ALspLabelLocations() |
Modifier and Type | Method and Description |
---|---|
abstract void |
addLabelLocationListener(ILspLabelLocationChangeListener aListener)
Adds the specified listener to this information store.
|
abstract ALspLabelLocations.LocationInfo |
getLabelLocation(ILspView aView,
TLspLabelID aLabel)
Returns the location and visibility for the requested label.
|
abstract Iterable<ALspLabelLocations.LocationInfo> |
getLabelLocations(ILspView aView,
ILspLayer aLayer,
TLspPaintRepresentation aPaintRepresentation,
boolean aVisibleOnly)
Retrieves the current set of label locations and visibilities.
|
abstract void |
removeLabelLocationListener(ILspLabelLocationChangeListener aListener)
Removes the specified listener.
|
abstract void |
setLabelLocations(List<TLspLabelID> aLabels,
List<ALspLabelLocation> aLocations,
List<Boolean> aVisibilities,
ILspView aView)
Stores the given location information so it can be
retrieved
later on. |
abstract void |
updateLabelLocations(List<TLspLabelID> aLabels,
List<ALspLabelLocation> aLocations,
List<Boolean> aVisibilities,
ILspView aView)
Stores the given location information so it can be
retrieved
later on. |
public abstract void addLabelLocationListener(ILspLabelLocationChangeListener aListener)
aListener
- The listener that should be informed when there are changes in the label
information.updateLabelLocations(java.util.List<com.luciad.view.lightspeed.painter.label.TLspLabelID>, java.util.List<com.luciad.view.lightspeed.label.location.ALspLabelLocation>, java.util.List<java.lang.Boolean>, com.luciad.view.lightspeed.ILspView)
public abstract void removeLabelLocationListener(ILspLabelLocationChangeListener aListener)
aListener
- The listener to remove.public abstract void setLabelLocations(List<TLspLabelID> aLabels, List<ALspLabelLocation> aLocations, List<Boolean> aVisibilities, ILspView aView)
Stores the given location information so it can be retrieved
later on.
Note that this call sets all labels that are not explicitly specified to invisible.
This method also allows to remove the information: just let the ALspLabelLocation be
null
.
aLabels
- An array of objects identifying a label to which this information applies.aLocations
- An array of locations. No references to the locations are kept within the
implementations of this class. This allows the client of this class to
reuse the same locations. If this location is null
, any
label information already present in this instance about the given
representation is removed from this class.aVisibilities
- An array of boolean
s indicating visibility of the labels.aView
- The view for which the location applies.updateLabelLocations(java.util.List<com.luciad.view.lightspeed.painter.label.TLspLabelID>, java.util.List<com.luciad.view.lightspeed.label.location.ALspLabelLocation>, java.util.List<java.lang.Boolean>, com.luciad.view.lightspeed.ILspView)
public abstract void updateLabelLocations(List<TLspLabelID> aLabels, List<ALspLabelLocation> aLocations, List<Boolean> aVisibilities, ILspView aView)
Stores the given location information so it can be retrieved
later on.
This call only changes the location and visibility of the specified labels, and leaves the other labels untouched.
This method also allows to remove the information: just let the ALspLabelLocation be
null
.
aLabels
- An array of objects identifying a label to which this information applies.aLocations
- An array of locations. No references to the locations are kept within the
implementations of this class. This allows the client of this class to
reuse the same locations. If this location is null
, any
label information already present in this instance about the given
representation is removed from this class.aVisibilities
- The identifiers for the labels that should be visible.aView
- The view for which the location applies.setLabelLocations(java.util.List<com.luciad.view.lightspeed.painter.label.TLspLabelID>, java.util.List<com.luciad.view.lightspeed.label.location.ALspLabelLocation>, java.util.List<java.lang.Boolean>, com.luciad.view.lightspeed.ILspView)
public abstract ALspLabelLocations.LocationInfo getLabelLocation(ILspView aView, TLspLabelID aLabel)
This method never return null
, but the location inside can be null
.
aView
- The viewaLabel
- The labelnull
public abstract Iterable<ALspLabelLocations.LocationInfo> getLabelLocations(ILspView aView, ILspLayer aLayer, TLspPaintRepresentation aPaintRepresentation, boolean aVisibleOnly)
aView
- The view to retrieve the information for, never null
aLayer
- The layer to retrieve the information for, can be null
if all layers relevantaPaintRepresentation
- The paint representation to retrieve the information, can be null
if the layer is also null
aVisibleOnly
- Indicates whether all information is necessary, or only that of visible labels