Class TLcdUPSGridLayer

java.lang.Object
com.luciad.view.map.TLcdUPSGridLayer
All Implemented Interfaces:
ILcdPropertyChangeSource, ILcdSelection<Object>, ILcdGXYLayer, ILcdNotLabelDeconflictableLayer, ILcdLayer, Serializable

public class TLcdUPSGridLayer extends Object implements ILcdGXYLayer, ILcdNotLabelDeconflictableLayer
TLcdUPSGridLayer is an ILcdGXYLayer that can be added in an ILcdGXYView to display a Universal Polar Stereographic MGRS grid. This grid consists of two polar zones.

It is recommended to use TLcdMGRSGridLayer instead: it combines a UPS and UTM grid with better performance and more fine-grained customization options.

See Also:
  • Constructor Details

    • TLcdUPSGridLayer

      public TLcdUPSGridLayer()
    • TLcdUPSGridLayer

      public TLcdUPSGridLayer(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.
    • paint

      public void paint(Graphics aGraphics, int aMode, ILcdGXYView aGXYView)
      Description copied from interface: ILcdGXYLayer
      Paints the combined representation of the layer's objects for a view, taking into account the mode.

      The mode indicates what objects of the model should be taken into account and what representation should be provided. The objects to be taken into account shall be one of:

      • ALL: all the objects in the layer's model, or
      • SELECTION: all the objects in the layer's selection.

      Note that the combined representation may contain less than the representation of all objects that were taken into account, as some objects may be disregarded for various reasons (filters, scale, ... ). When the views scale is outside the scale range (BODIES or HANDLES mode) or the label scale range (LABELS mode) nothing shall be painted.

      The representations provided shall be one or more of:

      • BODIES: the combination of geometric representations of the objects,
      • HANDLES: the handles for the objects. These are the parts of the objects representation on which user interaction can be applied. For example, for a circle this can be the center point, allowing to move the circle.
      • LABELS: the combination of the textual representations of the objects.

      The mode supplied shall be a bitwise or combination of a constant of the first group and one or more of the second group. When painting in BODIES or HANDLES mode, painting of an object shall be delegated to the painter for that object, when the LABELS mode is passed, painting shall be delegated to the labelpainter for that object.

      The view is passed to provide contextual information: some of the objects may have a different representation depending on the view, or depending on a property of the view, for example, the scale of the view.

      The combined representation of the objects has to be painted on the Graphics supplied, as these may be different from the Graphics provided by the view (due to double buffering, for example).

      When stopPainting is called, the current painting operation should be aborted.

      Specified by:
      paint in interface ILcdGXYLayer
      Parameters:
      aGraphics - the Graphics to paint on.
      aMode - indicates what should be painted and how it should be painted.
      aGXYView - the view to paint for.
      See Also:
    • getGridZoneColor

      public Color getGridZoneColor()
      Returns the outline color of the grid zones
      Returns:
      the outline color of the grid zones
    • setGridZoneColor

      public void setGridZoneColor(Color aColor)
      Sets the outline color of the grid zones
      Parameters:
      aColor - the outline color of the grid zones
    • getColor

      public Color getColor()
      Returns the outline color of the 100.000m squares
      Returns:
      the outline color of the 100.000m squares
    • setColor

      public void setColor(Color aColor)
      Sets the outline color of the 100.000m squares.
      Parameters:
      aColor - the outline color of the 100.000m squares
    • getColorScales

      public Color getColorScales()
      Returns the Color to paint the scales within the 100.000m squares.
    • setColorScales

      public void setColorScales(Color aColorScales)
      Sets the Color to be used by this painter to paint the scales within the 100.000m squares.
    • getLabelColor

      public Color getLabelColor()
      Returns the Color for the labels.
    • setLabelColor

      public void setLabelColor(Color aLabelColor)
      Sets the Color for the labels.
    • isLabelHaloEnabled

      public boolean isLabelHaloEnabled()
      Returns whether the painter will add a halo effect around the grid labels.
      Returns:
      whether the painter will add a halo effect around the grid labels.
      See Also:
    • setLabelHaloEnabled

      public void setLabelHaloEnabled(boolean aHaloEnabled)
      Determines whether the painter will add a halo effect around the grid labels. By default, this property is set to false.
      Parameters:
      aHaloEnabled - a flag indicating whether to add a halo effect around the grid labels.
      See Also:
    • getLabelHaloThickness

      public int getLabelHaloThickness()
      Returns the thickness of the halo effect for the grid labels.
      Returns:
      the thickness of the halo effect for the grid labels.
      See Also:
    • setLabelHaloThickness

      public void setLabelHaloThickness(int aHaloThickness)
      Sets the thickness defined in pixels of the halo effect for the grid labels. By default, this property is set to 1.
      Parameters:
      aHaloThickness - the thickness defined in pixels of the halo effect for the grid labels.
      See Also:
    • getLabelHaloColor

      public Color getLabelHaloColor()
      Returns the color of the halo effect.
      Returns:
      the color of the halo effect.
      See Also:
    • setLabelHaloColor

      public void setLabelHaloColor(Color aHaloColor)
      Sets the color of the halo effect for the grid labels. By default, this property is set to Color.white.
      Parameters:
      aHaloColor - the color of the halo effect for the grid labels.
      See Also:
    • getLabelFont

      public Font getLabelFont()
      Gets the Font for the labels.
    • setLabelFont

      public void setLabelFont(Font aLabelFont)
      Sets the Font for the labels.
    • applyOnInteract

      public int applyOnInteract(ILcdFunction aFunction, Rectangle aBounds, boolean aStrictInteract, ILcdGXYView aGXYView)
      Description copied from interface: ILcdGXYLayer
      Applies the function to (at the least) all objects that are contained (partially or completely) in the bounds of the view.

      The function shall be applied successively to all objects in the bounds as long as the function returns true for an object. This allows developers to indicate a stop condition. Note that the order in which the objects are passed to the function is not specified.

      When strict interaction is required, only objects whose representation lies within the given bounds, completely or partially, are candidates to be passed to the function. An object whose representation does not interact with the bounds should not be passed to the function. Applying non strict interaction can be useful to avoid heavy computations to determine whether an objects representation lies within the bounds.

      This method behaves similar to the paint method, and as such is allowed to omit small or invisible objects for performance reasons.

      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:
      the number of objects the function was applied on.
    • getBounds

      public ILcdBounds getBounds(int aMode, ILcdGXYView aGXYView) throws TLcdNoBoundsException
      Always throws a TLcdNoBoundsException.
      Specified by:
      getBounds in interface ILcdGXYLayer
      Parameters:
      aMode - the mode to calculate the bounds in.
      aGXYView - the view to calculate the bounds in.
      Returns:
      never returns.
      Throws:
      TLcdNoBoundsException - is always thrown
    • 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:
    • getScaleRange

      public ILcdInterval getScaleRange()
      Always returns null.
      Specified by:
      getScaleRange in interface ILcdGXYLayer
      Returns:
      null
      See Also:
    • getLabelScaleRange

      public ILcdInterval getLabelScaleRange()
      Always returns null.
      Specified by:
      getLabelScaleRange in interface ILcdGXYLayer
      Returns:
      null
      See Also:
    • getGXYPainter

      public ILcdGXYPainter getGXYPainter(Object aObject)
      Always returns null.
      Specified by:
      getGXYPainter in interface ILcdGXYLayer
      Parameters:
      aObject - the object to retrieve a painter for.
      Returns:
      null
    • getGXYEditor

      public ILcdGXYEditor getGXYEditor(Object aObject)
      Always returns null.
      Specified by:
      getGXYEditor in interface ILcdGXYLayer
      Parameters:
      aObject - the object to retrieve an editor for.
      Returns:
      null
    • getGXYLabelPainter

      public ILcdGXYLabelPainter getGXYLabelPainter(Object aObject)
      Always returns null.
      Specified by:
      getGXYLabelPainter in interface ILcdGXYLayer
      Parameters:
      aObject - not taken into account.
      Returns:
      null
    • getGXYPen

      public ILcdGXYPen getGXYPen()
      Description copied from interface: ILcdGXYLayer
      Returns the pen to use when performing basic painting operations for objects in this layers model.
      Specified by:
      getGXYPen in interface ILcdGXYLayer
      Returns:
      the pen to use when performing basic painting operations for objects in this layers model.
    • getIcon

      public ILcdIcon getIcon()
      Returns null. No icon is defined for this layer.
      Specified by:
      getIcon in interface ILcdLayer
      Returns:
      null
    • getModelXYWorldTransfoClass

      public Class getModelXYWorldTransfoClass()
      Returns TLcdGrid2Grid class.
      Specified by:
      getModelXYWorldTransfoClass in interface ILcdGXYLayer
      Returns:
      TLcdGrid2Grid.class
    • 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:
      whether this layer supports representing objects as text.
    • isLabeled

      public boolean isLabeled()
      Description copied from interface: ILcdGXYLayer
      Returns whether objects should be represented as text. Note that this property shall not be taken into account when ILcdGXYLayer.isLabeledSupported() returns false.
      Specified by:
      isLabeled in interface ILcdGXYLayer
      Returns:
      whether objects should be represented as text.
      See Also:
    • setLabeled

      public void setLabeled(boolean aLabeled)
      Description copied from interface: ILcdGXYLayer
      Sets whether objects should be represented as text. The value set for this property shall have no effect as long as ILcdGXYLayer.isLabeledSupported() returns false.
      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.
    • setIcon

      public void setIcon(ILcdIcon aIcon)
      Empty implementation. Setting the icon has no effect.
      Specified by:
      setIcon in interface ILcdLayer
      Parameters:
      aIcon - useless.
      See Also:
    • getModel

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

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

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

      public boolean isVisible()
      Description copied from interface: ILcdLayer
      Returns whether or not the layer's content is painted.
      Specified by:
      isVisible in interface ILcdLayer
      Returns:
      true if the layer is visible, false otherwise.
      See Also:
    • setVisible

      public void setVisible(boolean aVisible)
      Description copied from interface: ILcdLayer
      Sets whether or not the layer's content is painted.
      Specified by:
      setVisible in interface ILcdLayer
      Parameters:
      aVisible - true if the layer should be visible, false otherwise.
      See Also:
    • isSelectableSupported

      public boolean isSelectableSupported()
      This layer does not support selection. Always returns false.
      Specified by:
      isSelectableSupported in interface ILcdLayer
      Returns:
      false
      See Also:
    • isSelectable

      public boolean isSelectable()
      This layer does not support selection. Always returns false.
      Specified by:
      isSelectable in interface ILcdLayer
      Returns:
      false
      See Also:
    • setSelectable

      public void setSelectable(boolean aSelectable)
      This layer does not support selection. Empty implementation.
      Specified by:
      setSelectable in interface ILcdLayer
      Parameters:
      aSelectable - has no influence.
      See Also:
    • isEditableSupported

      public boolean isEditableSupported()
      This layer does not support editing. Always returns false.
      Specified by:
      isEditableSupported in interface ILcdLayer
      Returns:
      false
      See Also:
    • isEditable

      public boolean isEditable()
      This layer does not support editing. Always returns false.
      Specified by:
      isEditable in interface ILcdLayer
      Returns:
      false
      See Also:
    • setEditable

      public void setEditable(boolean aEditable)
      This layer does not support editing. Empty implementation.
      Specified by:
      setEditable in interface ILcdLayer
      Parameters:
      aEditable - of no influence.
      See Also:
    • selectObject

      public void selectObject(Object aObject, boolean aSelection, int aDispatchEventMode)
      This layer does not support selection. Empty implementation.
      Specified by:
      selectObject in interface ILcdLayer
      Parameters:
      aObject - the object to (de)select.
      aSelection - the new selection state of the object in the layer.
      aDispatchEventMode - whether notification of the selection should be immediate, later or never.
      See Also:
    • fireCollectedSelectionChanges

      public void fireCollectedSelectionChanges()
      This layer does not support selection. Empty implementation.
      Specified by:
      fireCollectedSelectionChanges in interface ILcdLayer
    • clearSelection

      public void clearSelection(int aDispatchEventMode)
      This layer does not support selection. Empty implementation.
      Specified by:
      clearSelection in interface ILcdLayer
      Parameters:
      aDispatchEventMode - shall be one among ILcdFireEventMode.FIRE_NOW, ILcdFireEventMode.FIRE_LATER, ILcdFireEventMode.NO_EVENT
      See Also:
    • addPropertyChangeListener

      public void addPropertyChangeListener(PropertyChangeListener aPropertyChangeListener)
      Associate a PropertyChangeListener to this ILcdLayer.
      Specified by:
      addPropertyChangeListener in interface ILcdPropertyChangeSource
      Parameters:
      aPropertyChangeListener - a listener to be notified of changes of properties of this layer.
      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 after-wards.
      Specified by:
      removePropertyChangeListener in interface ILcdPropertyChangeSource
      Parameters:
      aPropertyChangeListener - a listener no longer to be notified of changes of properties of this layer.
      See Also:
    • getSelectionCount

      public int getSelectionCount()
      This layer does not support selection. Always returns 0.
      Specified by:
      getSelectionCount in interface ILcdSelection<Object>
      Returns:
      0
    • selectedObjects

      public Enumeration selectedObjects()
      This layer does not support selection. Always returns null.
      Specified by:
      selectedObjects in interface ILcdSelection<Object>
      Returns:
      null
    • isSelected

      public boolean isSelected(Object aObject)
      This layer does not support selection. Always returns false.
      Specified by:
      isSelected in interface ILcdSelection<Object>
      Parameters:
      aObject - the object to check the selection state of.
      Returns:
      false
    • addSelectionListener

      public void addSelectionListener(ILcdSelectionListener aSelectionListener)
      This layer does not support selection. Empty implementation.
      Specified by:
      addSelectionListener in interface ILcdSelection<Object>
      Parameters:
      aSelectionListener - not of influence.
    • removeSelectionListener

      public void removeSelectionListener(ILcdSelectionListener aSelectionListener)
      This layer does not support selection. Empty implementation.
      Specified by:
      removeSelectionListener in interface ILcdSelection<Object>
      Parameters:
      aSelectionListener - not of influence.