public class TLcdMapLonLatGridLayer extends Object implements ILcdGXYLayer, ILcdNotLabelDeconflictableLayer
ILcdGXYLayer
can be added in an ILcdGXYView
to display a TLcdLonLatGrid
.
Note: the model of this layer does not contain the grid painted by the
painter on this layer. The grid can be accessed through the method
getLonLatGrid()
.Constructor and Description |
---|
TLcdMapLonLatGridLayer() |
TLcdMapLonLatGridLayer(String aLabel) |
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(PropertyChangeListener aPropertyChangeListener)
Associate a
PropertyChangeListener to this ILcdLayer |
void |
addSelectionListener(ILcdSelectionListener aSelectionListener)
Performs no operations.
|
int |
applyOnInteract(ILcdFunction aFunction,
Rectangle aBounds,
boolean aStrictInteract,
ILcdGXYView aGXYView)
Performs no action.
|
void |
clearSelection(int aDispatchEventMode)
Performs no operations.
|
void |
fireCollectedSelectionChanges()
Performs no operations.
|
void |
firePropertyChangeEvent(PropertyChangeEvent aPropertyChangeEvent) |
ILcdBounds |
getBounds(int aMode,
ILcdGXYView aGXYView)
This method returns the view bounds of this
TLcdMapLonLatGridLayer , taking
into account the XYWorldReference of the given ILcdGXYView aGXYView. |
TLcdLonLatGridPainter |
getGridPainter()
Deprecated.
Use
getGXYPainter() . |
ILcdGXYEditor |
getGXYEditor(Object aObject)
Returns the editor to use to modify the object via a view.
|
ILcdGXYLabelPainter |
getGXYLabelPainter(Object aObject)
Returns the label painter to use to paint the objects label in a view.
|
ILcdGXYPainter |
getGXYPainter()
Returns the
ILcdGXYPainter that paints the
longitude/latitude grid. |
ILcdGXYPainter |
getGXYPainter(Object aObject)
Returns the painter to use to render the object in a view.
|
ILcdGXYPen |
getGXYPen()
Returns the pen used to perform basic rendering operations
|
ILcdIcon |
getIcon()
Gets the icon for this layer
|
String |
getLabel()
A short textual representation of this
ILcdLayer . |
ILcdInterval |
getLabelScaleRange()
The label scale range is the same as the scale range for a
TLcdMapLonLatGridLayer . |
TLcdLonLatGrid |
getLonLatGrid() |
ILcdModel |
getModel() |
Class |
getModelXYWorldTransfoClass()
Returns the transformation class that to use to transform points and bounds from model space to world space and
back.
|
ILcdInterval |
getScaleRange()
Returns the toolkit scale range for which to display elements of the model.
|
int |
getSelectionCount()
Returns the number of objects in this selection.
|
boolean |
hasUserPen()
Deprecated.
do not use this method
|
boolean |
isAntiAliased()
Returns if anti-aliasing is enabled.
|
boolean |
isEditable()
Returns whether the layer allows editing the content that it visualizes.
|
boolean |
isEditableSupported()
Returns
true if the layer supports editing its objects. |
boolean |
isLabeled()
The property isLabeled determines whether to label the grid.
|
boolean |
isLabeledSupported()
Returns whether this layer supports representing objects as text.
|
boolean |
isSelectable()
Returns whether the layer's objects can be selected, for example, by clicking on them.
|
boolean |
isSelectableSupported()
Returns
true if this layer supports selecting objects, false otherwise. |
boolean |
isSelected(Object aObject)
Checks whether the given
Object is currently in the set of
selected objects. |
boolean |
isTraceOn()
Deprecated.
This method has been deprecated. It is recommended to use the
standard Java logging framework directly.
|
boolean |
isVisible()
The property isVisible determines whether the grid is visible.
|
void |
paint(Graphics aGraphics,
int aMode,
ILcdGXYView aGXYView)
Paints the
TLcdLonLatGrid , taking into account the given mode, and delegating
to the configured grid painter. |
void |
removePropertyChangeListener(PropertyChangeListener aPropertyChangeListener)
If the
PropertyChangeListener aPropertyChangeListener is associated to this
ILcdLayer , it will not be associated to this ILcdLayer afterward. |
void |
removeSelectionListener(ILcdSelectionListener aSelectionListener)
Performs no operations.
|
Enumeration |
selectedObjects()
Returns the objects in this selection.
|
void |
selectObject(Object aObject,
boolean aSelection,
int aDispatchEventMode)
Performs no operations.
|
void |
setAntiAliased(boolean aAntiAliased)
Enable or disable anti-aliasing.
|
static void |
setClassTraceOn(boolean aClassTraceOn)
Deprecated.
This method has been deprecated. It is recommended to use the
standard Java logging framework directly.
|
void |
setEditable(boolean aEditable)
Does not perform any operation.
|
void |
setGridPainter(TLcdLonLatGridPainter aGXYPainter)
Deprecated.
|
void |
setGXYPainter(ILcdGXYPainter aGXYPainter)
Sets the
ILcdGXYPainter that paints the
longitude/latitude grid. |
void |
setGXYPen(ILcdGXYPen aGXYPen)
Sets the pen to use to perform basic rendering operations.
|
void |
setIcon(ILcdIcon aIcon)
Sets the icon for this layer.
|
void |
setLabel(String aLabel)
Sets the label of this
ILcdLayer to aLabel. |
void |
setLabeled(boolean aLabeled)
The property isLabeled determines whether to label the grid.
|
void |
setLonLatGrid(TLcdLonLatGrid aLonLatGrid)
Sets lonLatGrid which represents the
TLcdLonLatGrid object that is
associated to this TLcdMapLonLatGridLayer to aLonLatGrid. |
void |
setScaleRange(ILcdInterval aScaleRange)
Sets the scale range in which this
ILcdGXYLayer will paint its elements. |
void |
setSelectable(boolean aSelectable)
Does not perform any operation.
|
void |
setTraceOn(boolean aTraceOn)
Deprecated.
This method has been deprecated. It is recommended to use the
standard Java logging framework directly.
|
void |
setVisible(boolean aVisible)
The property isVisible determines whether the grid is visible.
|
void |
stopPainting()
Inform the layer that it should terminate the current paint operation.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getLabelMapScaleRange, getMapScaleRange
getSelectedObjects
public TLcdMapLonLatGridLayer()
public TLcdMapLonLatGridLayer(String aLabel)
public static void setClassTraceOn(boolean aClassTraceOn)
true
then all log messages are recorded, otherwise only
the informative, warning and error messages are recorded.aClassTraceOn
- if true then all log messages are recorded,
otherwise only the informative, warning and error messages are recorded.public void setTraceOn(boolean aTraceOn)
true
or false
as argument automatically turns
off tracing for all other class instances for which
setTraceOn
has not been called.
If the argument is false
then only the informative, warning
and error log messages are recorded.aTraceOn
- if true then all log messages are recorded for this
instance. If false, then only the informative, warning and
error log messages are recorded.public boolean isTraceOn()
true
if tracing is enabled for this class.public ILcdGXYPainter getGXYPainter(Object aObject)
ILcdGXYLayer
setObject
in ILcdGXYPainter.getGXYPainter
in interface ILcdGXYLayer
aObject
- the object to find a painter for.null
.public ILcdGXYLabelPainter getGXYLabelPainter(Object aObject)
ILcdGXYLayer
setObject
in ILcdGXYLabelPainter.getGXYLabelPainter
in interface ILcdGXYLayer
aObject
- the object to find a label painter for.null
.public ILcdGXYEditor getGXYEditor(Object aObject)
ILcdGXYLayer
setObject
in ILcdGXYEditor.getGXYEditor
in interface ILcdGXYLayer
aObject
- the object to find an editor for.null
.public int applyOnInteract(ILcdFunction aFunction, Rectangle aBounds, boolean aStrictInteract, ILcdGXYView aGXYView)
applyOnInteract
in interface ILcdGXYLayer
aFunction
- the function to apply. When the function returns false, no more objects should be passed to
the function.aBounds
- all objects who lie partially or completely in this area in the view are candidates to be passed to
the function.aStrictInteract
- if true
, the ILcdFunction
shall be applied only to the objects
interacting with the given bounds. When false is passed, other objects may be taken into account too.
When applying the function to an object consumes less time than checking whether an objects representation
interacts with the bounds, non-strict interaction is generally faster.aGXYView
- the view in whose bounds the objects representations should be in order to be passed to the
function.public ILcdIcon getIcon()
public void setIcon(ILcdIcon aIcon)
setIcon
in interface ILcdLayer
aIcon
- a visual indication of the contents of this layer.ILcdLayer.getIcon()
public ILcdGXYPen getGXYPen()
getGXYPen
in interface ILcdGXYLayer
public void setGXYPen(ILcdGXYPen aGXYPen)
aGXYPen
- the pen to use to perform basic rendering.public boolean hasUserPen()
public void setGridPainter(TLcdLonLatGridPainter aGXYPainter)
setGXYPainter(ILcdGXYPainter)
.TLcdLonLatGridPainter
that paints the
longitude/latitude grid.aGXYPainter
- a TLcdLonLatGridPainter
that
is responsible for painting a Longitude-Latitude grid. It should accept TLcdLonLatGrid
objects.public TLcdLonLatGridPainter getGridPainter()
getGXYPainter()
.TLcdLonLatGridPainter
that paints the
longitude/latitude grid.public void setGXYPainter(ILcdGXYPainter aGXYPainter)
ILcdGXYPainter
that paints the
longitude/latitude grid.public ILcdGXYPainter getGXYPainter()
ILcdGXYPainter
that paints the
longitude/latitude grid.public final void setAntiAliased(boolean aAntiAliased)
When activated, anti-aliasing will be applied on both the labels and the lines.
See also ILcdGXYView.isAntiAliased()
.
aAntiAliased
- true to enable anti-aliasing.isAntiAliased()
public final boolean isAntiAliased()
setAntiAliased(boolean)
public void setScaleRange(ILcdInterval aScaleRange)
ILcdGXYLayer
will paint its elements.
The paint method of an ILcdGXYLayer
shall not perform any action when:aGXYContext.getGXYView().getScale()
< getDisplayRange().getMin()
aGXYContext.getGXYView().getScale()
>= getDisplayRange().getMax()
public ILcdInterval getScaleRange()
ILcdGXYLayer
view.getScale()
< getScaleRange().getMin()
or
view.getScale()
>= getScaleRange().getMax()
.
This does not imply that all objects in the model should be painted when the scale is inside this range as
other restrictions may apply. For example, a layer may have a filter which defines which objects should be painted.
For most use cases, we recommended using the unitless map scale range
instead.
This property is mutually exclusive with the map scale range:
only one of them has a non-null
value.getScaleRange
in interface ILcdGXYLayer
ILcdInterval
containing the minimum and maximum value of view scales for which objects
should be rendered, excluding the maximum. null
if the scale constraints are determined by ILcdGXYLayer.getMapScaleRange()
.
The scales are expressed in toolkit pixels/world unit.setScaleRange(com.luciad.util.ILcdInterval)
public ILcdInterval getLabelScaleRange()
TLcdMapLonLatGridLayer
.getLabelScaleRange
in interface ILcdGXYLayer
ILcdInterval
containing the minimum and maximum value of view scales for which
labels should be rendered, excluding the maximum.
null
if the scale constraints are determined by ILcdGXYLayer.getLabelMapScaleRange()
The scales are expressed in toolkit pixels/world unit.setScaleRange(com.luciad.util.ILcdInterval)
public ILcdBounds getBounds(int aMode, ILcdGXYView aGXYView)
TLcdMapLonLatGridLayer
, taking
into account the XYWorldReference of the given ILcdGXYView
aGXYView.getBounds
in interface ILcdGXYLayer
aMode
- a bitwise combination of ALL or SELECTION and one or more of BODIES and HANDLES.
The ILcdGXYLayer.LABELS
mode is not supported.aGXYView
- the view in which the layer could be placed. This enables taking into account the views settings,
for example the scale.public void paint(Graphics aGraphics, int aMode, ILcdGXYView aGXYView)
TLcdLonLatGrid
, taking into account the given mode, and delegating
to the configured grid painter.
For TLcdLonLatGridPainter
and TLcdLonLatBorderGridPainter
instances,
the setLabeled
flag will be set according to the given paint mode.paint
in interface ILcdGXYLayer
aMode
- a combination of ILcdGXYLayer.OBJECTS
, ILcdGXYLayer.LABELS
,
ILcdGXYLayer.SELECTION_HANDLES
.aGraphics
- Graphics
to consider for painting.aGXYView
- the ILcdGXYView
that contains this ILcdLayer
.ILcdGXYLayer.getGXYPainter(Object)
,
ILcdGXYLayer.getGXYLabelPainter(Object)
,
ILcdGXYLayer.getScaleRange()
,
ILcdGXYLayer.getLabelScaleRange()
,
ILcdGXYLayer.stopPainting()
public void stopPainting()
ILcdGXYLayer
Thread
and needs to be
stopped in a safe state from another Thread.stopPainting
in interface ILcdGXYLayer
paint
public void addPropertyChangeListener(PropertyChangeListener aPropertyChangeListener)
PropertyChangeListener
to this ILcdLayer
addPropertyChangeListener
in interface ILcdPropertyChangeSource
aPropertyChangeListener
- The listener to be notifiedALcdWeakPropertyChangeListener
,
ILcdPropertyChangeSource.removePropertyChangeListener(java.beans.PropertyChangeListener)
public void removePropertyChangeListener(PropertyChangeListener aPropertyChangeListener)
PropertyChangeListener
aPropertyChangeListener is associated to this
ILcdLayer
, it will not be associated to this ILcdLayer
afterward.removePropertyChangeListener
in interface ILcdPropertyChangeSource
aPropertyChangeListener
- the listener that should no longer be notified of changes of
this object's propertiesILcdPropertyChangeSource.addPropertyChangeListener(java.beans.PropertyChangeListener)
public void firePropertyChangeEvent(PropertyChangeEvent aPropertyChangeEvent)
public TLcdLonLatGrid getLonLatGrid()
TLcdLonLatGrid
object that is
associated to this TLcdMapLonLatGridLayer
.public void setLonLatGrid(TLcdLonLatGrid aLonLatGrid)
TLcdLonLatGrid
object that is
associated to this TLcdMapLonLatGridLayer
to aLonLatGrid.public ILcdModel getModel()
public void setVisible(boolean aVisible)
setVisible
in interface ILcdLayer
aVisible
- true
if the layer should be visible, false
otherwise.ILcdLayer.isVisible()
public boolean isVisible()
isVisible
in interface ILcdLayer
true
if isVisible is true
, else false
is returned.ILcdLayer.setVisible(boolean)
public boolean isEditableSupported()
ILcdLayer
true
if the layer supports editing its objects.isEditableSupported
in interface ILcdLayer
false
ILcdLayer.setEditable(boolean)
public boolean isEditable()
ILcdLayer
isEditable
in interface ILcdLayer
false
ILcdLayer.setEditable(boolean)
public void setEditable(boolean aEditable)
false
setEditable
in interface ILcdLayer
aEditable
- true if the layer content can be editedILcdLayer.isEditableSupported()
,
ILcdLayer.isEditable()
public boolean isSelectableSupported()
ILcdLayer
true
if this layer supports selecting objects, false
otherwise.isSelectableSupported
in interface ILcdLayer
false
ILcdLayer.setSelectable(boolean)
,
ILcdLayer.selectObject(java.lang.Object, boolean, int)
public boolean isSelectable()
ILcdLayer
isSelectable
in interface ILcdLayer
false
ILcdSelection
,
ILcdLayer.setSelectable(boolean)
public void setSelectable(boolean aSelectable)
false
setSelectable
in interface ILcdLayer
aSelectable
- true
if the layer allows selection, false
otherwise.ILcdLayer.isSelectable()
,
ILcdLayer.isSelectableSupported()
public boolean isLabeledSupported()
ILcdGXYLayer
isLabeledSupported
in interface ILcdGXYLayer
true
public boolean isLabeled()
isLabeled
in interface ILcdGXYLayer
true
if isLabeled is true
, else false
is returned.ILcdGXYLayer.isLabeledSupported()
public void setLabeled(boolean aLabeled)
setLabeled
in interface ILcdGXYLayer
aLabeled
- true to have a textual representation of the objects in the model, false to have no such
representation.public String getLabel()
ILcdLayer
ILcdLayer
.public void setLabel(String aLabel)
ILcdLayer
to aLabel.public int getSelectionCount()
ILcdSelection
getSelectionCount
in interface ILcdSelection<Object>
public Enumeration selectedObjects()
ILcdSelection
selectedObjects
in interface ILcdSelection<Object>
TLcdEmptyEnumeration.getInstance
().public boolean isSelected(Object aObject)
ILcdSelection
Object
is currently in the set of
selected objects.isSelected
in interface ILcdSelection<Object>
aObject
- the Object
to be checked.false
.public void selectObject(Object aObject, boolean aSelection, int aDispatchEventMode)
selectObject
in interface ILcdLayer
aObject
- the Object
to select or deselect. The object should be in the model
of this layer. The implementation of this method is not responsible for checking this.aSelection
- the selection state, true
to select, false
to deselect.aDispatchEventMode
- shall be one among ILcdFireEventMode.FIRE_NOW
,
ILcdFireEventMode.FIRE_LATER
, ILcdFireEventMode.NO_EVENT
ILcdFireEventMode
public void fireCollectedSelectionChanges()
fireCollectedSelectionChanges
in interface ILcdLayer
public void clearSelection(int aDispatchEventMode)
clearSelection
in interface ILcdLayer
aDispatchEventMode
- shall be one among ILcdFireEventMode.FIRE_NOW
,
ILcdFireEventMode.FIRE_LATER
, ILcdFireEventMode.NO_EVENT
ILcdFireEventMode
public void addSelectionListener(ILcdSelectionListener aSelectionListener)
addSelectionListener
in interface ILcdSelection<Object>
aSelectionListener
- the ILcdSelectionListener
to be added.public void removeSelectionListener(ILcdSelectionListener aSelectionListener)
removeSelectionListener
in interface ILcdSelection<Object>
aSelectionListener
- the ILcdSelectionListener
to be removed.public Class getModelXYWorldTransfoClass()
ILcdGXYLayer
getModelXYWorldTransfoClass
in interface ILcdGXYLayer
TLcdModelXYWorldTransformation.class
.