Package com.luciad.ogc.sld.view.gxy
Class ALcdSLDGraphicsProvider
java.lang.Object
com.luciad.ogc.sld.view.gxy.ALcdSLDGraphicsProvider
- All Implemented Interfaces:
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
rollBackGraphics
(Graphics aGraphics, int aPainterMode, Object aObject) Resets theGraphics
to its original state.abstract void
rollBackGraphics
(Graphics aGraphics, int aPainterMode, Object aObject, ILcdGXYContext aGXYContext) Resets theGraphics
to its original state.setupGraphics
(Graphics aGraphics, int aPainterMode, Object aObject) Sets up theGraphics
before painting the given object.abstract Graphics
setupGraphics
(Graphics aGraphics, int aPainterMode, Object aObject, ILcdGXYContext aGXYContext) Set up theGraphics
before painting the given object.
-
Constructor Details
-
ALcdSLDGraphicsProvider
public ALcdSLDGraphicsProvider()
-
-
Method Details
-
setupGraphics
Sets up theGraphics
before painting the given object. This method returns aGraphics
object that may be the originalGraphics
, or a newly createdGraphics
object. This is done to allow providers to create customGraphics
extensions to support advanced features, such as strokes with an image. By default, this method delegates to thesetupGraphics(Graphics, int, Object, ILcdGXYContext)
method. Painters should avoid calling this method and use the method with theILcdGXYContext
parameter instead.- Specified by:
setupGraphics
in interfaceILcdSLDGraphicsProvider
- Parameters:
aGraphics
- theGraphics
to configureaPainterMode
- the painter mode for which theGraphics
has to be set up, seeILcdGXYPainter
aObject
- the object for which theGraphics
has to be set up- Returns:
- the prepared
Graphics
.
-
rollBackGraphics
Resets theGraphics
to its original state. By default, this method delegates to therollBackGraphics(Graphics, int, Object, ILcdGXYContext)
method. Painters should avoid calling this method and use the method with theILcdGXYContext
instead.- Specified by:
rollBackGraphics
in interfaceILcdSLDGraphicsProvider
- Parameters:
aGraphics
- theGraphics
instance that was returned bysetupGraphics(java.awt.Graphics, int, Object)
.aPainterMode
- the painter mode that was used to set up theGraphics
, seeILcdGXYPainter
aObject
- the object for which theGraphics
was set up
-
setupGraphics
public abstract Graphics setupGraphics(Graphics aGraphics, int aPainterMode, Object aObject, ILcdGXYContext aGXYContext) Set up theGraphics
before painting the given object. As an example, if(aMode & ILcdGXYPainter.SELECTED) != 0
, you could callaGraphics.setColor(Color.red)
to see the selected representation of the object in red.- Parameters:
aGraphics
- theGraphics
to set upaPainterMode
- the painting mode to consider (defined inILcdGXYPainter
)aObject
- theObject
to paintaGXYContext
- theILcdGXYContext
to consider- Returns:
- the prepared
Graphics
. - See Also:
-
rollBackGraphics
public abstract void rollBackGraphics(Graphics aGraphics, int aPainterMode, Object aObject, ILcdGXYContext aGXYContext) Resets theGraphics
to its original state.- Parameters:
aGraphics
- theGraphics
instance that was returned bysetupGraphics(java.awt.Graphics, int, Object, com.luciad.view.gxy.ILcdGXYContext)
.aPainterMode
- the painter mode that was used to set up theGraphics
, seeILcdGXYPainter
aObject
- the object for which theGraphics
was set upaGXYContext
- theILcdGXYContext
to consider
-