Package com.luciad.ais.view.gxy.painter
Class TLcdGXYRoutePainter
java.lang.Object
com.luciad.view.gxy.ALcdGXYPainter
com.luciad.view.gxy.painter.TLcdGXYShapeListPainter
com.luciad.ais.view.gxy.painter.TLcdGXYRoutePainter
- All Implemented Interfaces:
ILcdCloneable,ILcdDeepCloneable,ILcdPropertyChangeSource,ILcdGXYEditor,ILcdGXYEditorProvider,ILcdGXYPainter,ILcdGXYPainterProvider,ILcdGXYPathPainter,Serializable,Cloneable
This extension of
TLcdGXYShapeListPainter paints ILcdShapeList
objects whose shapes are themselves ILcdPointList implementations.
Optionally, an icon can be painted on each point in the point lists.
Painting of the icons is delegated to another painter, which can be set
using the setPointPainter() method.- See Also:
-
Field Summary
Fields inherited from class com.luciad.view.gxy.painter.TLcdGXYShapeListPainter
FIRST_POSSIBLE_SHAPE_ANCHOR_POINT, FOCUS_POINT, fShapeGXYEditorProvider, fShapeGXYPainterProvider, MIDDLE_OF_BOUNDS, ONE_SHAPE_ANCHOR_POINTFields inherited from class com.luciad.view.gxy.ALcdGXYPainter
defaultCreationFillStyle, defaultCreationLineStyle, defaultFillStyle, defaultLineStyle, fWorkBoundsFields inherited from interface com.luciad.view.gxy.ILcdGXYEditor
CREATING, END_CREATION, RESHAPED, START_CREATION, TRANSLATEDFields inherited from interface com.luciad.view.gxy.ILcdGXYPainter
BODY, CREATING, DEFAULT, HANDLES, RESHAPING, SELECTED, SNAPS, TRANSLATING -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()MakesObject.clone()public.getGXYPainter(Object aObject) Finds anILcdGXYPainterthat can be used to paint or locate the object passed.Returns the line style of this painter.Returns the painter used to paint icons on the points of a route.voidpaint(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext) Displays the representation of the object in the given mode on the Graphics passed, taking into account the context passed.voidsetLineStyle(ILcdGXYPainterStyle aStyle) Sets the line style of this painter.voidsetPointPainter(ILcdGXYPainter aPainter) Sets the painter used to paint icons on the points of a route.Methods inherited from class com.luciad.view.gxy.painter.TLcdGXYShapeListPainter
acceptSnapTarget, anchorPointSFCT, appendAWTPath, appendGeneralPath, boundsSFCT, clone, edit, editShape, getAnchorPointLocation, getCreationClickCount, getCursor, getGXYEditor, getObject, getShapeGXYEditorProvider, getShapeGXYPainterProvider, isEditTouchedOnly, isTouched, retrieveShapeEditor, retrieveShapePainter, setAnchorPointLocation, setEditTouchedOnly, setObject, setShapeGXYEditorProvider, setShapeGXYPainterProvider, snapTarget, supportSnapMethods inherited from class com.luciad.view.gxy.ALcdGXYPainter
addPropertyChangeListener, firePropertyChangeEvent, firePropertyChangeEvent, getDisplayName, isTraceOn, removePropertyChangeListener, setClassTraceOn, setDisplayName, setTraceOnMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.luciad.view.gxy.ILcdGXYEditor
getDisplayNameMethods inherited from interface com.luciad.view.gxy.ILcdGXYPainter
getDisplayNameMethods inherited from interface com.luciad.util.ILcdPropertyChangeSource
addPropertyChangeListener, removePropertyChangeListener
-
Constructor Details
-
TLcdGXYRoutePainter
public TLcdGXYRoutePainter()Constructs a newTLcdGXYRoutePainterobject. ATLcdGXYPointListPainteris initialized to paint the routes as polylines and set to be the editor provider and the painter provider of this TLcdGXYShapeListPainter.
-
-
Method Details
-
clone
Description copied from interface:ILcdCloneableMakes
When for example extending fromObject.clone()public.java.lang.Object, it can be implemented like this:public Object clone() { try { return super.clone(); } catch ( CloneNotSupportedException e ) { // Cannot happen: extends from Object and implements Cloneable (see also Object.clone) throw new RuntimeException( e ); } }- Specified by:
clonein interfaceILcdCloneable- Specified by:
clonein interfaceILcdGXYEditorProvider- Specified by:
clonein interfaceILcdGXYPainterProvider- Overrides:
clonein classTLcdGXYShapeListPainter- Returns:
- a clone of this painter provider.
- See Also:
-
getLineStyle
Returns the line style of this painter.- Returns:
- the line style of this painter.
-
setLineStyle
Sets the line style of this painter.- Parameters:
aStyle- the line style of this painter.
-
paint
Description copied from class:TLcdGXYShapeListPainterDisplays the representation of the object in the given mode on the Graphics passed, taking into account the context passed.This implementation will retrieve a painter for all
ILcdShapeobjects inside theILcdShapeListobject using theretrieveShapePaintermethod and will use that painter to paint the corresponding shape.- Specified by:
paintin interfaceILcdGXYPainter- Overrides:
paintin classTLcdGXYShapeListPainter- Parameters:
aGraphics- The graphics to paint the object on.aMode- The mode to render the object in.aGXYContext- The context to render the object in.
-
getGXYPainter
Description copied from interface:ILcdGXYPainterProviderFinds anILcdGXYPainterthat can be used to paint or locate the object passed.The painter provider is responsible for setting the object to the painter before returning the painter. An implementation should therefore have the following structure:
public ILcdGXYPainter getGXYPainter(Object aObject) { ILcdGXYPainter painter = ... // find the painter for the object if (painter != null) { painter.setObject(aObject); } return painter; }- Specified by:
getGXYPainterin interfaceILcdGXYPainterProvider- Overrides:
getGXYPainterin classALcdGXYPainter- Parameters:
aObject- the object to find a painter for- Returns:
- a painter that can be used to paint or locate the object; or null if no painter could be found for the given object, or the object could not be set on the retrieved painter.
-
setPointPainter
Sets the painter used to paint icons on the points of a route. Set this to null to disable icon painting.- Parameters:
aPainter- anILcdGXYPainterthat must be able to paintILcdPointobjects.
-
getPointPainter
Returns the painter used to paint icons on the points of a route.- Returns:
- the
ILcdGXYPainterused to paint the points of a route.
-