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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidrollBackGraphics(Graphics aGraphics, int aPainterMode, Object aObject) Resets theGraphicsto its original state.abstract voidrollBackGraphics(Graphics aGraphics, int aPainterMode, Object aObject, ILcdGXYContext aGXYContext) Resets theGraphicsto its original state.setupGraphics(Graphics aGraphics, int aPainterMode, Object aObject) Sets up theGraphicsbefore painting the given object.abstract GraphicssetupGraphics(Graphics aGraphics, int aPainterMode, Object aObject, ILcdGXYContext aGXYContext) Set up theGraphicsbefore painting the given object.
-
Constructor Details
-
ALcdSLDGraphicsProvider
public ALcdSLDGraphicsProvider()
-
-
Method Details
-
setupGraphics
Sets up theGraphicsbefore painting the given object. This method returns aGraphicsobject that may be the originalGraphics, or a newly createdGraphicsobject. This is done to allow providers to create customGraphicsextensions 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 theILcdGXYContextparameter instead.- Specified by:
setupGraphicsin interfaceILcdSLDGraphicsProvider- Parameters:
aGraphics- theGraphicsto configureaPainterMode- the painter mode for which theGraphicshas to be set up, seeILcdGXYPainteraObject- the object for which theGraphicshas to be set up- Returns:
- the prepared
Graphics.
-
rollBackGraphics
Resets theGraphicsto 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 theILcdGXYContextinstead.- Specified by:
rollBackGraphicsin interfaceILcdSLDGraphicsProvider- Parameters:
aGraphics- theGraphicsinstance that was returned bysetupGraphics(java.awt.Graphics, int, Object).aPainterMode- the painter mode that was used to set up theGraphics, seeILcdGXYPainteraObject- the object for which theGraphicswas set up
-
setupGraphics
public abstract Graphics setupGraphics(Graphics aGraphics, int aPainterMode, Object aObject, ILcdGXYContext aGXYContext) Set up theGraphicsbefore 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- theGraphicsto set upaPainterMode- the painting mode to consider (defined inILcdGXYPainter)aObject- theObjectto paintaGXYContext- theILcdGXYContextto consider- Returns:
- the prepared
Graphics. - See Also:
-
rollBackGraphics
public abstract void rollBackGraphics(Graphics aGraphics, int aPainterMode, Object aObject, ILcdGXYContext aGXYContext) Resets theGraphicsto its original state.- Parameters:
aGraphics- theGraphicsinstance 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, seeILcdGXYPainteraObject- the object for which theGraphicswas set upaGXYContext- theILcdGXYContextto consider
-