Class ALcdSLDGraphicsProvider

java.lang.Object
com.luciad.ogc.sld.view.gxy.ALcdSLDGraphicsProvider
All Implemented Interfaces:
ILcdSLDGraphicsProvider

public abstract class ALcdSLDGraphicsProvider extends Object implements ILcdSLDGraphicsProvider
This class adapts the ILcdSLDGraphicsProvider to allow for the ILcdGXYContext to be passed to the setup and rollback methods. This makes it possible to use an ILcdGXYPainterStyle as a graphics provider.

Painters that are using an ILcdSLDGraphicsProvider should check whether it is an extension of an ALcdSLDGraphicsProvider. If this is the case, the methods that pass the ILcdGXYContext should be used.

Since:
10.1
  • Constructor Details

    • ALcdSLDGraphicsProvider

      public ALcdSLDGraphicsProvider()
  • Method Details

    • setupGraphics

      public Graphics setupGraphics(Graphics aGraphics, int aPainterMode, Object aObject)
      Sets up the Graphics before painting the given object. This method returns a Graphics object that may be the original Graphics, or a newly created Graphics object. This is done to allow providers to create custom Graphics extensions to support advanced features, such as strokes with an image.

      By default, this method delegates to the setupGraphics(Graphics, int, Object, ILcdGXYContext) method. Painters should avoid calling this method and use the method with the ILcdGXYContext parameter instead.

      Specified by:
      setupGraphics in interface ILcdSLDGraphicsProvider
      Parameters:
      aGraphics - the Graphics to configure
      aPainterMode - the painter mode for which the Graphics has to be set up, see ILcdGXYPainter
      aObject - the object for which the Graphics has to be set up
      Returns:
      the prepared Graphics.
    • rollBackGraphics

      public void rollBackGraphics(Graphics aGraphics, int aPainterMode, Object aObject)
      Resets the Graphics to its original state.

      By default, this method delegates to the rollBackGraphics(Graphics, int, Object, ILcdGXYContext) method. Painters should avoid calling this method and use the method with the ILcdGXYContext instead.

      Specified by:
      rollBackGraphics in interface ILcdSLDGraphicsProvider
      Parameters:
      aGraphics - the Graphics instance that was returned by setupGraphics(java.awt.Graphics, int, Object).
      aPainterMode - the painter mode that was used to set up the Graphics, see ILcdGXYPainter
      aObject - the object for which the Graphics was set up
    • setupGraphics

      public abstract Graphics setupGraphics(Graphics aGraphics, int aPainterMode, Object aObject, ILcdGXYContext aGXYContext)
      Set up the Graphics before painting the given object. As an example, if (aMode & ILcdGXYPainter.SELECTED) != 0, you could call aGraphics.setColor(Color.red) to see the selected representation of the object in red.
      Parameters:
      aGraphics - the Graphics to set up
      aPainterMode - the painting mode to consider (defined in ILcdGXYPainter)
      aObject - the Object to paint
      aGXYContext - the ILcdGXYContext to consider
      Returns:
      the prepared Graphics.
      See Also:
    • rollBackGraphics

      public abstract void rollBackGraphics(Graphics aGraphics, int aPainterMode, Object aObject, ILcdGXYContext aGXYContext)
      Resets the Graphics to its original state.
      Parameters:
      aGraphics - the Graphics instance that was returned by setupGraphics(java.awt.Graphics, int, Object, com.luciad.view.gxy.ILcdGXYContext).
      aPainterMode - the painter mode that was used to set up the Graphics, see ILcdGXYPainter
      aObject - the object for which the Graphics was set up
      aGXYContext - the ILcdGXYContext to consider