Class TLcdMapPanel

All Implemented Interfaces:
ILcdAWTEventSource, ILcdModelProducerListener, ILcdPropertyChangeSource, ILcdStatusSource, ILcdGXYView, ILcdGXYViewXYWorldTransformationProvider, ILcdLayered, ILcdTreeLayered, ILcdView, ImageObserver, MenuContainer, Serializable, EventListener, Accessible

public class TLcdMapPanel extends TLcdGXYViewPanel
TLcdGXYViewPanel extension suited for displaying maps. It adds the following extra behavior:
  • a grid layer (a longitude/latitude grid by default) that can be enabled or disabled and/or replaced.
  • a WGS 84 based grid reference with an equidistant cylindrical projection and a default scale that fits the entire world
  • a redefined setXYWorldReference method that keeps the map centered on the same model point. This behavior is enabled by default but can be deactivated if needed.
  • a controller to pan and zoom
  • sensible default minimum and maximum scale values so you can't zoom in or out too far
See Also:
  • Constructor Details

    • TLcdMapPanel

      public TLcdMapPanel()
      Constructs a new TLcdGXYViewPanel-based ILcdGXYView with a longitude/latitude grid and a TLcdGridReference that has an instance of TLcdEquidistantCylindrical as ILcdProjection. The scale is set to make the earth fit in this ILcdGXYView.
    • TLcdMapPanel

      public TLcdMapPanel(boolean aRegisterInstance)
      Deprecated.
      Use the default constructor.
      Constructs a new TLcdGXYViewPanel-based ILcdGXYView.
      Parameters:
      aRegisterInstance - if true, registers the view with TLcdBeanManager
      See Also:
    • TLcdMapPanel

      public TLcdMapPanel(ILcdTreeLayeredSupport aTreeLayeredSupport)
      Constructs a new TLcdGXYViewPanel-based ILcdGXYView with a longitude/latitude grid and a TLcdGridReference that has an instance of TLcdEquidistantCylindrical as ILcdProjection. The scale is set to make the earth fit in this ILcdGXYView.
      Parameters:
      aTreeLayeredSupport - an instance of ILcdTreeLayeredSupport used to store the layers
  • Method Details

    • 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.
      Overrides:
      setTraceOn in class TLcdGXYViewPanel
      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.
      Overrides:
      isTraceOn in class TLcdGXYViewPanel
      Returns:
      true if tracing is enabled for this class, false otherwise.
    • asILcdGXYView

      public ILcdGXYView asILcdGXYView()
    • getGridLayer

      public ILcdGXYLayer getGridLayer()
      Returns the grid layer that was configured using setGridLayer(com.luciad.view.gxy.ILcdGXYLayer), if any.
      Returns:
      the grid layer of this map, or null if no grid layer was configured
    • setGridLayer

      public void setGridLayer(ILcdGXYLayer aGridLayer)
      Configures the given layer as the grid layer of this map. The previously configured grid layer (if any) is removed and the layer is added to the top of the view, or to the position of the previously configured grid layer.
      Parameters:
      aGridLayer - the new layer to configure as grid layer
    • isWithGridLayer

      public boolean isWithGridLayer()
      Returns whether or not the map includes a configured grid layer.
      Returns:
      true if the map has a configured and enabled grid layer, false otherwise.
      See Also:
    • setWithGridLayer

      public void setWithGridLayer(boolean aWithGridLayer)
      Enables or disables the configured grid layer. If true, a grid layer is created (if needed) and added to the view. If false, the configured grid layer (if any) is removed from the view.
      Parameters:
      aWithGridLayer - true if the map has a configured grid layer, false otherwise.
      See Also:
    • setAutoAdjustOnSetXYWorldReference

      public void setAutoAdjustOnSetXYWorldReference(boolean aBoolean)
      Parameters:
      aBoolean - if true the setXYWorldReference method will be redefined in order to keep this ILcdGXYView still centered on the same model point, when setting a new ILcdProjection. If false the setXYWorldReference will call super.setXYWorldReference.
    • isAutoAdjustOnSetXYWorldReference

      public boolean isAutoAdjustOnSetXYWorldReference()
      See Also:
    • setXYWorldReference

      public void setXYWorldReference(ILcdXYWorldReference aXYWorldReference)
      Sets the property of XYWorldReference to aXYWorldReference. If isAutoAdjustOnSetXYWorldReference returns true, it tries to adapt the properties viewOrigin and worldOrigin to the new ILcdXYWorldReference such that the view is still centered on the same model point.
      Specified by:
      setXYWorldReference in interface ILcdGXYView
      Overrides:
      setXYWorldReference in class TLcdGXYViewPanel
      Parameters:
      aXYWorldReference - the new ILcdXYWorldReference associated to this view
      See Also: