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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPropertyChangeListener(PropertyChangeListener aPropertyChangeListener) Associate aPropertyChangeListenerto thisILcdLayervoidaddSelectionListener(ILcdSelectionListener aSelectionListener) Performs no operations.intapplyOnInteract(ILcdFunction aFunction, Rectangle aBounds, boolean aStrictInteract, ILcdGXYView aGXYView) Performs no action.voidclearSelection(int aDispatchEventMode) Performs no operations.voidPerforms no operations.voidfirePropertyChangeEvent(PropertyChangeEvent aPropertyChangeEvent) getBounds(int aMode, ILcdGXYView aGXYView) This method returns the view bounds of thisTLcdMapLonLatGridLayer, taking into account the XYWorldReference of the givenILcdGXYViewaGXYView.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 theILcdGXYPainterthat 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.intReturns the number of objects in this selection.booleanDeprecated.do not use this methodfinal booleanReturns if anti-aliasing is enabled.booleanReturns whether the layer allows editing the content that it visualizes.booleanReturnstrueif the layer supports editing its objects.booleanThe property isLabeled determines whether to label the grid.booleanReturns whether this layer supports representing objects as text.booleanReturns whether the layer's objects can be selected, for example, by clicking on them.booleanReturnstrueif this layer supports selecting objects,falseotherwise.booleanisSelected(Object aObject) Checks whether the givenObjectis currently in the set of selected objects.booleanDeprecated.This method has been deprecated.booleanThe property isVisible determines whether the grid is visible.voidpaint(Graphics aGraphics, int aMode, ILcdGXYView aGXYView) Paints theTLcdLonLatGrid, taking into account the given mode, and delegating to the configured grid painter.voidremovePropertyChangeListener(PropertyChangeListener aPropertyChangeListener) If thePropertyChangeListeneraPropertyChangeListener is associated to thisILcdLayer, it will not be associated to thisILcdLayerafterward.voidremoveSelectionListener(ILcdSelectionListener aSelectionListener) Performs no operations.Returns the objects in this selection.voidselectObject(Object aObject, boolean aSelection, int aDispatchEventMode) Performs no operations.final voidsetAntiAliased(boolean aAntiAliased) Enable or disable anti-aliasing.static voidsetClassTraceOn(boolean aClassTraceOn) Deprecated.This method has been deprecated.voidsetEditable(boolean aEditable) Does not perform any operation.voidsetGridPainter(TLcdLonLatGridPainter aGXYPainter) Deprecated.voidsetGXYPainter(ILcdGXYPainter aGXYPainter) Sets theILcdGXYPainterthat paints the longitude/latitude grid.voidsetGXYPen(ILcdGXYPen aGXYPen) Sets the pen to use to perform basic rendering operations.voidSets the icon for this layer.voidSets the label of thisILcdLayerto aLabel.voidsetLabeled(boolean aLabeled) The property isLabeled determines whether to label the grid.voidsetLonLatGrid(TLcdLonLatGrid aLonLatGrid) Sets lonLatGrid which represents theTLcdLonLatGridobject that is associated to thisTLcdMapLonLatGridLayerto aLonLatGrid.voidsetScaleRange(ILcdInterval aScaleRange) Sets the scale range in which thisILcdGXYLayerwill paint its elements.voidsetSelectable(boolean aSelectable) Does not perform any operation.voidsetTraceOn(boolean aTraceOn) Deprecated.This method has been deprecated.voidsetVisible(boolean aVisible) The property isVisible determines whether the grid is visible.voidInform 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, waitMethods inherited from interface com.luciad.view.gxy.ILcdGXYLayer
getLabelMapScaleRange, getMapScaleRangeMethods 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 istruethen 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 eithertrueorfalseas argument automatically turns off tracing for all other class instances for whichsetTraceOnhas not been called. If the argument isfalsethen 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.Returnstrueif tracing is enabled for this class.- Returns:
- true if tracing is enabled for this class, false otherwise.
-
getGXYPainter
Description copied from interface:ILcdGXYLayerReturns 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, seesetObjectin ILcdGXYPainter.- Specified by:
getGXYPainterin interfaceILcdGXYLayer- Parameters:
aObject- the object to find a painter for.- Returns:
null.
-
getGXYLabelPainter
Description copied from interface:ILcdGXYLayerReturns 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, seesetObjectin ILcdGXYLabelPainter.- Specified by:
getGXYLabelPainterin interfaceILcdGXYLayer- Parameters:
aObject- the object to find a label painter for.- Returns:
null.
-
getGXYEditor
Description copied from interface:ILcdGXYLayerReturns 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, usingsetObjectin ILcdGXYEditor.- Specified by:
getGXYEditorin 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:
applyOnInteractin 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, theILcdFunctionshall 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:
getGXYPenin 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 theTLcdLonLatGridPainterthat paints the longitude/latitude grid.- Parameters:
aGXYPainter- aTLcdLonLatGridPainterthat is responsible for painting a Longitude-Latitude grid. It should acceptTLcdLonLatGridobjects.
-
getGridPainter
Deprecated.UsegetGXYPainter().Returns theTLcdLonLatGridPainterthat paints the longitude/latitude grid. -
setGXYPainter
Sets theILcdGXYPainterthat paints the longitude/latitude grid. -
getGXYPainter
Returns theILcdGXYPainterthat 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 thisILcdGXYLayerwill paint its elements. The paint method of anILcdGXYLayershall not perform any action when:
aGXYContext.getGXYView().getScale()<getDisplayRange().getMin()
or
aGXYContext.getGXYView().getScale()>=getDisplayRange().getMax() -
getScaleRange
Description copied from interface:ILcdGXYLayerReturns 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 rangeinstead. This property is mutually exclusive with the map scale range: only one of them has a non-nullvalue.- Specified by:
getScaleRangein interfaceILcdGXYLayer- Returns:
- an
ILcdIntervalcontaining the minimum and maximum value of view scales for which objects should be rendered, excluding the maximum.nullif 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:
getLabelScaleRangein interfaceILcdGXYLayer- Returns:
- an
ILcdIntervalcontaining the minimum and maximum value of view scales for which labels should be rendered, excluding the maximum.nullif 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 givenILcdGXYViewaGXYView.- Specified by:
getBoundsin interfaceILcdGXYLayer- Parameters:
aMode- a bitwise combination of ALL or SELECTION and one or more of BODIES and HANDLES. TheILcdGXYLayer.LABELSmode 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. ForTLcdLonLatGridPainterandTLcdLonLatBorderGridPainterinstances, thesetLabeledflag will be set according to the given paint mode.- Specified by:
paintin interfaceILcdGXYLayer- Parameters:
aGraphics-Graphicsto consider for painting.aMode- a combination ofILcdGXYLayer.OBJECTS,ILcdGXYLayer.LABELS,ILcdGXYLayer.SELECTION_HANDLES.aGXYView- theILcdGXYViewthat contains thisILcdLayer.- See Also:
-
stopPainting
public void stopPainting()Description copied from interface:ILcdGXYLayerInform the layer that it should terminate the current paint operation. This method can be useful when the paint method is executed in a specificThreadand needs to be stopped in a safe state from another Thread.- Specified by:
stopPaintingin interfaceILcdGXYLayer- See Also:
-
addPropertyChangeListener
Associate aPropertyChangeListenerto thisILcdLayer- Specified by:
addPropertyChangeListenerin interfaceILcdPropertyChangeSource- Parameters:
aPropertyChangeListener- The listener to be notified- See Also:
-
removePropertyChangeListener
If thePropertyChangeListeneraPropertyChangeListener is associated to thisILcdLayer, it will not be associated to thisILcdLayerafterward.- Specified by:
removePropertyChangeListenerin 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
TLcdLonLatGridobject that is associated to thisTLcdMapLonLatGridLayer.
-
setLonLatGrid
Sets lonLatGrid which represents theTLcdLonLatGridobject that is associated to thisTLcdMapLonLatGridLayerto aLonLatGrid. -
getModel
-
setVisible
public void setVisible(boolean aVisible) The property isVisible determines whether the grid is visible. Sets isVisible to aVisibleValue.- Specified by:
setVisiblein interfaceILcdLayer- Parameters:
aVisible-trueif the layer should be visible,falseotherwise.- See Also:
-
isVisible
public boolean isVisible()The property isVisible determines whether the grid is visible. -
isEditableSupported
public boolean isEditableSupported()Description copied from interface:ILcdLayerReturnstrueif the layer supports editing its objects.- Specified by:
isEditableSupportedin interfaceILcdLayer- Returns:
false- See Also:
-
isEditable
public boolean isEditable()Description copied from interface:ILcdLayerReturns whether the layer allows editing the content that it visualizes.- Specified by:
isEditablein interfaceILcdLayer- Returns:
false- See Also:
-
setEditable
public void setEditable(boolean aEditable) Does not perform any operation. The editableSupported property isfalse- Specified by:
setEditablein interfaceILcdLayer- Parameters:
aEditable- true if the layer content can be edited- See Also:
-
isSelectableSupported
public boolean isSelectableSupported()Description copied from interface:ILcdLayerReturnstrueif this layer supports selecting objects,falseotherwise.- Specified by:
isSelectableSupportedin interfaceILcdLayer- Returns:
false- See Also:
-
isSelectable
public boolean isSelectable()Description copied from interface:ILcdLayerReturns whether the layer's objects can be selected, for example, by clicking on them.- Specified by:
isSelectablein interfaceILcdLayer- Returns:
- always
false - See Also:
-
setSelectable
public void setSelectable(boolean aSelectable) Does not perform any operation. The selectableSupported property isfalse- Specified by:
setSelectablein interfaceILcdLayer- Parameters:
aSelectable-trueif the layer allows selection,falseotherwise.- See Also:
-
isLabeledSupported
public boolean isLabeledSupported()Description copied from interface:ILcdGXYLayerReturns whether this layer supports representing objects as text. If not, no effort should be made trying to represent the objects with labels.- Specified by:
isLabeledSupportedin interfaceILcdGXYLayer- Returns:
true
-
isLabeled
public boolean isLabeled()The property isLabeled determines whether to label the grid.- Specified by:
isLabeledin interfaceILcdGXYLayer- Returns:
trueif isLabeled istrue, elsefalseis 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:
setLabeledin 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:ILcdLayerA short textual representation of thisILcdLayer. -
setLabel
Sets the label of thisILcdLayerto aLabel. -
getSelectionCount
public int getSelectionCount()Description copied from interface:ILcdSelectionReturns the number of objects in this selection.- Specified by:
getSelectionCountin interfaceILcdSelection<Object>- Returns:
- 0.
-
selectedObjects
Description copied from interface:ILcdSelectionReturns the objects in this selection.- Specified by:
selectedObjectsin interfaceILcdSelection<Object>- Returns:
TLcdEmptyEnumeration.getInstance().
-
isSelected
Description copied from interface:ILcdSelectionChecks whether the givenObjectis currently in the set of selected objects.- Specified by:
isSelectedin interfaceILcdSelection<Object>- Parameters:
aObject- theObjectto be checked.- Returns:
false.
-
selectObject
Performs no operations.- Specified by:
selectObjectin interfaceILcdLayer- Parameters:
aObject- theObjectto 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,trueto select,falseto 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:
fireCollectedSelectionChangesin interfaceILcdLayer
-
clearSelection
public void clearSelection(int aDispatchEventMode) Performs no operations.- Specified by:
clearSelectionin interfaceILcdLayer- Parameters:
aDispatchEventMode- shall be one amongILcdFireEventMode.FIRE_NOW,ILcdFireEventMode.FIRE_LATER,ILcdFireEventMode.NO_EVENT- See Also:
-
addSelectionListener
Performs no operations.- Specified by:
addSelectionListenerin interfaceILcdSelection<Object>- Parameters:
aSelectionListener- theILcdSelectionListenerto be added.
-
removeSelectionListener
Performs no operations.- Specified by:
removeSelectionListenerin interfaceILcdSelection<Object>- Parameters:
aSelectionListener- theILcdSelectionListenerto be removed.
-
getModelXYWorldTransfoClass
Description copied from interface:ILcdGXYLayerReturns 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:
getModelXYWorldTransfoClassin interfaceILcdGXYLayer- Returns:
TLcdModelXYWorldTransformation.class.
-
getGXYPainter().