Class TLcdMapJPanelLightWeight

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

public class TLcdMapJPanelLightWeight extends TLcdGXYViewJPanelLightWeight
TLcdGXYViewJPanelLightWeight 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

    • TLcdMapJPanelLightWeight

      public TLcdMapJPanelLightWeight()
      Constructs a new TLcdGXYViewJPanelLightWeight-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.
    • TLcdMapJPanelLightWeight

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

    • 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 TLcdGXYViewJPanelLightWeight
      Parameters:
      aXYWorldReference - the new ILcdXYWorldReference associated to this view
      See Also: