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:
  • Constructor Details

    • TLcdMapLonLatGridLayer

      public TLcdMapLonLatGridLayer()
    • TLcdMapLonLatGridLayer

      public TLcdMapLonLatGridLayer(String aLabel)
  • 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 is true 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 either 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.
      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.
      Returns true if tracing is enabled for this class.
      Returns:
      true if tracing is enabled for this class, false otherwise.
    • getGXYPainter

      public ILcdGXYPainter getGXYPainter(Object aObject)
      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, see setObject in ILcdGXYPainter.
      Specified by:
      getGXYPainter in interface ILcdGXYLayer
      Parameters:
      aObject - the object to find a painter for.
      Returns:
      null.
    • getGXYLabelPainter

      public ILcdGXYLabelPainter getGXYLabelPainter(Object aObject)
      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, see setObject in ILcdGXYLabelPainter.
      Specified by:
      getGXYLabelPainter in interface ILcdGXYLayer
      Parameters:
      aObject - the object to find a label painter for.
      Returns:
      null.
    • getGXYEditor

      public ILcdGXYEditor getGXYEditor(Object aObject)
      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, using setObject in ILcdGXYEditor.
      Specified by:
      getGXYEditor in interface ILcdGXYLayer
      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 interface ILcdGXYLayer
      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 - 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.
      Returns:
      0.
    • getIcon

      public ILcdIcon getIcon()
      Gets the icon for this layer
      Specified by:
      getIcon in interface ILcdLayer
      Returns:
      a visual indication of the contents of this layer.
    • setIcon

      public void setIcon(ILcdIcon aIcon)
      Sets the icon for this layer.
      Specified by:
      setIcon in interface ILcdLayer
      Parameters:
      aIcon - a visual indication of the contents of this layer.
      See Also:
    • getGXYPen

      public ILcdGXYPen getGXYPen()
      Returns the pen used to perform basic rendering operations
      Specified by:
      getGXYPen in interface ILcdGXYLayer
      Returns:
      the pen used to perform basic rendering operations
    • setGXYPen

      public void setGXYPen(ILcdGXYPen aGXYPen)
      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

      public void setGridPainter(TLcdLonLatGridPainter aGXYPainter)
      Sets the TLcdLonLatGridPainter that paints the longitude/latitude grid.
      Parameters:
      aGXYPainter - a TLcdLonLatGridPainter that is responsible for painting a Longitude-Latitude grid. It should accept TLcdLonLatGrid objects.
    • getGridPainter

      public TLcdLonLatGridPainter getGridPainter()
      Deprecated.
      Returns the TLcdLonLatGridPainter that paints the longitude/latitude grid.
    • setGXYPainter

      public void setGXYPainter(ILcdGXYPainter aGXYPainter)
      Sets the ILcdGXYPainter that paints the longitude/latitude grid.
    • getGXYPainter

      public ILcdGXYPainter getGXYPainter()
      Returns the ILcdGXYPainter 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

      public void setScaleRange(ILcdInterval aScaleRange)
      Sets the scale range in which this ILcdGXYLayer will paint its elements. The paint method of an ILcdGXYLayer shall not perform any action when:
      aGXYContext.getGXYView().getScale() < getDisplayRange().getMin()
      or
      aGXYContext.getGXYView().getScale() >= getDisplayRange().getMax()
    • getScaleRange

      public ILcdInterval 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() 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.

      Specified by:
      getScaleRange in interface ILcdGXYLayer
      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 by ILcdGXYLayer.getMapScaleRange(). The scales are expressed in toolkit pixels/world unit.
      See Also:
    • getLabelScaleRange

      public ILcdInterval getLabelScaleRange()
      The label scale range is the same as the scale range for a TLcdMapLonLatGridLayer.
      Specified by:
      getLabelScaleRange in interface ILcdGXYLayer
      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 by ILcdGXYLayer.getLabelMapScaleRange() The scales are expressed in toolkit pixels/world unit.
      See Also:
    • getBounds

      public 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.
      Specified by:
      getBounds in interface ILcdGXYLayer
      Parameters:
      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.
      Returns:
      a bounds (in view coordinates, pixels) that encompasses the representation of all objects that are rendered in a view.
    • paint

      public void paint(Graphics aGraphics, int aMode, ILcdGXYView aGXYView)
      Paints the 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.
      Specified by:
      paint in interface ILcdGXYLayer
      Parameters:
      aGraphics - Graphics to consider for painting.
      aMode - a combination of ILcdGXYLayer.OBJECTS, ILcdGXYLayer.LABELS, ILcdGXYLayer.SELECTION_HANDLES.
      aGXYView - the ILcdGXYView that contains this ILcdLayer.
      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 specific Thread and needs to be stopped in a safe state from another Thread.
      Specified by:
      stopPainting in interface ILcdGXYLayer
      See Also:
    • addPropertyChangeListener

      public void addPropertyChangeListener(PropertyChangeListener aPropertyChangeListener)
      Associate a PropertyChangeListener to this ILcdLayer
      Specified by:
      addPropertyChangeListener in interface ILcdPropertyChangeSource
      Parameters:
      aPropertyChangeListener - The listener to be notified
      See Also:
    • removePropertyChangeListener

      public void removePropertyChangeListener(PropertyChangeListener aPropertyChangeListener)
      If the PropertyChangeListener aPropertyChangeListener is associated to this ILcdLayer, it will not be associated to this ILcdLayer afterward.
      Specified by:
      removePropertyChangeListener in interface ILcdPropertyChangeSource
      Parameters:
      aPropertyChangeListener - the listener that should no longer be notified of changes of this object's properties
      See Also:
    • firePropertyChangeEvent

      public void firePropertyChangeEvent(PropertyChangeEvent aPropertyChangeEvent)
    • getLonLatGrid

      public TLcdLonLatGrid getLonLatGrid()
      Returns:
      lonLatGrid which represents the TLcdLonLatGrid object that is associated to this TLcdMapLonLatGridLayer.
    • setLonLatGrid

      public void setLonLatGrid(TLcdLonLatGrid aLonLatGrid)
      Sets lonLatGrid which represents the TLcdLonLatGrid object that is associated to this TLcdMapLonLatGridLayer to aLonLatGrid.
    • getModel

      public ILcdModel getModel()
      Specified by:
      getModel in interface ILcdLayer
      Returns:
      the model associated to this ILcdLayer.
    • setVisible

      public void setVisible(boolean aVisible)
      The property isVisible determines whether the grid is visible. Sets isVisible to aVisibleValue.
      Specified by:
      setVisible in interface ILcdLayer
      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.
      Specified by:
      isVisible in interface ILcdLayer
      Returns:
      true if isVisible is true, else false is returned.
      See Also:
    • isEditableSupported

      public boolean isEditableSupported()
      Description copied from interface: ILcdLayer
      Returns true if the layer supports editing its objects.
      Specified by:
      isEditableSupported in interface ILcdLayer
      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 interface ILcdLayer
      Returns:
      false
      See Also:
    • setEditable

      public void setEditable(boolean aEditable)
      Does not perform any operation. The editableSupported property is false
      Specified by:
      setEditable in interface ILcdLayer
      Parameters:
      aEditable - true if the layer content can be edited
      See Also:
    • isSelectableSupported

      public boolean isSelectableSupported()
      Description copied from interface: ILcdLayer
      Returns true if this layer supports selecting objects, false otherwise.
      Specified by:
      isSelectableSupported in interface ILcdLayer
      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 interface ILcdLayer
      Returns:
      always false
      See Also:
    • setSelectable

      public void setSelectable(boolean aSelectable)
      Does not perform any operation. The selectableSupported property is false
      Specified by:
      setSelectable in interface ILcdLayer
      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 interface ILcdGXYLayer
      Returns:
      true
    • isLabeled

      public boolean isLabeled()
      The property isLabeled determines whether to label the grid.
      Specified by:
      isLabeled in interface ILcdGXYLayer
      Returns:
      true if isLabeled is true, else false 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 interface ILcdGXYLayer
      Parameters:
      aLabeled - true to have a textual representation of the objects in the model, false to have no such representation.
    • getLabel

      public String getLabel()
      Description copied from interface: ILcdLayer
      A short textual representation of this ILcdLayer.
      Specified by:
      getLabel in interface ILcdLayer
      Returns:
      the label of this ILcdLayer.
    • setLabel

      public void setLabel(String aLabel)
      Sets the label of this ILcdLayer to aLabel.
      Specified by:
      setLabel in interface ILcdLayer
      Parameters:
      aLabel - the the textual representation to use for this ILcdLayer.
    • getSelectionCount

      public int getSelectionCount()
      Description copied from interface: ILcdSelection
      Returns the number of objects in this selection.
      Specified by:
      getSelectionCount in interface ILcdSelection<Object>
      Returns:
      0.
    • selectedObjects

      public Enumeration selectedObjects()
      Description copied from interface: ILcdSelection
      Returns the objects in this selection.
      Specified by:
      selectedObjects in interface ILcdSelection<Object>
      Returns:
      TLcdEmptyEnumeration.getInstance().
    • isSelected

      public boolean isSelected(Object aObject)
      Description copied from interface: ILcdSelection
      Checks whether the given Object is currently in the set of selected objects.
      Specified by:
      isSelected in interface ILcdSelection<Object>
      Parameters:
      aObject - the Object to be checked.
      Returns:
      false.
    • selectObject

      public void selectObject(Object aObject, boolean aSelection, int aDispatchEventMode)
      Performs no operations.
      Specified by:
      selectObject in interface ILcdLayer
      Parameters:
      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
      See Also:
    • fireCollectedSelectionChanges

      public void fireCollectedSelectionChanges()
      Performs no operations.
      Specified by:
      fireCollectedSelectionChanges in interface ILcdLayer
    • clearSelection

      public void clearSelection(int aDispatchEventMode)
      Performs no operations.
      Specified by:
      clearSelection in interface ILcdLayer
      Parameters:
      aDispatchEventMode - shall be one among ILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER, ILcdFireEventMode.NO_EVENT
      See Also:
    • addSelectionListener

      public void addSelectionListener(ILcdSelectionListener aSelectionListener)
      Performs no operations.
      Specified by:
      addSelectionListener in interface ILcdSelection<Object>
      Parameters:
      aSelectionListener - the ILcdSelectionListener to be added.
    • removeSelectionListener

      public void removeSelectionListener(ILcdSelectionListener aSelectionListener)
      Performs no operations.
      Specified by:
      removeSelectionListener in interface ILcdSelection<Object>
      Parameters:
      aSelectionListener - the ILcdSelectionListener to be removed.
    • getModelXYWorldTransfoClass

      public Class 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 interface ILcdGXYLayer
      Returns:
      TLcdModelXYWorldTransformation.class.