Class TLcdGXYViewBufferedImage

java.lang.Object
com.luciad.view.gxy.TLcdGXYViewBufferedImage
All Implemented Interfaces:
ILcdModelProducerListener, ILcdPropertyChangeSource, ILcdRotationCapable, ILcdStatusSource, ILcdGXYView, ILcdGXYViewXYWorldTransformationProvider, ILcdRotationCapableGXYView, ILcdLayered, ILcdTreeLayered, ILcdView, Serializable, EventListener
Direct Known Subclasses:
TLcdMapBufferedImage

ILcdGXYView implementation based on an off-screen image.
It does not depend on AWT or Swing components, and can be used on the server side (for example, in a Servlet) for generating images to be sent to light-weight clients.

For a ready-to-use implementation to display maps, see TLcdMapBufferedImage.

Because the view does not depend on AWT, it cannot offer any user interaction. However, if you have a source of AWT input events, you can add controller support to this view by overriding the controller setter and getter and making sure the controller receives the input events:


   public void setGXYController(ILcdGXYController aController) {
     removeInputListeners(fController);
     fController = aController;
     addInputListeners(fController);
   }

   private void addInputListeners(ILcdGXYController aController) {
     if (aController instanceof MouseListener) {
       getMyInputSource().addMouseListener(aController);
     }
     if (aController instanceof ILcdAWTEventListener) {
       //...
     }
     // Also register ComponentListener, KeyListener, MouseMotionListener, MouseWheelListener
     // ...
   }
  

In addition to the ILcdGXYView functionality, TLcdGXYViewBufferedImage supports rotation, non-uniform scales along the x-axis and y-axis and can use an ILcdGXYLayerFactory to automatically create ILcdGXYLayer objects from models. It also offers the ability to subscribe to view invalidation events.

All code that might affect or depend on the state of the view should be executed in a single thread. This includes all methods that can cause the view to repaint implicitly or explicitly.

See Also:
  • Constructor Details

    • TLcdGXYViewBufferedImage

      public TLcdGXYViewBufferedImage()
      Constructs a new, empty BufferedImage based ILcdGXYView. The internal image is of type BufferedImage.TYPE_INT_RGB. Auto-update is activated by default, no background layers are cached, and no default user interaction is provided. The scale along the x-axis and y-axis are both set to 1.0.

      After construction, a world coordinate system needs to be set using setXYWorldReference(com.luciad.view.ILcdXYWorldReference).

      See Also:
    • TLcdGXYViewBufferedImage

      public TLcdGXYViewBufferedImage(int aBufferedImageType)
      Constructs a new, empty BufferedImage based ILcdGXYView of the given image type. Auto-update is activated by default, no background layers are cached, and no default user interaction is provided. The scale along the x-axis and y-axis are both set to 1.0.

      After construction, a world coordinate system needs to be set using setXYWorldReference(com.luciad.view.ILcdXYWorldReference).

      Parameters:
      aBufferedImageType - the type of the BufferedImage.
      See Also:
    • TLcdGXYViewBufferedImage

      public TLcdGXYViewBufferedImage(int aBufferedImageType, IndexColorModel aIndexColorModel)
      Constructs a new, empty BufferedImage based ILcdGXYView of the given image type, with a given IndexColorModel. All colors that are used when painting on this view are approximated by colors from the given color model. Auto-update is activated by default, no background layers are cached, and no default user interaction is provided.

      After construction, a world coordinate system needs to be set using setXYWorldReference(com.luciad.view.ILcdXYWorldReference).

      Parameters:
      aBufferedImageType - the type of the BufferedImage.
      aIndexColorModel - the index color model.
      See Also:
    • TLcdGXYViewBufferedImage

      public TLcdGXYViewBufferedImage(int aBufferedImageType, ILcdTreeLayeredSupport aTreeLayeredSupport)
      Constructs a new, empty BufferedImage based ILcdGXYView of the given image type, based on the ILcdTreeLayered aTreeLayered. Auto-update is activated by default, no background layers are cached, and no default user interaction is provided. The scale along the x-axis and y-axis are both set to 1.0.

      After construction, a world coordinate system needs to be set using setXYWorldReference(com.luciad.view.ILcdXYWorldReference)

      Parameters:
      aBufferedImageType - the type of the BufferedImage
      aTreeLayeredSupport - an instance of ILcdTreeLayeredSupport used to store the layers
    • TLcdGXYViewBufferedImage

      public TLcdGXYViewBufferedImage(int aBufferedImageType, IndexColorModel aIndexColorModel, ILcdTreeLayeredSupport aTreeLayeredSupport)
      Constructs a new, empty BufferedImage based ILcdGXYView of the given image type, with a given IndexColorModel, based on the ILcdTreeLayered aTreeLayered. All colors that are used when painting on this view are approximated by colors from the given color model. Auto-update is activated by default, no background layers are cached, and no default user interaction is provided.

      After construction, a world coordinate system needs to be set using setXYWorldReference(com.luciad.view.ILcdXYWorldReference).

      Parameters:
      aBufferedImageType - the type of the BufferedImage
      aIndexColorModel - the index color model
      aTreeLayeredSupport - an instance of ILcdTreeLayeredSupport used to store the layers
  • 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.
    • isCopyrightNoticeEnabled

      public boolean isCopyrightNoticeEnabled()
      Returns whether a copyright notice will be added to the images.
      Returns:
      true if a copyright notice will be added to the images; false otherwise.
      See Also:
    • setCopyrightNoticeEnabled

      public void setCopyrightNoticeEnabled(boolean aEnabled)
      Sets whether a copyright notice should be added to the images.
      Parameters:
      aEnabled - whether a copyright notice should be added to the images.
      See Also:
    • pan

      public void pan(int aDeltaX, int aDeltaY, boolean aRepaint)
      Description copied from interface: ILcdGXYView
      Changes the view and/or world origin of the view so that the view contents are panned by the specified AWT delta. Implementations of this method are allowed to only repaint newly exposed areas, hence this method is preferred over simply changing the world origin.
      Specified by:
      pan in interface ILcdGXYView
      Parameters:
      aDeltaX - the shift in the X direction in screen coordinates
      aDeltaY - the shift in the Y direction in screen coordinates
      aRepaint - if true, will trigger a repaint of the view's contents. Depending on the implementation, only the newly exposed areas may be painted. If false, the view is not repainted.
    • paint

      public void paint(Graphics aGraphics)
      Calls paintGXYView( aGraphics )
      Parameters:
      aGraphics - the graphics to paint the view on
      See Also:
    • paintGXYView

      public void paintGXYView(Graphics aGraphics)
      Description copied from interface: ILcdGXYView
      Paints the view on the given Graphics. The painted image contains the following:
      • a background color;
      • the bodies of each contained layer's models. Each layer is asked to paint itself, from bottom to top;
      • the labels of each contained layer's models. Typically labels are painted on top of any bodies. The labels are painted by the layer itself, or by a view label painter, if it is set;
      • the selected bodies of each contained layer's models. Typically selections are painted on top of bodies and labels.
      • the selected labels of each contained layer's models. The labels are painted by the layer itself, or by a view label painter, if it is set;
      • corner icons, if any;
      • the controller handling user interaction.
      The view is allowed to reuse earlier painted results as long as they are valid. Invalidation of the contents may occur indirectly (e.g. by changing view or layer properties) or directly by calling one of the invalidate methods.
      Specified by:
      paintGXYView in interface ILcdGXYView
      Parameters:
      aGraphics - the Graphics to paint the contents of this view on
      See Also:
    • update

      public void update(Graphics aGraphics)
      Calls paintGXYView( aGraphics )
      Parameters:
      aGraphics - the graphics to paint the view on
      See Also:
    • print

      public void print(Graphics aGraphics)
      Paints the representation of the ILcdGXYView on the given Graphics, without using any buffers or off-screen images.
      Parameters:
      aGraphics - the Graphics to paint the contents of this view on
      See Also:
    • asGXYView

      public ILcdGXYView asGXYView()
      Deprecated.
      Cast the object to ILcdGXYView instead.
      Returns the view as a pure ILcdGXYView.
      Returns:
      this view
    • setDisplayName

      public void setDisplayName(String aDisplayName)
      Sets the name of the view for display purposes. The display name can be used to make the user differentiate different views.
      Parameters:
      aDisplayName - the new name of the view
      See Also:
    • getDisplayName

      public String getDisplayName()
      Returns the name of the view for display purposes. The display name can be used to make the user differentiate different views.
      Returns:
      the name of the view
      See Also:
    • isDoubleBuffered

      public boolean isDoubleBuffered()
      Deprecated.
      This property is not relevant.
      Returns:
      true
    • addModel

      public void addModel(ILcdModel aModel)
      Adds aModel to be displayed in this ILcdView.

      This method creates an ILcdGXYLayer containing the model and adds it to the view. For this to work, a layer factory supporting the given model must be set on the view.

      Specified by:
      addModel in interface ILcdView
      Throws:
      IllegalArgumentException - if the model is null, if no layer factory is set, or if the layer factory cannot create a layer for the given model
      See Also:
    • removeModel

      public void removeModel(ILcdModel aModel)
      Removes the ILcdGXYLayer containing the model from the view. Removes a single representation of the specified model from this view, if it is present in the view.
      Specified by:
      removeModel in interface ILcdView
      See Also:
    • addLayeredListener

      public void addLayeredListener(ILcdLayeredListener aLayeredListener)
      Registers the given ILcdLayeredListener to be notified when layers are added, removed or moved in the flat list.
      Specified by:
      addLayeredListener in interface ILcdLayered
      Specified by:
      addLayeredListener in interface ILcdTreeLayered
      Parameters:
      aLayeredListener - the listener that from now on will be notified of all changes to the flat list.
      See Also:
    • removeLayeredListener

      public void removeLayeredListener(ILcdLayeredListener aLayeredListener)
      Unregisters the given ILcdLayeredListener from receiving layered events for the flat list.
      Specified by:
      removeLayeredListener in interface ILcdLayered
      Specified by:
      removeLayeredListener in interface ILcdTreeLayered
      Parameters:
      aLayeredListener - the listener that will no longer be notified of changes in the flat list.
      See Also:
    • layerCount

      public int layerCount()
      Description copied from interface: ILcdTreeLayered

      Returns the number of layers in the flat list representation of the hierarchical layer structure. This does not include the root node.

      Specified by:
      layerCount in interface ILcdLayered
      Specified by:
      layerCount in interface ILcdTreeLayered
      Returns:
      the number of layers in the flat list. Does not include the root node.
    • layers

      public Enumeration layers()
      Description copied from interface: ILcdTreeLayered

      Returns an Enumeration of all the ILcdLayers currently in the flat list representation of the hierarchical layer structure, starting from the bottom layer to the top layer. This does not include the root node.

      Specified by:
      layers in interface ILcdLayered
      Specified by:
      layers in interface ILcdTreeLayered
      Returns:
      an Enumeration of all the ILcdLayers currently in the flat list, starting from the bottom layer to the top layer. Does not include the root node.
    • layersBackwards

      public Enumeration layersBackwards()
      Description copied from interface: ILcdTreeLayered

      Returns an Enumeration of all the ILcdLayers currently in the flat list representation of the hierarchical layer structure, starting from the top layer to the bottom layer. This does not include the root node.

      Specified by:
      layersBackwards in interface ILcdLayered
      Specified by:
      layersBackwards in interface ILcdTreeLayered
      Returns:
      an Enumeration of all the ILcdLayers currently in the flat list, starting from the top layer to the bottom layer. Does not include the root node.
    • getLayer

      public ILcdLayer getLayer(int aIndex) throws ArrayIndexOutOfBoundsException
      Description copied from interface: ILcdTreeLayered

      Returns the ILcdLayer with index aIndex in the flat list representation of the hierarchical layer structure.

      Specified by:
      getLayer in interface ILcdLayered
      Specified by:
      getLayer in interface ILcdTreeLayered
      Parameters:
      aIndex - the position of the layer to retrieve in the flat list representation.
      Returns:
      the ILcdLayer with index aIndex in the flat list representation
      Throws:
      ArrayIndexOutOfBoundsException - if the given index is invalid
    • layerOf

      public ILcdLayer layerOf(ILcdModel aModel) throws NoSuchElementException
      Returns the ILcdLayer of the flat list that contains the given ILcdModel. If more than one layer contain the model, the bottommost is returned.
      Specified by:
      layerOf in interface ILcdLayered
      Specified by:
      layerOf in interface ILcdTreeLayered
      Parameters:
      aModel - the model to check for in the flat list
      Returns:
      the ILcdLayer of the flat list that contains the given ILcdModel.
      Throws:
      NoSuchElementException - if there is no layer containing the given model
    • indexOf

      public int indexOf(ILcdLayer aLayer) throws NoSuchElementException
      Description copied from interface: ILcdTreeLayered

      Returns the index of the given layer aLayer in the flat list representation of the hierarchical structure.

      Specified by:
      indexOf in interface ILcdLayered
      Specified by:
      indexOf in interface ILcdTreeLayered
      Parameters:
      aLayer - the layer whose index to return
      Returns:
      the index of aLayer in the flat list representation
      Throws:
      NoSuchElementException - if aLayer is not in the flat list
    • moveLayerAt

      public void moveLayerAt(int aIndex, ILcdLayer aLayer) throws NoSuchElementException, ArrayIndexOutOfBoundsException
      Description copied from interface: ILcdLayered
      Moves the given layer (which is already in ILcdLayered) to the existing index aIndex. When a layer is moved down, all layers in between the previous and future position of the given layer (including the layer at index aIndex) are moved one position up. When a layer is moved up, all layers in between the previous and future position of the given layer (including the layer at index aIndex) are moved one position down.

      More formally, let previousIndex be the index of aLayer before the move. If previousIndex < aIndex, then the index of all ILcdLayer objects in from previousIndex + 1 to aIndex is decremented with 1. If previousIndex > aIndex, then the index of all ILcdLayer objects in from aIndex to previousIndex -1 is incremented with 1.

      Specified by:
      moveLayerAt in interface ILcdLayered
      Parameters:
      aIndex - the index of the position where to move the layer.
      aLayer - the layer to move.
      Throws:
      NoSuchElementException - if aLayer is not in this ILcdLayered.
      ArrayIndexOutOfBoundsException - if aIndex is not an index of one of the layers of this ILcdLayered.
    • removeLayer

      public void removeLayer(ILcdLayer aLayer)
      Description copied from interface: ILcdTreeLayered

      Removes a layer from both the hierarchical layer structure and the flat list representation. When removing an ILcdLayerTreeNode all of its children will also be removed. An event will then be generated for every layer that has been removed (one for the node and one for each of its child layers).

      It is not possible to remove the root node

      Specified by:
      removeLayer in interface ILcdLayered
      Specified by:
      removeLayer in interface ILcdTreeLayered
      Parameters:
      aLayer - the layer to remove. If the layer is not in the flat list, this method has no effect.
    • removeAllLayers

      public void removeAllLayers()
      Description copied from interface: ILcdTreeLayered

      Remove all the layers from the hierarchical layer structure and the flat list representation. An event will be fired for every layer that has been removed. This will not remove the root node.

      Specified by:
      removeAllLayers in interface ILcdLayered
      Specified by:
      removeAllLayers in interface ILcdTreeLayered
    • containsLayer

      public boolean containsLayer(ILcdLayer aLayer)
      Description copied from interface: ILcdTreeLayered

      Returns whether the flat list representation of the hierarchical layer structure contains the given layer. More formally, returns true if and only if the flat list representation contains at least one layer l such that (aLayer==null ? l==null : aLayer.equals(l)).

      Calling this method with the root node will return false, since the root node is not a part of the flat list representation.

      Specified by:
      containsLayer in interface ILcdLayered
      Specified by:
      containsLayer in interface ILcdTreeLayered
      Parameters:
      aLayer - the layer to check whether it is in the flat list representation
      Returns:
      true when the flat list representation contains the given layer, false otherwise
    • putCornerIcon

      public void putCornerIcon(ILcdIcon aCornerIcon, int aPosition)
      Sets an ILcdIcon to be painted at the given corner of this view. Only the last set icon for the given position is painted.
      Specified by:
      putCornerIcon in interface ILcdGXYView
      Parameters:
      aCornerIcon - the ILcdIcon to be painted at the given corner or null to unregister the icon
      aPosition - one of ILcdGXYView.UPPERLEFT, ILcdGXYView.UPPERRIGHT, ILcdGXYView.LOWERRIGHT, ILcdGXYView.LOWERLEFT
      See Also:
    • getCornerIcon

      public ILcdIcon getCornerIcon(int aPosition)
      Returns the ILcdIcon to be painted at the given corner of the view.
      Parameters:
      aPosition - one of ILcdGXYView.UPPERLEFT, ILcdGXYView.UPPERRIGHT, ILcdGXYView.LOWERRIGHT, ILcdGXYView.LOWERLEFT
      Returns:
      the ILcdIcon to be painted at the given corner or null when no icon has to be painted at the given corner
      See Also:
    • addGXYLayer

      public boolean addGXYLayer(ILcdGXYLayer aLayer)
      Description copied from interface: ILcdGXYView
      Adds the given ILcdGXYLayer to this ILcdGXYView. The layer is normally added to the top of the view's layers, but that is implementation specific. The view will be repainted depending on the result of isAutoUpdate. No action is performed if the given layer is already contained in the list.
      Specified by:
      addGXYLayer in interface ILcdGXYView
      Parameters:
      aLayer - the layer to add to this view
      Returns:
      true if the layer was added successfully, false if the view already contained the layer
      See Also:
    • addGXYLayer

      public boolean addGXYLayer(ILcdGXYLayer aLayer, boolean aRepaint)
      Description copied from interface: ILcdGXYView
      Adds the given ILcdGXYLayer to this ILcdGXYView, forcing a repaint if desired. The layer is normally added to the top of the view's layers, but that is implementation specific. No action is performed if the given layer is already contained in the list.
      Specified by:
      addGXYLayer in interface ILcdGXYView
      Parameters:
      aLayer - the layer to add to this view
      aRepaint - if true, the view is repainted. If false, the view is not repainted.
      Returns:
      true if the layer was added successfully, false if the view already contained the layer
      See Also:
    • getNumberOfCachedBackgroundLayers

      public int getNumberOfCachedBackgroundLayers()
      Description copied from interface: ILcdGXYView
      Returns the number of layers whose combined representation is cached across repaints. The layers are always the bottommost layer objects; they are regarded as background layers.
      Specified by:
      getNumberOfCachedBackgroundLayers in interface ILcdGXYView
      Returns:
      the number of bottommost layers to cache
      See Also:
    • setNumberOfCachedBackgroundLayers

      public void setNumberOfCachedBackgroundLayers(int aNumberOfCachedBackgroundLayers)
      This operation is not supported, as this view does not cache background layers.
      Specified by:
      setNumberOfCachedBackgroundLayers in interface ILcdGXYView
      Parameters:
      aNumberOfCachedBackgroundLayers - should be zero
      Throws:
      IllegalArgumentException - when aNumberOfCachedBackgroundLayers != 0
      See Also:
    • hasValidImage

      public boolean hasValidImage()
      Deprecated.
      getImage() always returns a valid image.
      Returns true if the view has a valid image.
      Specified by:
      hasValidImage in interface ILcdGXYView
      Returns:
      true
      See Also:
    • getImage

      public Image getImage()
      Description copied from interface: ILcdGXYView
      Returns an Image of this view. The image has not been painted on by the controller. This method is guaranteed to return an up-to-date image: if the view has been invalidated in some way (e.g. when a layer has been removed) then this method first updates the view before returning an image. To improve performance and conserve memory, the view is allowed to cache, reuse and overwrite the image in subsequent repaints. NOTE: While using High DPI mode, this method will return an image which is bigger than the view dimensions reported by getWidth() and getHeight() methods.
      Specified by:
      getImage in interface ILcdGXYView
      Returns:
      an image containing the representation of this view
    • setWidth

      public void setWidth(int aWidth)
      Sets the view's current width.
      Parameters:
      aWidth - the new width
      See Also:
    • getWidth

      public int getWidth()
      Returns the view's current width in AWT pixels.
      Specified by:
      getWidth in interface ILcdGXYView
      Returns:
      the view's current width in AWT pixels
      See Also:
    • setHeight

      public void setHeight(int aHeight)
      Sets the view's current height.
      Parameters:
      aHeight - the new height
      See Also:
    • getHeight

      public int getHeight()
      Returns the view's current height in AWT pixels.
      Specified by:
      getHeight in interface ILcdGXYView
      Returns:
      the view's current height in AWT pixels
      See Also:
    • getPreferredSize

      public Dimension getPreferredSize()
      Deprecated.
      Manipulate the view's size using setHeight(int) and setWidth(int) instead.
      Returns the preferred size of the view. This interface does not specify a functionality for this property.
      Specified by:
      getPreferredSize in interface ILcdGXYView
      Returns:
      the preferred size of the view in AWT pixels
      See Also:
    • setPreferredSize

      public void setPreferredSize(Dimension aDimension)
      Deprecated.
      Manipulate the view's size using setHeight(int) and setWidth(int) instead.
      Sets the preferred size of the view.
      Parameters:
      aDimension - the new preferred size
      See Also:
    • getMaximumSize

      public Dimension getMaximumSize()
      Deprecated.
      this property is not used
      Returns the maximum size of the view.
      Returns:
      returns the maximum size of the view
      See Also:
    • setMaximumSize

      public void setMaximumSize(Dimension aDimension)
      Deprecated.
      this property is not used
      Sets the maximum size of the view.
      Parameters:
      aDimension - the new maximum size
      See Also:
    • getMinimumSize

      public Dimension getMinimumSize()
      Deprecated.
      this property is not used
      Returns the minimum size of the view.
      Returns:
      returns the minimum size of the view
      See Also:
    • setMinimumSize

      public void setMinimumSize(Dimension aDimension)
      Deprecated.
      this property is not used
      Sets the minimum size of the view.
      Parameters:
      aDimension - the new minimum size
      See Also:
    • setCursor

      public void setCursor(Cursor aCursor)
      Sets the view cursor to the given cursor. Its image is displayed when the mouse is within the view boundaries.

      This method is not implemented: an image does not offer user-interaction.

      Specified by:
      setCursor in interface ILcdGXYView
      Parameters:
      aCursor - Cursor instance to use, or null to inherit the cursor of a containing entity, if any
      See Also:
    • setBackground

      public void setBackground(Color aColor)
      Sets the background color of the view. This is the color that appears when no objects are painted on top of it.

      The default color is the color returned by SystemColor.control. Note that the alpha channel of the Color is not taken into account.

      Specified by:
      setBackground in interface ILcdGXYView
      Parameters:
      aColor - the color which appears at a location where no data is painted.
      See Also:
    • getBackground

      public Color getBackground()
      Returns the background color of the view. This is the color that appears when no objects are painted on top of it.

      The default color is the color returned by SystemColor.control. Note that the alpha channel of the Color is not taken into account.

      Specified by:
      getBackground in interface ILcdGXYView
      Returns:
      the background color of the view
      See Also:
    • setScale

      public void setScale(double aScale)
      Description copied from interface: ILcdGXYView
      Sets the scale of this view, repainting the view according to isAutoUpdate. The scale corresponds to the number of pixels per world unit, as determined by the ILcdXYWorldReference. Hence, increasing the scale zooms in, and decreasing the scale zooms out.

      A view displaying geographical data usually employs a scale in pixels per meter. As an example, to fit the world on a view that is 1000 pixels wide, a scale of about 1000 pixels/40.000km, or 1.0/40.000 is needed.

      For most use cases, we recommended setting the unitless map scale instead.

      Specified by:
      setScale in interface ILcdGXYView
      Parameters:
      aScale - the new scale of the view. The view is scaled using the world origin as center. The scale is limited so that it does not exceed the interval defined by the minimum and maximum scales.
      See Also:
    • setScale

      public void setScale(double aScale, boolean aRepaint)
      Description copied from interface: ILcdGXYView
      Sets the scale of this view, optionally repainting the view. The scale corresponds to the number of pixels per world unit, as determined by the ILcdXYWorldReference. Hence, increasing the scale zooms in, and decreasing the scale zooms out.

      A view displaying geographical data usually employs a scale in pixels per meter. As an example, to fit the world on a view that is 1000 pixels wide, a scale of about 1000 pixels/40.000km, or 1.0/40.000 is needed.

      For most use cases, we recommended setting the unitless map scale instead.

      Specified by:
      setScale in interface ILcdGXYView
      Parameters:
      aScale - the new scale of the view. The view is scaled using the world origin as center. The scale is limited so that it does not exceed the interval defined by the minimum and maximum scales.
      aRepaint - if true, the view is repainted. If false, the view is not repainted.
      See Also:
    • setScale

      public void setScale(double aScale, boolean aRepaint, boolean aAdjusting)
      Description copied from interface: ILcdGXYView
      Sets the scale of this view, optionally indicating subsequent property changes. The scale corresponds to the number of pixels per world unit, as determined by the ILcdXYWorldReference. Hence, increasing the scale zooms in, and decreasing the scale zooms out.

      A view displaying geographical data usually employs a scale in pixels per meter. As an example, to fit the world on a view that is 1000 pixels wide, a scale of about 1000 pixels/40.000km, or 1.0/40.000 is needed.

      For most use cases, we recommended setting the unitless map scale instead.

      Specified by:
      setScale in interface ILcdGXYView
      Parameters:
      aScale - the new scale of the view. The view is scaled using the world origin as center. The scale is limited so that it does not exceed the interval defined by the minimum and maximum scales.
      aRepaint - if true, the view is repainted. If false, the view is not repainted.
      aAdjusting - if true, the caller indicates that he will trigger another property change right after this call. This is reflected in the associated property change event.
      See Also:
    • setScale

      public void setScale(double aScaleX, double aScaleY, boolean aRepaint, boolean aAdjusting)
      Description copied from interface: ILcdGXYView
      Sets the scale along the x-axis and y-axis of this view, repainting the view according to isAutoUpdate.

      The scale corresponds to the number of pixels per world unit, as determined by the ILcdXYWorldReference. For example, a view displaying geographical data could use a scale in pixels per meter.

      The default implementation in this interface sets both scales to the geometric mean of the requested scales. The concrete view implementations do respect the individual scales.

      Specified by:
      setScale in interface ILcdGXYView
      Parameters:
      aScaleX - the new scale along the x-axis of the view.
      aScaleY - the new scale along the y-axis of the view.
      aRepaint - if true, the view is repainted. If false, the view is not repainted.
      aAdjusting - if true, the caller indicates that he will trigger another property change right after this call. This is reflected in the associated property change event.
      See Also:
    • getScale

      public double getScale()
      Description copied from interface: ILcdGXYView
      Returns the scale for which to paint the view contents expressed in toolkit pixels per world unit. The world unit is determined by the view's world reference. Increasing the scale zooms in, and decreasing the scale zooms out.

      For most use cases, we recommended using the unitless map scale instead.

      Specified by:
      getScale in interface ILcdGXYView
      Returns:
      the scale of this view
      See Also:
    • getScaleX

      public double getScaleX()
      Returns the scale along the x-axis.

      The scale corresponds to the number of toolkit pixels per world unit, as determined by the ILcdXYWorldReference. For example, a view displaying geographical data could use a scale in pixels per meter.

      Returns:
      the scale along the x-axis of this view
      See Also:
    • getScaleY

      public double getScaleY()
      Returns the scale along the y-axis.

      The scale corresponds to the number of toolkit pixels per world unit, as determined by the ILcdXYWorldReference. For example, a view displaying geographical data could use a scale in pixels per meter.

      Returns:
      the scale along the y-axis of this view
      See Also:
    • setMinScale

      public void setMinScale(double aMinScale)
      Description copied from interface: ILcdGXYView
      Limits the maximum zoomed out scale of the view. Subsequent calls of ILcdGXYView.setScale(double) or ILcdGXYView.setMapScale(com.luciad.view.TLcdMapScale, com.luciad.view.TLcdMapScale.ScaleLocation) will ensure that the scale does not fall below the minimum scale.

      For most use cases, we recommended using the unitless map scale variant instead.

      Specified by:
      setMinScale in interface ILcdGXYView
      Parameters:
      aMinScale - the new minimum scale of this view
      See Also:
    • getMinScale

      public double getMinScale()
      Description copied from interface: ILcdGXYView
      Returns the maximum zoomed out scale of the view. Subsequent calls of ILcdGXYView.setScale(double) or ILcdGXYView.setMapScale(com.luciad.view.TLcdMapScale, com.luciad.view.TLcdMapScale.ScaleLocation) will ensure that the scale does not fall below the minimum scale.

      For most use cases, we recommended using the unitless map scale variant instead.

      Specified by:
      getMinScale in interface ILcdGXYView
      Returns:
      the minimum scale of the view
      See Also:
    • setMaxScale

      public void setMaxScale(double aMaxScale)
      Description copied from interface: ILcdGXYView
      Limits the maximum zoomed in scale of the view. Subsequent calls of ILcdGXYView.setScale(double) or ILcdGXYView.setMapScale(com.luciad.view.TLcdMapScale, com.luciad.view.TLcdMapScale.ScaleLocation) will ensure that the scale does not rise above the maximum scale.

      For most use cases, we recommended using the unitless map scale variant instead.

      Specified by:
      setMaxScale in interface ILcdGXYView
      Parameters:
      aMaxScale - the new maximum scale of this view
      See Also:
    • getMaxScale

      public double getMaxScale()
      Description copied from interface: ILcdGXYView
      Returns the maximum zoomed in scale of the view. Subsequent calls of ILcdGXYView.setScale(double) or ILcdGXYView.setMapScale(com.luciad.view.TLcdMapScale, com.luciad.view.TLcdMapScale.ScaleLocation) will ensure that the scale does not rise above the maximum scale.

      For most use cases, we recommended using the unitless map scale variant instead.

      Specified by:
      getMaxScale in interface ILcdGXYView
      Returns:
      the maximum scale of the view
      See Also:
    • setWorldOrigin

      public void setWorldOrigin(ILcdPoint aWorldOrigin)
      Description copied from interface: ILcdGXYView
      Sets the world origin of the view, repainting the view according to isAutoUpdate. The world origin is a point in world coordinates that maps onto the view origin.
      Specified by:
      setWorldOrigin in interface ILcdGXYView
      Parameters:
      aWorldOrigin - the new world origin of this view, expressed in world coordinates. Only the XY coordinates are considered.
      See Also:
    • setWorldOrigin

      public void setWorldOrigin(ILcdPoint aWorldOrigin, boolean aRepaint)
      Description copied from interface: ILcdGXYView
      Sets the world origin of the view, optionally repainting the view. The world origin is a point in world coordinates that maps onto the view origin.
      Specified by:
      setWorldOrigin in interface ILcdGXYView
      Parameters:
      aWorldOrigin - the new world origin of this view, expressed in world coordinates. Only the XY coordinates are considered.
      aRepaint - if true, the view is repainted. If false, the view is not repainted.
      See Also:
    • setWorldOrigin

      public void setWorldOrigin(ILcdPoint aWorldOrigin, boolean aRepaint, boolean aAdjusting)
      Description copied from interface: ILcdGXYView
      Sets the world origin of the view, optionally indicating subsequent property changes. The world origin is a point in world coordinates that maps onto the view origin.
      Specified by:
      setWorldOrigin in interface ILcdGXYView
      Parameters:
      aWorldOrigin - the new world origin of this view, expressed in world coordinates. Only the XY coordinates are considered.
      aRepaint - if true, the view is repainted. If false, the view is not repainted.
      aAdjusting - if true, the caller indicates that he will trigger another property change right after this call. This is reflected in the associated property change event.
      See Also:
    • getWorldOrigin

      public ILcdPoint getWorldOrigin()
      Description copied from interface: ILcdGXYView
      Returns the point in world coordinates that maps onto the view origin. Hence, the combination of world origin and view origin determines which part of the world is visible in the view. The points are considered to be 'on top of each other'
      Specified by:
      getWorldOrigin in interface ILcdGXYView
      Returns:
      the world origin of the view, expressed in world coordinates. Only the XY coordinates of the point are relevant.
      See Also:
    • setViewOrigin

      public void setViewOrigin(Point aViewOrigin)
      Description copied from interface: ILcdGXYView
      Sets the view origin of the view, repainting the view according to isAutoUpdate. The view origin is a point in AWT pixel coordinates that maps onto the world origin.
      Specified by:
      setViewOrigin in interface ILcdGXYView
      Parameters:
      aViewOrigin - the new view origin of this view, expressed in AWT pixel coordinates
      See Also:
    • setViewOrigin

      public void setViewOrigin(Point aViewOrigin, boolean aRepaint)
      Description copied from interface: ILcdGXYView
      Sets the view origin of the view, optionally repainting the view. The view origin is a point in AWT pixel coordinates that maps onto the world origin.
      Specified by:
      setViewOrigin in interface ILcdGXYView
      Parameters:
      aViewOrigin - the new view origin of this view, expressed in AWT pixel coordinates
      aRepaint - if true, the view is repainted. If false, the view is not repainted.
      See Also:
    • setViewOrigin

      public void setViewOrigin(Point aViewOrigin, boolean aRepaint, boolean aAdjusting)
      Description copied from interface: ILcdGXYView
      Sets the view origin of the view, optionally indicating subsequent property changes. The view origin is a point in AWT pixel coordinates that maps onto the world origin.
      Specified by:
      setViewOrigin in interface ILcdGXYView
      Parameters:
      aViewOrigin - the new view origin of this view, expressed in AWT pixel coordinates
      aRepaint - if true, the view is repainted. If false, the view is not repainted.
      aAdjusting - if true, the caller indicates that he will trigger another property change right after this call. This is reflected in the associated property change event.
      See Also:
    • getViewOrigin

      public Point getViewOrigin()
      Description copied from interface: ILcdGXYView
      Returns the point in AWT pixel coordinates that maps onto the world origin. Hence, the combination of world origin and view origin determines which part of the world is visible in the view. The points are considered to be 'on top of each other'.
      Specified by:
      getViewOrigin in interface ILcdGXYView
      Returns:
      the view origin expressed in AWT pixel coordinates
      See Also:
    • getRotation

      public double getRotation()
      Description copied from interface: ILcdRotationCapableGXYView
      Returns the rotation of this ILcdGXYView. The rotation is expressed in degrees and is positive counter-clockwise. The rotation is applied in the world reference system around the worldOrigin.
      Specified by:
      getRotation in interface ILcdRotationCapable
      Specified by:
      getRotation in interface ILcdRotationCapableGXYView
      Returns:
      the rotation of this ILcdGXYView. The rotation is expressed in degrees and is positive counter-clockwise.
      See Also:
    • setRotation

      public void setRotation(double aRotation, boolean aRepaint, boolean aAdjusting)
      Sets the rotation of this ILcdGXYView, optionally repainting the view. The rotation is expressed in degrees and is positive counter-clockwise. The rotation is applied in the world reference system around the worldOrigin.
      Parameters:
      aRotation - the new rotation value expressed in degrees (positive counter-clockwise)
      aRepaint - if true, the view is repainted
      aAdjusting - if true, the caller indicates that he will trigger another property change right after this call. This is reflected in the associated property change event.
      See Also:
    • setRotation

      public void setRotation(double aRotation)
      Description copied from interface: ILcdRotationCapableGXYView
      Sets the rotation of this ILcdGXYView, updating the view according to ILcdView.isAutoUpdate(). The rotation is expressed in degrees and is positive counter-clockwise. The rotation is applied in the world reference system around the worldOrigin.
      Specified by:
      setRotation in interface ILcdRotationCapable
      Specified by:
      setRotation in interface ILcdRotationCapableGXYView
      Parameters:
      aRotation - the new rotation value expressed in degrees (positive counter-clockwise).
      See Also:
    • setRotation

      public void setRotation(double aRotation, boolean aAdjusting)
      Description copied from interface: ILcdRotationCapableGXYView
      Sets the rotation of this ILcdGXYView, optionally indicating subsequent property changes. The rotation is expressed in degrees and is positive counter-clockwise. The rotation is applied in the world reference system around the worldOrigin.
      Specified by:
      setRotation in interface ILcdRotationCapable
      Specified by:
      setRotation in interface ILcdRotationCapableGXYView
      Parameters:
      aRotation - the new rotation value expressed in degrees (positive counter-clockwise)
      aAdjusting - if true, the caller indicates that he will trigger another property change right after this call. This is reflected in the associated property change event.
      See Also:
    • getGXYViewXYWorldTransformation

      public ILcdGXYViewXYWorldTransformation getGXYViewXYWorldTransformation()
      Description copied from interface: ILcdGXYViewXYWorldTransformationProvider
      Returns a valid ILcdGXYViewXYWorldTransformation for an ILcdGXYView. Users of the transformation should update their reference when the view's world origin, view origin, rotation, or scale changes.
      Specified by:
      getGXYViewXYWorldTransformation in interface ILcdGXYViewXYWorldTransformationProvider
      Returns:
      a valid ILcdGXYViewXYWorldTransformation
    • setXYWorldReference

      public void setXYWorldReference(ILcdXYWorldReference aXYWorldReference)
      Description copied from interface: ILcdGXYView
      Sets the view's 2D world coordinate system, repainting the view according to isAutoUpdate.
      Specified by:
      setXYWorldReference in interface ILcdGXYView
      Parameters:
      aXYWorldReference - the new ILcdXYWorldReference associated to this view
      See Also:
    • setXYWorldReference

      public void setXYWorldReference(ILcdXYWorldReference aXYWorldReference, boolean aRepaint)
      Description copied from interface: ILcdGXYView
      Sets the view's 2D world coordinate system, optionally repainting the view.
      Specified by:
      setXYWorldReference in interface ILcdGXYView
      Parameters:
      aXYWorldReference - the new ILcdXYWorldReference associated to this view
      aRepaint - if true, the view is repainted. If false, the view is not repainted.
      See Also:
    • setXYWorldReference

      public void setXYWorldReference(ILcdXYWorldReference aXYWorldReference, boolean aRepaint, boolean aAdjusting)
      Description copied from interface: ILcdGXYView
      Sets the view's 2D world coordinate system, optionally indicating subsequent property changes.
      Specified by:
      setXYWorldReference in interface ILcdGXYView
      Parameters:
      aXYWorldReference - the new ILcdXYWorldReference associated to this view
      aRepaint - if true, the view is repainted. If false, the view is not repainted.
      aAdjusting - if true, the caller indicates that he will trigger another property change right after this call. This is reflected in the associated property change event.
      See Also:
    • getXYWorldReference

      public ILcdXYWorldReference getXYWorldReference()
      Description copied from interface: ILcdGXYView
      Returns the view's 2D world coordinate system.
      Specified by:
      getXYWorldReference in interface ILcdGXYView
      Returns:
      the view's 2D world coordinate system
      See Also:
    • setGXYController

      public void setGXYController(ILcdGXYController aGXYViewController)
      Do not call this method. TLcdGXYViewBufferedImage does not support controllers: an image has no user-interaction.

      Specified by:
      setGXYController in interface ILcdGXYView
      Parameters:
      aGXYViewController - the new controller of this view, or null if no controller is to be used
      Throws:
      UnsupportedOperationException - when this method is called
      See Also:
    • getGXYController

      public ILcdGXYController getGXYController()
      Description copied from interface: ILcdGXYView
      Returns the ILcdGXYController handling the user interaction of the view.
      Specified by:
      getGXYController in interface ILcdGXYView
      Returns:
      the current controller handling the user interaction, or null if no controller is present
      See Also:
    • getDefaultPen

      public ILcdGXYPen getDefaultPen()
      Deprecated.
      Use the relevant layer's pen instead.
      Returns an ILcdGXYPen supporting editing and painting on the view.
      Specified by:
      getDefaultPen in interface ILcdGXYView
      Returns:
      the default ILcdGXYPen of this view
      See Also:
    • setDefaultPen

      public void setDefaultPen(ILcdGXYPen aDefaultPen)
      Deprecated.
      Use the relevant layer's pen instead.
      Sets an ILcdGXYPen supporting editing and painting on the view.
      Parameters:
      aDefaultPen - the new default ILcdGXYPen of this view
      See Also:
    • setPaintingMode

      public void setPaintingMode(int aPaintingMode)
      Deprecated.
      This implementation ignores the painting mode setting, always making sure that bodies, labels and selections are painted.
      Sets the type or types of layer content to display in the ILcdGXYView.
      Specified by:
      setPaintingMode in interface ILcdGXYView
      Parameters:
      aPaintingMode - a binary OR of ILcdGXYLayer.BODIES, ILcdGXYLayer.LABELS, ILcdGXYLayer.SELECTION
      See Also:
    • getPaintingMode

      public int getPaintingMode()
      Deprecated.
      This implementation ignores the painting mode setting, always making sure that bodies, labels and selections are painted.
      Gets the painting mode for this ILcdGXYView.
      Specified by:
      getPaintingMode in interface ILcdGXYView
      Returns:
      a binary OR of ILcdGXYLayer.BODIES, ILcdGXYLayer.LABELS, ILcdGXYLayer.SELECTION
      See Also:
    • invalidate

      public void invalidate(boolean aRepaint, Object aSource, String aMessage)
      Description copied from interface: ILcdGXYView
      Asks the view to invalidate its content, optionally repainting the content asynchronously. A subsequent repaint will ask (at the least) all layers to draw their bodies, labels and selection. This method is typically called when the entire view needs to be redrawn, for example, after a zoom operation or projection change.
      Specified by:
      invalidate in interface ILcdGXYView
      Specified by:
      invalidate in interface ILcdView
      Parameters:
      aRepaint - if true, the view is updated immediately, but the method will not wait for the update to finish. If false, the view is updated on the next paint or repaint method call.
      aSource - class instance calling the method. For tracing purposes.
      aMessage - a message associated to this method call. For tracing purposes.
      See Also:
    • invalidateAndWait

      public void invalidateAndWait(boolean aRepaint, Object aSource, String aMessage)
      Description copied from interface: ILcdGXYView
      Asks the view to invalidate its content, optionally repainting the content synchronously. A subsequent repaint will ask (at the least) all layers to draw their bodies, labels and selection. This method is typically called when the entire view needs to be redrawn, for example, after a zoom operation or projection change.
      Specified by:
      invalidateAndWait in interface ILcdGXYView
      Parameters:
      aRepaint - if true the ILcdGXYView will be updated immediately, and the method will block until the update is complete. If false, the view is updated on the next paint or repaint method call.
      aSource - class instance calling the method. For tracing purposes.
      aMessage - a message associated to this method call. For tracing purposes.
      See Also:
    • invalidateRegion

      public void invalidateRegion(Rectangle aClip, boolean aRepaint, Object aSource, String aMessage)
      Description copied from interface: ILcdGXYView
      Asks the view to invalidate the content in the given AWT clip, optionally repainting the content asynchronously. A subsequent repaint will ask (at the least) all layers to draw their bodies, labels and selection in the given clip, and may reuse earlier generated imagery for the rest of the view. This method is typically called when a small portion of the view needs to be redrawn, for example, when the objects in that area have changed.
      Specified by:
      invalidateRegion in interface ILcdGXYView
      Parameters:
      aClip - the clip to invalidate
      aRepaint - if true, the view is updated immediately, but the method will not wait for the update to finish. If false, the view is updated on the next paint or repaint method call.
      aSource - class instance calling the method. For tracing purposes.
      aMessage - a message associated to this method call. For tracing purposes.
      See Also:
    • invalidateRegionAndWait

      public void invalidateRegionAndWait(Rectangle aClip, boolean aRepaint, Object aSource, String aMessage)
      Description copied from interface: ILcdGXYView
      Asks the view to invalidate the content in the given AWT clip, optionally repainting the content synchronously. A subsequent repaint will ask (at the least) all layers to draw their bodies, labels and selection in the given clip, and may reuse earlier generated imagery for the rest of the view. This method is typically called when a small portion of the view needs to be redrawn, for example, when the objects in that area have changed.
      Specified by:
      invalidateRegionAndWait in interface ILcdGXYView
      Parameters:
      aClip - the clip to invalidate
      aRepaint - if true the ILcdGXYView will be updated immediately, and the method will block until the update is complete. If false, the view is updated on the next paint or repaint method call.
      aSource - class instance calling the method. For tracing purposes.
      aMessage - a message associated to this method call. For tracing purposes.
      See Also:
    • invalidateGXYLayer

      public void invalidateGXYLayer(ILcdGXYLayer aGXYLayer, boolean aRepaint, Object aSource, String aMessage)
      Description copied from interface: ILcdGXYView
      Asks the view to invalidate the content of the given ILcdGXYLayer, optionally repainting the content asynchronously. A subsequent repaint will (at the least) ask the given layer to draw its bodies, labels and selection, and may reuse earlier generated imagery for the other layers. This method is typically called when a single layer needs to be redrawn, for example, when its painter settings change.
      Specified by:
      invalidateGXYLayer in interface ILcdGXYView
      Parameters:
      aGXYLayer - the layer to invalidate
      aRepaint - if true, the view is updated immediately, but the method will not wait for the update to finish. If false, the view is updated on the next paint or repaint method call.
      aSource - class instance calling the method. For tracing purposes.
      aMessage - a message associated to this method call. For tracing purposes.
    • invalidateGXYLayerAndWait

      public void invalidateGXYLayerAndWait(ILcdGXYLayer aGXYLayer, boolean aRepaint, Object aSource, String aMessage)
      Description copied from interface: ILcdGXYView
      Asks the view to invalidate the content of the given ILcdGXYLayer, optionally repainting the content synchronously. A subsequent repaint will (at the least) ask the given layer to draw its bodies, labels and selection, and may reuse earlier generated imagery for the other layers. This method is typically called when a single layer needs to be redrawn, for example, when its painter settings change.
      Specified by:
      invalidateGXYLayerAndWait in interface ILcdGXYView
      Parameters:
      aGXYLayer - the layer to invalidate
      aRepaint - if true the ILcdGXYView will be updated immediately, and the method will block until the update is complete. If false, the view is updated on the next paint or repaint method call.
      aSource - class instance calling the method. For tracing purposes.
      aMessage - a message associated to this method call. For tracing purposes.
      See Also:
    • invalidateSelection

      public void invalidateSelection(boolean aRepaint, Object aSource, String aMessage)
      Description copied from interface: ILcdGXYView
      Asks the ILcdGXYView to invalidate its selection, optionally repainting the content asynchronously. A subsequent repaint will ask (at the least) all layers to draw their selection, and may reuse earlier generated imagery for the bodies and labels. This method is typically called when the selection needs to be redrawn, for example, when changing the selection.
      Specified by:
      invalidateSelection in interface ILcdGXYView
      Parameters:
      aRepaint - if true, the view is updated immediately, but the method will not wait for the update to finish. If false, the view is updated on the next paint or repaint method call.
      aSource - class instance calling the method. For tracing purposes.
      aMessage - a message associated to this method call. For tracing purposes.
      See Also:
    • invalidateSelectionAndWait

      public void invalidateSelectionAndWait(boolean aRepaint, Object aSource, String aMessage)
      Description copied from interface: ILcdGXYView
      Asks the ILcdGXYView to invalidate its selection, optionally repainting the content synchronously. A subsequent repaint will ask (at the least) all layers to draw their selection, and may reuse earlier generated imagery for the bodies and labels. This method is typically called when the selection needs to be redrawn, for example, when changing the selection.
      Specified by:
      invalidateSelectionAndWait in interface ILcdGXYView
      Parameters:
      aRepaint - if true the ILcdGXYView will be updated immediately, and the method will block until the update is complete. If false, the view is updated on the next paint or repaint method call.
      aSource - class instance calling the method. For tracing purposes.
      aMessage - a message associated to this method call. For tracing purposes.
      See Also:
    • invalidateRegionSelection

      public void invalidateRegionSelection(Rectangle aClip, boolean aRepaint, Object aSource, String aMessage)
      Description copied from interface: ILcdGXYView
      Asks the ILcdGXYView to invalidate its selection in the given AWT clip, optionally repainting the content asynchronously. A subsequent repaint will ask (at the least) all layers to draw their selection in the given clip, and may reuse earlier generated imagery for the bodies, labels, and rest of the view. This method is typically called when the selection of a small portion of the view needs to be redrawn, for example, when changing the selection in that area.
      Specified by:
      invalidateRegionSelection in interface ILcdGXYView
      Parameters:
      aClip - the clip to invalidate
      aRepaint - if true, the view is updated immediately, but the method will not wait for the update to finish. If false, the view is updated on the next paint or repaint method call.
      aSource - class instance calling the method. For tracing purposes.
      aMessage - a message associated to this method call. For tracing purposes.
      See Also:
    • invalidateRegionSelectionAndWait

      public void invalidateRegionSelectionAndWait(Rectangle aClip, boolean aRepaint, Object aSource, String aMessage)
      Description copied from interface: ILcdGXYView
      Asks the ILcdGXYView to invalidate its selection in the given AWT clip, optionally repainting the content synchronously. A subsequent repaint will ask (at the least) all layers to draw their selection in the given clip, and may reuse earlier generated imagery for the bodies, labels, and rest of the view. This method is typically called when the selection of a small portion of the view needs to be redrawn, for example, when changing the selection in that area.
      Specified by:
      invalidateRegionSelectionAndWait in interface ILcdGXYView
      Parameters:
      aClip - the clip to invalidate
      aRepaint - if true the ILcdGXYView will be updated immediately, and the method will block until the update is complete. If false, the view is updated on the next paint or repaint method call.
      aSource - class instance calling the method. For tracing purposes.
      aMessage - a message associated to this method call. For tracing purposes.
      See Also:
    • setAutoUpdate

      public void setAutoUpdate(boolean aAutoUpdate)
      Sets whether to update the view's representation automatically to keep it in sync with its state and the state of its models.

      When switching the autoUpdate property from false to true, a repaint will be triggered.

      Specified by:
      setAutoUpdate in interface ILcdView
      Parameters:
      aAutoUpdate - if true, the view automatically updates its representation on reception of any event that might require an update (e.g. when its properties change, when an Object in a model has changed, or when a model has been added/removed). If false, the view must be repainted manually.
      See Also:
    • isAutoUpdate

      public boolean isAutoUpdate()
      Description copied from interface: ILcdView
      Returns whether the view's contents are automatically updated when necessary.
      Specified by:
      isAutoUpdate in interface ILcdView
      Returns:
      true if the view automatically updates its representation on reception of any event that might require an update (e.g. when its properties change, when an Object in a model has changed, or when a model has been added/removed). false if the view must be repainted manually.
      See Also:
    • setDrawOffScreenImageOnPaint

      public void setDrawOffScreenImageOnPaint(boolean aDrawOffScreenImageOnPaint)
      Description copied from interface: ILcdGXYView
      Sets whether the entire view's content is displayed, or only the current controller's representation. The controller can use this method to temporarily override the view's contents. The effect is visible upon the next repaint.
      Specified by:
      setDrawOffScreenImageOnPaint in interface ILcdGXYView
      Parameters:
      aDrawOffScreenImageOnPaint - true to make the view paint itself when one of the paint methods is called. False if only the current controller is painted.
      See Also:
    • isDrawOffScreenImageOnPaint

      public boolean isDrawOffScreenImageOnPaint()
      Description copied from interface: ILcdGXYView
      Returns whether the entire view's content is displayed, or only the controller's representation.
      Specified by:
      isDrawOffScreenImageOnPaint in interface ILcdGXYView
      Returns:
      true if the view paints itself when one of the paint methods is called. False if only the current controller is painted.
      See Also:
    • setUpdateLabelsOnSelectionChanged

      public void setUpdateLabelsOnSelectionChanged(boolean aUpdateLabelsOnSelectionChanged)
      Deprecated.
      This property is not used.
      Sets whether the labels are forced to be updated if a selection change occurs.
      Parameters:
      aUpdateLabelsOnSelectionChanged - whether to force a label update upon selection changes
      See Also:
    • isUpdateLabelsOnSelectionChanged

      public boolean isUpdateLabelsOnSelectionChanged()
      Deprecated.
      This property is not taken into account anymore.
      Returns whether the labels are forced to be updated if a selection change occurs.
      Returns:
      whether to force a label update upon selection changes
      See Also:
    • addPropertyChangeListener

      public void addPropertyChangeListener(PropertyChangeListener listener)
      Description copied from interface: ILcdPropertyChangeSource

      Registers the given PropertyChangeListener to be notified when this object's properties change.

      In case you need to register a listener which keeps a reference to an object with a shorter life-time than this change source, you can use a ALcdWeakPropertyChangeListener instance as property change listener.

      Specified by:
      addPropertyChangeListener in interface ILcdPropertyChangeSource
      Parameters:
      listener - The listener to be notified
      See Also:
    • removePropertyChangeListener

      public void removePropertyChangeListener(PropertyChangeListener listener)
      Description copied from interface: ILcdPropertyChangeSource

      De-registers the given PropertyChangeListener from receiving property change events for this object.

      If the listener was added more than once, it will be notified one less time after being removed. If the listener is null, or was never added, no exception is thrown and no action is taken.

      Specified by:
      removePropertyChangeListener in interface ILcdPropertyChangeSource
      Parameters:
      listener - the listener that should no longer be notified of changes of this object's properties
      See Also:
    • setGXYViewLabelPainter

      public void setGXYViewLabelPainter(ILcdGXYViewLabelPainter aGXYViewLabelPainter)
      Sets the label painter algorithm for this ILcdGXYView. A view label painter handles the labels of all the view's layers. When the view label painter is null, the layers are asked to paint their labels themselves. This will override any configured view label placer.

      Note that it is recommended to use setGXYViewLabelPlacer instead. Label placers offer better decluttering behavior, more algorithm choices, support for asynchronous label placement, and easier customization.

      Parameters:
      aGXYViewLabelPainter - the painter handling this view's labels, or null
      See Also:
    • getGXYViewLabelPainter

      public ILcdGXYViewLabelPainter getGXYViewLabelPainter()
      Description copied from interface: ILcdGXYView
      Returns the label painting algorithm for this view. A view label painter handles the labels of all the view's layers. Hence, the layers are not asked to paint their labels if the view label painter is not null. The view label painter can be used for decluttering labels across all layers. To do this, it can select the objects that need a label and delegate the actual painting to the relevant layer's ILcdGXYLabelPainter.
      Specified by:
      getGXYViewLabelPainter in interface ILcdGXYView
      Returns:
      the painter handling this view's labels, or null
      See Also:
    • getGXYViewLabelPlacer

      public ILcdGXYViewLabelPlacer getGXYViewLabelPlacer()
      Description copied from interface: ILcdGXYView
      Returns the label placer for this view. A view label placer handles the labels of all the view's layers. The layers are only responsible for painting their labels while the label placer declutters the labels.
      Specified by:
      getGXYViewLabelPlacer in interface ILcdGXYView
      Returns:
      the label placer handling this view's labels, or null.
      See Also:
    • setGXYViewLabelPlacer

      public void setGXYViewLabelPlacer(ILcdGXYViewLabelPlacer aGXYViewLabelPlacer)
      Description copied from interface: ILcdGXYView
      This method sets an ILcdGXYViewLabelPlacer to use for global labeling.

      This will override any configured view label painter.

      Specified by:
      setGXYViewLabelPlacer in interface ILcdGXYView
      Parameters:
      aGXYViewLabelPlacer - a view label placer.
      See Also:
    • setGXYLayerFactory

      public void setGXYLayerFactory(ILcdGXYLayerFactory newGXYLayerFactory)
      Sets the layer factory to use when adding models to the view. If null, layers can only be added using addGXYLayer(com.luciad.view.gxy.ILcdGXYLayer).
      Parameters:
      newGXYLayerFactory - the layer factory to use when adding models to the view, or null
      See Also:
    • getGXYLayerFactory

      public ILcdGXYLayerFactory getGXYLayerFactory()
      Returns the layer factory used when adding models to the view. If null, layers can only be added using addGXYLayer(com.luciad.view.gxy.ILcdGXYLayer).
      Returns:
      newGXYLayerFactory the layer factory that is used when adding models to the view
      See Also:
    • addStatusListener

      public void addStatusListener(ILcdStatusListener aStatusListener)
      Registers the given ILcdStatusListener to be notified of view status events. The amount, type and order of the status events is subject to change.
      Specified by:
      addStatusListener in interface ILcdGXYView
      Specified by:
      addStatusListener in interface ILcdStatusSource
      Parameters:
      aStatusListener - the listener that will be informed of status events
      See Also:
    • removeStatusListener

      public void removeStatusListener(ILcdStatusListener aStatusListener)
      Unregisters the given ILcdStatusListener from being notified of view status events.
      Specified by:
      removeStatusListener in interface ILcdGXYView
      Specified by:
      removeStatusListener in interface ILcdStatusSource
      Parameters:
      aStatusListener - the listener that will no longer be informed of status events
      See Also:
    • modelProduced

      public void modelProduced(TLcdModelProducerEvent aModelProducerEvent)
      The produced model is added to the view, provided that a layer factory supporting the model is set.
      Specified by:
      modelProduced in interface ILcdModelProducerListener
      Parameters:
      aModelProducerEvent - the event describing the model production
      See Also:
    • addModelListener

      public void addModelListener(ILcdModelListener aModelListener)
      Description copied from interface: ILcdGXYView
      Registers the given ILcdModelListener to be informed of ILcdModel change events from any layer's model in this view.
      Specified by:
      addModelListener in interface ILcdGXYView
      Parameters:
      aModelListener - a listener that will be notified of ILcdModel change events from any layer's model in this view
      See Also:
    • removeModelListener

      public void removeModelListener(ILcdModelListener aModelListener)
      Description copied from interface: ILcdGXYView
      Unregisters the given ILcdModelListener from receiving ILcdModel change events from any layer's model in this view.
      Specified by:
      removeModelListener in interface ILcdGXYView
      Parameters:
      aModelListener - a listener that the view will no longer notify of ILcdModel change events
      See Also:
    • addLayerSelectionListener

      public void addLayerSelectionListener(ILcdSelectionListener aSelectionListener)
      Description copied from interface: ILcdGXYView
      Registers the given ILcdSelectionListener to be informed of selection change events from any layer in this view.
      Specified by:
      addLayerSelectionListener in interface ILcdGXYView
      Parameters:
      aSelectionListener - a listener that will be notified of selection change events from any layer in this view. The events will have the relevant layer as source.
      See Also:
    • removeLayerSelectionListener

      public void removeLayerSelectionListener(ILcdSelectionListener aSelectionListener)
      Description copied from interface: ILcdGXYView
      Unregisters the given ILcdSelectionListener from receiving selection change events from any layer in this view.
      Specified by:
      removeLayerSelectionListener in interface ILcdGXYView
      Parameters:
      aSelectionListener - a listener that the view will no longer inform of selection change events
      See Also:
    • setWaitCursorOn

      public void setWaitCursorOn(boolean aWaitCursorOn)
      Deprecated.
      this view implementation does not support cursors
      Sets whether to display a wait cursor when the ILcdGXYView is repainting. The default is false.
      Parameters:
      aWaitCursorOn - if true, displays a wait cursor while repainting the view
      See Also:
    • isWaitCursorOn

      public boolean isWaitCursorOn()
      Deprecated.
      this view implementation does not support cursors
      Returns whether a wait cursor is displayed when the ILcdGXYView is repainting.
      Returns:
      true if a wait cursor is displayed while the view is repainting
      See Also:
    • repaint

      public void repaint()
      TLcdGXYViewBufferedImage does not implement this method. Use getImage() to obtain the up-to-date representation of the view.

      Repaints the view. The view is allowed to reuse earlier painted results as long as they are valid. Invalidation of the contents may occur indirectly (e.g. by changing view or layer properties) or directly by calling one of the invalidate methods. This method may return before the repaint is complete.

      Specified by:
      repaint in interface ILcdGXYView
      See Also:
    • repaint

      public void repaint(int aX, int aY, int aWidth, int aHeight)
      TLcdGXYViewBufferedImage does not implement this method. Use getImage() to obtain the up-to-date representation of the view.

      Repaints the view within the given AWT rectangle. The view is allowed to reuse earlier painted results as long as they are valid. Invalidation of the contents may occur indirectly (e.g. by changing view or layer properties) or directly by calling one of the invalidate methods. This method may return before the repaint is complete.

      Specified by:
      repaint in interface ILcdGXYView
      Parameters:
      aX - the x-coordinate of the rectangle's top-left point
      aY - the y-coordinate of the rectangle's top-left point
      aWidth - the width of the rectangle
      aHeight - the height of the rectangle
      See Also:
    • getForeground

      public Color getForeground()
      Deprecated.
      This property is not used.
      Returns the foreground color of the view.
      Specified by:
      getForeground in interface ILcdGXYView
      Returns:
      the view's foreground color
      See Also:
    • setForeground

      public void setForeground(Color aColor)
      Deprecated.
      This property is not used.
      Sets the foreground color of the view.
      Specified by:
      setForeground in interface ILcdGXYView
      Parameters:
      aColor - the desired foreground Color
      See Also:
    • setName

      public void setName(String aName)
      Sets the name of the view.
      Parameters:
      aName - the new name of the view
      See Also:
    • getName

      public String getName()
      Returns the name of the view
      Returns:
      the name of the view
      See Also:
    • getGraphics

      public Graphics getGraphics()
      Description copied from interface: ILcdGXYView
      Returns a graphics context for this view. Most view implementations offer this context only to retrieve information from. Typically it cannot be used to draw on the view, especially if the view is automatically repainted.
      Specified by:
      getGraphics in interface ILcdGXYView
      Returns:
      a graphics context for this view
    • isPaintInBackground

      public boolean isPaintInBackground()
      Deprecated.
      This method has been deprecated in favor of the approach provided by the ILcdGXYAsynchronousLayerWrapper interface and its implementations, which is more versatile and which generally offers better thread safety.
      Returns whether the view is painted in a thread other than the event dispatch thread.
      Specified by:
      isPaintInBackground in interface ILcdGXYView
      Returns:
      true if background painting is enabled; false otherwise
    • setPaintInBackground

      public void setPaintInBackground(boolean aUpdateInBackground)
      Deprecated.
      This method has been deprecated in favor of the approach provided by the ILcdGXYAsynchronousLayerWrapper interface and its implementations, which is more versatile and which generally offers better thread safety.
      Enables or disables painting in a thread other than the event dispatch thread. If background painting is not supported by an implementation, this method throws a runtime exception.

      Painting in the background is not supported by this view implementation. If this method is called, a runtime exception will be thrown.

      Specified by:
      setPaintInBackground in interface ILcdGXYView
      Parameters:
      aUpdateInBackground - true to enable painting in the background; false to disable it
      Throws:
      RuntimeException - when the method is called
    • getPaintExceptionHandler

      public ILcdPaintExceptionHandler getPaintExceptionHandler()
      Description copied from interface: ILcdGXYView
      Returns a handler to report paint exceptions. The view, as well as layers and painters can use this handler if they encounter an exception during painting. Because painting may happen asynchronously, the handler may be called from different threads.
      Specified by:
      getPaintExceptionHandler in interface ILcdGXYView
      Returns:
      a handler to report paint exceptions.
    • setPaintExceptionHandler

      public void setPaintExceptionHandler(ILcdPaintExceptionHandler aPaintExceptionHandler)
      Sets a handler to report paint exceptions. Layers and/or painters can use this handler if they encounter a problem during painting. Because painting may happen asynchronously, the handler may be called from different threads.
      Specified by:
      setPaintExceptionHandler in interface ILcdGXYView
      Parameters:
      aPaintExceptionHandler - a handler to report paint exceptions. This handler should never be null.
    • addViewInvalidationListener

      public void addViewInvalidationListener(ILcdViewInvalidationListener aInvalidationListener)
      Registers an ILcdViewInvalidationListener to be informed when the view's contents are invalid. This can happen directly (e.g. by calling invalidateGXYLayer(com.luciad.view.gxy.ILcdGXYLayer, boolean, java.lang.Object, java.lang.String)) or indirectly (e.g. by calling pan(int, int, boolean))
      Specified by:
      addViewInvalidationListener in interface ILcdGXYView
      Parameters:
      aInvalidationListener - the listener to notify when the view has been invalidated
      See Also:
    • removeViewInvalidationListener

      public void removeViewInvalidationListener(ILcdViewInvalidationListener aInvalidationListener)
      Unregisters an ILcdViewInvalidationListener so that it is no longer informed of invalidation events for this view.
      Specified by:
      removeViewInvalidationListener in interface ILcdGXYView
      Parameters:
      aInvalidationListener - the listener to no longer notify when the view has been invalidated
      See Also:
    • getRootNode

      public ILcdLayerTreeNode getRootNode()
      Description copied from interface: ILcdTreeLayered

      Returns the root node of the tree structure.

      Specified by:
      getRootNode in interface ILcdTreeLayered
      Returns:
      the root node of the tree structure
    • setPaintExecutorService

      public void setPaintExecutorService(ALcdPaintExecutorService aPaintExecutorService)
      Allows incrementally rendering the view in a thread that is not the Event Dispatch thread (EDT). The typical use of an offscreen view is non-interactive: a single, synchronous rendering pass is desired, yielding a complete image. This method allows you to build your own interactive (non ILcdGXYView) view that is based on the output of this offscreen view. More specifically, the paint executor service allows the asynchronous painting and labeling functionality to execute the necessary code in the thread that renders the offscreen view.

      Rendering the view in a thread that is not the Event Dispatch Thread excludes it from being usable by any Swing related functionality, including layer trees, scale icons, navigation controls, balloons, etc...

      Parameters:
      aPaintExecutorService - the new paint executor service
    • getPaintExecutorService

      public ALcdPaintExecutorService getPaintExecutorService()
      Returns the used paint executor service. By default, the Event Dispatch Thread (EDT) is used.
      Returns:
      the used paint executor service
      See Also:
    • isAsynchronousAllowed

      public boolean isAsynchronousAllowed()
      Description copied from interface: ILcdGXYView

      Returns whether this view allows asynchronous operations. Painters, layers or other parts of a view should not perform asynchronous operations when this method returns false. If this method returns true, they can decide either way.

      When asynchronous operations are allowed, intermediate results of time-consuming asynchronous operations are displayed in order to provide an interactive user experience. For non-interactive applications, it is useful to disable asynchronous operations, since they can lead to more unpredictable results. Examples are tests, or server side functionality like the OGC WMS protocol which paints the view and returns it as an image. In these cases, you want the view to be painted completely without having to deal with intermediate results.

      Specified by:
      isAsynchronousAllowed in interface ILcdGXYView
      Returns:
      whether this view allows asynchronous operations.
    • setAsynchronousAllowed

      public void setAsynchronousAllowed(boolean aAsynchronousAllowed)

      Sets if asynchronous operation are allowed for this view. See ILcdGXYView.isAsynchronousAllowed() for more information.

      This method returns false by default.

      Note: it is advised to only modify this flag at construction time, not at runtime.

      Parameters:
      aAsynchronousAllowed - true to allow asynchronous operations.
      Since:
      2017.0
    • isAntiAliased

      public boolean isAntiAliased()
      Description copied from interface: ILcdGXYView
      Specifies if anti-aliasing is enabled or not. Anti-aliasing makes lines and text appear smoother, but slows down rendering a little bit. If this property is false, it does not mean anti-aliasing is fully disabled. It only means anti-aliasing is not enabled on the view level, various layers and painters may still decide to enable anti-aliasing for what they render.
      Specified by:
      isAntiAliased in interface ILcdGXYView
      Returns:
      true if anti-aliasing is enabled, false otherwise.
    • setAntiAliased

      public void setAntiAliased(boolean aAntiAliased)
      Changes the anti-aliasing behavior. Please refer to ILcdGXYView.isAntiAliased() for more information.
      Parameters:
      aAntiAliased - true to enable anti-aliasing, false to let layers and painters decide.
      Since:
      2017.0