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_POINT
Fields inherited from class com.luciad.view.gxy.ALcdGXYPainter
defaultCreationFillStyle, defaultCreationLineStyle, defaultFillStyle, defaultLineStyle, fWorkBounds
Fields inherited from interface com.luciad.view.gxy.ILcdGXYEditor
CREATING, END_CREATION, RESHAPED, START_CREATION, TRANSLATED
Fields inherited from interface com.luciad.view.gxy.ILcdGXYPainter
BODY, CREATING, DEFAULT, HANDLES, RESHAPING, SELECTED, SNAPS, TRANSLATING
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionclone()
MakesObject.clone()
public.getGXYPainter
(Object aObject) Finds anILcdGXYPainter
that 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.void
paint
(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.void
setLineStyle
(ILcdGXYPainterStyle aStyle) Sets the line style of this painter.void
setPointPainter
(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, supportSnap
Methods inherited from class com.luciad.view.gxy.ALcdGXYPainter
addPropertyChangeListener, firePropertyChangeEvent, firePropertyChangeEvent, getDisplayName, isTraceOn, removePropertyChangeListener, setClassTraceOn, setDisplayName, setTraceOn
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.luciad.view.gxy.ILcdGXYEditor
getDisplayName
Methods inherited from interface com.luciad.view.gxy.ILcdGXYPainter
getDisplayName
Methods inherited from interface com.luciad.util.ILcdPropertyChangeSource
addPropertyChangeListener, removePropertyChangeListener
-
Constructor Details
-
TLcdGXYRoutePainter
public TLcdGXYRoutePainter()Constructs a newTLcdGXYRoutePainter
object. ATLcdGXYPointListPainter
is 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:ILcdCloneable
Makes
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:
clone
in interfaceILcdCloneable
- Specified by:
clone
in interfaceILcdGXYEditorProvider
- Specified by:
clone
in interfaceILcdGXYPainterProvider
- Overrides:
clone
in 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:TLcdGXYShapeListPainter
Displays 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
ILcdShape
objects inside theILcdShapeList
object using theretrieveShapePainter
method and will use that painter to paint the corresponding shape.- Specified by:
paint
in interfaceILcdGXYPainter
- Overrides:
paint
in 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:ILcdGXYPainterProvider
Finds anILcdGXYPainter
that 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:
getGXYPainter
in interfaceILcdGXYPainterProvider
- Overrides:
getGXYPainter
in 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
- anILcdGXYPainter
that must be able to paintILcdPoint
objects.
-
getPointPainter
Returns the painter used to paint icons on the points of a route.- Returns:
- the
ILcdGXYPainter
used to paint the points of a route.
-