Package com.luciad.view.map
Class TLcdMapLonLatGridLayer
java.lang.Object
com.luciad.view.map.TLcdMapLonLatGridLayer
- All Implemented Interfaces:
ILcdPropertyChangeSource
,ILcdSelection<Object>
,ILcdGXYLayer
,ILcdNotLabelDeconflictableLayer
,ILcdLayer
,Serializable
- Direct Known Subclasses:
TLcyDynamicLonLatGridLayer
public class TLcdMapLonLatGridLayer
extends Object
implements ILcdGXYLayer, ILcdNotLabelDeconflictableLayer
This
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()
.- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addPropertyChangeListener
(PropertyChangeListener aPropertyChangeListener) Associate aPropertyChangeListener
to thisILcdLayer
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
Performs no operations.void
firePropertyChangeEvent
(PropertyChangeEvent aPropertyChangeEvent) getBounds
(int aMode, ILcdGXYView aGXYView) This method returns the view bounds of thisTLcdMapLonLatGridLayer
, taking into account the XYWorldReference of the givenILcdGXYView
aGXYView.Deprecated.getGXYEditor
(Object aObject) Returns the editor to use to modify the object via a view.getGXYLabelPainter
(Object aObject) Returns the label painter to use to paint the objects label in a view.Returns theILcdGXYPainter
that paints the longitude/latitude grid.getGXYPainter
(Object aObject) Returns the painter to use to render the object in a view.Returns the pen used to perform basic rendering operationsgetIcon()
Gets the icon for this layergetLabel()
A short textual representation of thisILcdLayer
.The label scale range is the same as the scale range for aTLcdMapLonLatGridLayer
.getModel()
Returns the transformation class that to use to transform points and bounds from model space to world space and back.Returns the toolkit scale range for which to display elements of the model.int
Returns the number of objects in this selection.boolean
Deprecated.do not use this methodfinal boolean
Returns if anti-aliasing is enabled.boolean
Returns whether the layer allows editing the content that it visualizes.boolean
Returnstrue
if the layer supports editing its objects.boolean
The property isLabeled determines whether to label the grid.boolean
Returns whether this layer supports representing objects as text.boolean
Returns whether the layer's objects can be selected, for example, by clicking on them.boolean
Returnstrue
if this layer supports selecting objects,false
otherwise.boolean
isSelected
(Object aObject) Checks whether the givenObject
is currently in the set of selected objects.boolean
Deprecated.This method has been deprecated.boolean
The property isVisible determines whether the grid is visible.void
paint
(Graphics aGraphics, int aMode, ILcdGXYView aGXYView) Paints theTLcdLonLatGrid
, taking into account the given mode, and delegating to the configured grid painter.void
removePropertyChangeListener
(PropertyChangeListener aPropertyChangeListener) If thePropertyChangeListener
aPropertyChangeListener is associated to thisILcdLayer
, it will not be associated to thisILcdLayer
afterward.void
removeSelectionListener
(ILcdSelectionListener aSelectionListener) Performs no operations.Returns the objects in this selection.void
selectObject
(Object aObject, boolean aSelection, int aDispatchEventMode) Performs no operations.final void
setAntiAliased
(boolean aAntiAliased) Enable or disable anti-aliasing.static void
setClassTraceOn
(boolean aClassTraceOn) Deprecated.This method has been deprecated.void
setEditable
(boolean aEditable) Does not perform any operation.void
setGridPainter
(TLcdLonLatGridPainter aGXYPainter) Deprecated.void
setGXYPainter
(ILcdGXYPainter aGXYPainter) Sets theILcdGXYPainter
that paints the longitude/latitude grid.void
setGXYPen
(ILcdGXYPen aGXYPen) Sets the pen to use to perform basic rendering operations.void
Sets the icon for this layer.void
Sets the label of thisILcdLayer
to aLabel.void
setLabeled
(boolean aLabeled) The property isLabeled determines whether to label the grid.void
setLonLatGrid
(TLcdLonLatGrid aLonLatGrid) Sets lonLatGrid which represents theTLcdLonLatGrid
object that is associated to thisTLcdMapLonLatGridLayer
to aLonLatGrid.void
setScaleRange
(ILcdInterval aScaleRange) Sets the scale range in which thisILcdGXYLayer
will paint its elements.void
setSelectable
(boolean aSelectable) Does not perform any operation.void
setTraceOn
(boolean aTraceOn) Deprecated.This method has been deprecated.void
setVisible
(boolean aVisible) The property isVisible determines whether the grid is visible.void
Inform the layer that it should terminate the current paint operation.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.luciad.view.gxy.ILcdGXYLayer
getLabelMapScaleRange, getMapScaleRange
Methods inherited from interface com.luciad.util.ILcdSelection
getSelectedObjects
-
Constructor Details
-
TLcdMapLonLatGridLayer
public TLcdMapLonLatGridLayer() -
TLcdMapLonLatGridLayer
-
-
Method Details
-
setClassTraceOn
public static void setClassTraceOn(boolean aClassTraceOn) Deprecated.This method has been deprecated. It is recommended to use the standard Java logging framework directly.Enables tracing for all instances of this class. If the argument istrue
then all log messages are recorded, otherwise only the informative, warning and error messages are recorded.- Parameters:
aClassTraceOn
- if true then all log messages are recorded, otherwise only the informative, warning and error messages are recorded.
-
setTraceOn
public void setTraceOn(boolean aTraceOn) Deprecated.This method has been deprecated. It is recommended to use the standard Java logging framework directly.Enables tracing for this class instance. Calling this method with eithertrue
orfalse
as argument automatically turns off tracing for all other class instances for whichsetTraceOn
has not been called. If the argument isfalse
then only the informative, warning and error log messages are recorded.- Parameters:
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.
-
isTraceOn
public boolean isTraceOn()Deprecated.This method has been deprecated. It is recommended to use the standard Java logging framework directly.Returnstrue
if tracing is enabled for this class.- Returns:
- true if tracing is enabled for this class, false otherwise.
-
getGXYPainter
Description copied from interface:ILcdGXYLayer
Returns the painter to use to render the object in a view. If no painter is available, the object has no representation. When a painter is available, the object shall be assigned to the painter before using the painter, seesetObject
in ILcdGXYPainter.- Specified by:
getGXYPainter
in interfaceILcdGXYLayer
- Parameters:
aObject
- the object to find a painter for.- Returns:
null
.
-
getGXYLabelPainter
Description copied from interface:ILcdGXYLayer
Returns the label painter to use to paint the objects label in a view. If no label painter is available, the object does not have a label. When a label painter is available, the object shall be assigned to the label painter before using the label painter, seesetObject
in ILcdGXYLabelPainter.- Specified by:
getGXYLabelPainter
in interfaceILcdGXYLayer
- Parameters:
aObject
- the object to find a label painter for.- Returns:
null
.
-
getGXYEditor
Description copied from interface:ILcdGXYLayer
Returns the editor to use to modify the object via a view. If no editor is available, the object cannot be edited via interaction through a view. When an editor is available, the object shall be assigned to the editor before editing, usingsetObject
in ILcdGXYEditor.- Specified by:
getGXYEditor
in interfaceILcdGXYLayer
- Parameters:
aObject
- the object to find an editor for.- Returns:
null
.
-
applyOnInteract
public int applyOnInteract(ILcdFunction aFunction, Rectangle aBounds, boolean aStrictInteract, ILcdGXYView aGXYView) Performs no action.- Specified by:
applyOnInteract
in interfaceILcdGXYLayer
- Parameters:
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
- iftrue
, theILcdFunction
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.- Returns:
- 0.
-
getIcon
Gets the icon for this layer -
setIcon
Sets the icon for this layer. -
getGXYPen
Returns the pen used to perform basic rendering operations- Specified by:
getGXYPen
in interfaceILcdGXYLayer
- Returns:
- the pen used to perform basic rendering operations
-
setGXYPen
Sets the pen to use to perform basic rendering operations.- Parameters:
aGXYPen
- the pen to use to perform basic rendering.
-
hasUserPen
public boolean hasUserPen()Deprecated.do not use this method -
setGridPainter
Deprecated.Sets theTLcdLonLatGridPainter
that paints the longitude/latitude grid.- Parameters:
aGXYPainter
- aTLcdLonLatGridPainter
that is responsible for painting a Longitude-Latitude grid. It should acceptTLcdLonLatGrid
objects.
-
getGridPainter
Deprecated.UsegetGXYPainter()
.Returns theTLcdLonLatGridPainter
that paints the longitude/latitude grid. -
setGXYPainter
Sets theILcdGXYPainter
that paints the longitude/latitude grid. -
getGXYPainter
Returns theILcdGXYPainter
that paints the longitude/latitude grid. -
setAntiAliased
public final void setAntiAliased(boolean aAntiAliased) Enable or disable anti-aliasing. By default, anti-aliasing is enabled.When activated, anti-aliasing will be applied on both the labels and the lines.
See also
ILcdGXYView.isAntiAliased()
.- Parameters:
aAntiAliased
- true to enable anti-aliasing.- Since:
- 2016.1
- See Also:
-
isAntiAliased
public final boolean isAntiAliased()Returns if anti-aliasing is enabled.- Returns:
- if anti-aliasing is enabled.
- Since:
- 2016.1
- See Also:
-
setScaleRange
Sets the scale range in which thisILcdGXYLayer
will paint its elements. The paint method of anILcdGXYLayer
shall not perform any action when:
aGXYContext.getGXYView().getScale()
<getDisplayRange().getMin()
or
aGXYContext.getGXYView().getScale()
>=getDisplayRange().getMax()
-
getScaleRange
Description copied from interface:ILcdGXYLayer
Returns the toolkit scale range for which to display elements of the model. In other words, the paint method will not render any objects in a view when:
view.getScale()
<getScaleRange().getMin()
orview.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 theunitless map scale range
instead. This property is mutually exclusive with the map scale range: only one of them has a non-null
value.- Specified by:
getScaleRange
in interfaceILcdGXYLayer
- Returns:
- an
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 byILcdGXYLayer.getMapScaleRange()
. The scales are expressed in toolkit pixels/world unit. - See Also:
-
getLabelScaleRange
The label scale range is the same as the scale range for aTLcdMapLonLatGridLayer
.- Specified by:
getLabelScaleRange
in interfaceILcdGXYLayer
- Returns:
- an
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 byILcdGXYLayer.getLabelMapScaleRange()
The scales are expressed in toolkit pixels/world unit. - See Also:
-
getBounds
This method returns the view bounds of thisTLcdMapLonLatGridLayer
, taking into account the XYWorldReference of the givenILcdGXYView
aGXYView.- Specified by:
getBounds
in interfaceILcdGXYLayer
- Parameters:
aMode
- a bitwise combination of ALL or SELECTION and one or more of BODIES and HANDLES. TheILcdGXYLayer.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.- Returns:
- a bounds (in view coordinates, pixels) that encompasses the representation of all objects that are rendered in a view.
-
paint
Paints theTLcdLonLatGrid
, taking into account the given mode, and delegating to the configured grid painter. ForTLcdLonLatGridPainter
andTLcdLonLatBorderGridPainter
instances, thesetLabeled
flag will be set according to the given paint mode.- Specified by:
paint
in interfaceILcdGXYLayer
- Parameters:
aGraphics
-Graphics
to consider for painting.aMode
- a combination ofILcdGXYLayer.OBJECTS
,ILcdGXYLayer.LABELS
,ILcdGXYLayer.SELECTION_HANDLES
.aGXYView
- theILcdGXYView
that contains thisILcdLayer
.- See Also:
-
stopPainting
public void stopPainting()Description copied from interface:ILcdGXYLayer
Inform the layer that it should terminate the current paint operation. This method can be useful when the paint method is executed in a specificThread
and needs to be stopped in a safe state from another Thread.- Specified by:
stopPainting
in interfaceILcdGXYLayer
- See Also:
-
addPropertyChangeListener
Associate aPropertyChangeListener
to thisILcdLayer
- Specified by:
addPropertyChangeListener
in interfaceILcdPropertyChangeSource
- Parameters:
aPropertyChangeListener
- The listener to be notified- See Also:
-
removePropertyChangeListener
If thePropertyChangeListener
aPropertyChangeListener is associated to thisILcdLayer
, it will not be associated to thisILcdLayer
afterward.- Specified by:
removePropertyChangeListener
in interfaceILcdPropertyChangeSource
- Parameters:
aPropertyChangeListener
- the listener that should no longer be notified of changes of this object's properties- See Also:
-
firePropertyChangeEvent
-
getLonLatGrid
- Returns:
- lonLatGrid which represents the
TLcdLonLatGrid
object that is associated to thisTLcdMapLonLatGridLayer
.
-
setLonLatGrid
Sets lonLatGrid which represents theTLcdLonLatGrid
object that is associated to thisTLcdMapLonLatGridLayer
to aLonLatGrid. -
getModel
-
setVisible
public void setVisible(boolean aVisible) The property isVisible determines whether the grid is visible. Sets isVisible to aVisibleValue.- Specified by:
setVisible
in interfaceILcdLayer
- Parameters:
aVisible
-true
if the layer should be visible,false
otherwise.- See Also:
-
isVisible
public boolean isVisible()The property isVisible determines whether the grid is visible. -
isEditableSupported
public boolean isEditableSupported()Description copied from interface:ILcdLayer
Returnstrue
if the layer supports editing its objects.- Specified by:
isEditableSupported
in interfaceILcdLayer
- Returns:
false
- See Also:
-
isEditable
public boolean isEditable()Description copied from interface:ILcdLayer
Returns whether the layer allows editing the content that it visualizes.- Specified by:
isEditable
in interfaceILcdLayer
- Returns:
false
- See Also:
-
setEditable
public void setEditable(boolean aEditable) Does not perform any operation. The editableSupported property isfalse
- Specified by:
setEditable
in interfaceILcdLayer
- Parameters:
aEditable
- true if the layer content can be edited- See Also:
-
isSelectableSupported
public boolean isSelectableSupported()Description copied from interface:ILcdLayer
Returnstrue
if this layer supports selecting objects,false
otherwise.- Specified by:
isSelectableSupported
in interfaceILcdLayer
- Returns:
false
- See Also:
-
isSelectable
public boolean isSelectable()Description copied from interface:ILcdLayer
Returns whether the layer's objects can be selected, for example, by clicking on them.- Specified by:
isSelectable
in interfaceILcdLayer
- Returns:
- always
false
- See Also:
-
setSelectable
public void setSelectable(boolean aSelectable) Does not perform any operation. The selectableSupported property isfalse
- Specified by:
setSelectable
in interfaceILcdLayer
- Parameters:
aSelectable
-true
if the layer allows selection,false
otherwise.- See Also:
-
isLabeledSupported
public boolean isLabeledSupported()Description copied from interface:ILcdGXYLayer
Returns whether this layer supports representing objects as text. If not, no effort should be made trying to represent the objects with labels.- Specified by:
isLabeledSupported
in interfaceILcdGXYLayer
- Returns:
true
-
isLabeled
public boolean isLabeled()The property isLabeled determines whether to label the grid.- Specified by:
isLabeled
in interfaceILcdGXYLayer
- Returns:
true
if isLabeled istrue
, elsefalse
is returned.- See Also:
-
setLabeled
public void setLabeled(boolean aLabeled) The property isLabeled determines whether to label the grid. Sets the property isLabeled to aLabeled.- Specified by:
setLabeled
in interfaceILcdGXYLayer
- Parameters:
aLabeled
- true to have a textual representation of the objects in the model, false to have no such representation.
-
getLabel
Description copied from interface:ILcdLayer
A short textual representation of thisILcdLayer
. -
setLabel
Sets the label of thisILcdLayer
to aLabel. -
getSelectionCount
public int getSelectionCount()Description copied from interface:ILcdSelection
Returns the number of objects in this selection.- Specified by:
getSelectionCount
in interfaceILcdSelection<Object>
- Returns:
- 0.
-
selectedObjects
Description copied from interface:ILcdSelection
Returns the objects in this selection.- Specified by:
selectedObjects
in interfaceILcdSelection<Object>
- Returns:
TLcdEmptyEnumeration.getInstance
().
-
isSelected
Description copied from interface:ILcdSelection
Checks whether the givenObject
is currently in the set of selected objects.- Specified by:
isSelected
in interfaceILcdSelection<Object>
- Parameters:
aObject
- theObject
to be checked.- Returns:
false
.
-
selectObject
Performs no operations.- Specified by:
selectObject
in interfaceILcdLayer
- Parameters:
aObject
- theObject
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 amongILcdFireEventMode.FIRE_NOW
,ILcdFireEventMode.FIRE_LATER
,ILcdFireEventMode.NO_EVENT
- See Also:
-
fireCollectedSelectionChanges
public void fireCollectedSelectionChanges()Performs no operations.- Specified by:
fireCollectedSelectionChanges
in interfaceILcdLayer
-
clearSelection
public void clearSelection(int aDispatchEventMode) Performs no operations.- Specified by:
clearSelection
in interfaceILcdLayer
- Parameters:
aDispatchEventMode
- shall be one amongILcdFireEventMode.FIRE_NOW
,ILcdFireEventMode.FIRE_LATER
,ILcdFireEventMode.NO_EVENT
- See Also:
-
addSelectionListener
Performs no operations.- Specified by:
addSelectionListener
in interfaceILcdSelection<Object>
- Parameters:
aSelectionListener
- theILcdSelectionListener
to be added.
-
removeSelectionListener
Performs no operations.- Specified by:
removeSelectionListener
in interfaceILcdSelection<Object>
- Parameters:
aSelectionListener
- theILcdSelectionListener
to be removed.
-
getModelXYWorldTransfoClass
Description copied from interface:ILcdGXYLayer
Returns the transformation class that to use to transform points and bounds from model space to world space and back. This class has to be conform with the reference of the model of this layer and the reference of the view this layer is part of.- Specified by:
getModelXYWorldTransfoClass
in interfaceILcdGXYLayer
- Returns:
TLcdModelXYWorldTransformation.class
.
-
getGXYPainter()
.