public abstract class ALcdSLDGraphicsProvider extends Object implements ILcdSLDGraphicsProvider
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.Constructor and Description |
---|
ALcdSLDGraphicsProvider() |
Modifier and Type | Method and Description |
---|---|
void |
rollBackGraphics(Graphics aGraphics,
int aPainterMode,
Object aObject)
Resets the
Graphics to its original state. |
abstract void |
rollBackGraphics(Graphics aGraphics,
int aPainterMode,
Object aObject,
ILcdGXYContext aGXYContext)
Resets the
Graphics to its original state. |
Graphics |
setupGraphics(Graphics aGraphics,
int aPainterMode,
Object aObject)
Sets up the
Graphics before painting the given object. |
abstract Graphics |
setupGraphics(Graphics aGraphics,
int aPainterMode,
Object aObject,
ILcdGXYContext aGXYContext)
Set up the
Graphics before painting the given object. |
public Graphics setupGraphics(Graphics aGraphics, int aPainterMode, Object aObject)
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.setupGraphics
in interface ILcdSLDGraphicsProvider
aGraphics
- the Graphics
to configureaPainterMode
- 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 upGraphics
.public void rollBackGraphics(Graphics aGraphics, int aPainterMode, Object aObject)
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.rollBackGraphics
in interface ILcdSLDGraphicsProvider
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 uppublic abstract Graphics setupGraphics(Graphics aGraphics, int aPainterMode, Object aObject, ILcdGXYContext aGXYContext)
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.aGraphics
- the Graphics
to set upaObject
- the Object
to paintaPainterMode
- the painting mode to consider (defined in ILcdGXYPainter
)aGXYContext
- the ILcdGXYContext
to considerGraphics
.ILcdGXYPainter
public abstract void rollBackGraphics(Graphics aGraphics, int aPainterMode, Object aObject, ILcdGXYContext aGXYContext)
Graphics
to its original state.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 upaGXYContext
- the ILcdGXYContext
to consider