Class TLcdGXYAISPointListPainter
- All Implemented Interfaces:
ILcdCloneable
,ILcdPropertyChangeSource
,ILcdGXYEditor
,ILcdGXYEditorProvider
,ILcdGXYPainter
,ILcdGXYPainterProvider
,ILcdGXYPathPainter
,Serializable
,Cloneable
TLcdGXYPointListPainter
, but paints an
icon if the point list contains only a single point.
By default, the points are painted by a TLcdGXYAISIconProviderPainter
.
The symbology usage can be changed in two ways:
- the
setPointPainter
method can be used to define another painter, - the
getPointPainter
method can be used to retrieve the default painter. TheTLcdGXYAISIconProviderPainter
class provides asetSymbolProvider
method to change its symbol provider.
Like its super class, this painter accepts instances of any implementation
of the ILcdPointList
interface.
- See Also:
-
Field Summary
Fields inherited from class com.luciad.view.gxy.painter.TLcdGXYPointListPainter
AREA, COORDINATES_AVERAGE, END_OF_CURVE, FILLED, FIRST_POSSIBLE_POINT, FOCUS_POINT, INSIDE_POLYGON, MEDIAN_POINT, MIDDLE_OF_BOUNDS, MIDDLE_OF_CURVE, OUTLINE_AREA, OUTLINED_FILLED, POINT, POLYGON, POLYLINE, START_OF_CURVE
Fields inherited from class com.luciad.view.gxy.painter.ALcdGXYAreaPainter
OUTLINED
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
ConstructorDescriptionConstructs a newTLcdGXYAISPointListPainter
object. -
Method Summary
Modifier and TypeMethodDescriptionvoid
boundsSFCT
(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext, ILcd2DEditableBounds a2DEditableBounds) Sets the supplied bounds (in view coordinates, pixels) so that it encompasses the representation of the object in the given mode taking into account the given context.clone()
MakesObject.clone()
public.getCursor
(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext) Returns aCursor
that clarifies the render mode and context this painter is operating in.Returns the painter that will be used to paint pointLists consisting of only one point.boolean
isTouched
(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext) Depending on the render mode and paint mode, returns whether one of the handles (the source point list), the painted point list or the interior of the point list is touched.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
Specifies the object to be painted.void
setPointPainter
(ILcdGXYPainter aPointPainter) Specifies a painter that is able to paint instances of implementations of theILcdPoint
and theILcdShape
interface.snapTarget
(Graphics aGraphics, ILcdGXYContext aGXYContext) Returns a point of theILcdPointList
object if the point is touched.boolean
supportSnap
(Graphics aGraphics, ILcdGXYContext aGXYContext) Supports snapping when theILcdPointList
object set to this painter contains at least one point.Methods inherited from class com.luciad.view.gxy.painter.TLcdGXYPointListPainter
acceptSnapTarget, anchorPointSFCT, append2DPoint, appendAWTPath, appendGeneralPath, edit, getAnchorPointLocation, getCreationClickCount, getFillSelection, getGXYEditor, getMinimumEditDelta, getMode, getModeName, getObject, getPaintCache, getSnapIcon, getTouchedPoint, getTouchedSegment, getTouchedSegment, getWindingRule, insert2DPoint, insidePolygon, isMoveOnlyOnEdit, isTraceOn, linkToSnapTarget, move2DPoint, removePointAt, retrieveMinimalPointcount, retrievePointList, setAnchorPointLocation, setFillSelection, setMinimumEditDelta, setMode, setModelModelTransformationClass, setMoveOnlyOnEdit, setPaintCache, setSnapIcon, setTraceOn, setupGraphicsForFill, setupGraphicsForLine, setupGraphicsForPoint, setWindingRule, translate2D, translate2DPoint
Methods inherited from class com.luciad.view.gxy.painter.ALcdGXYAreaPainter
getEditMode, getFillStyle, getLineStyle, getSelectionMode, setEditMode, setFillStyle, setLineStyle, setSelectionMode
Methods inherited from class com.luciad.view.gxy.ALcdGXYPainter
addPropertyChangeListener, firePropertyChangeEvent, firePropertyChangeEvent, getDisplayName, getGXYPainter, removePropertyChangeListener, setClassTraceOn, setDisplayName
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
-
TLcdGXYAISPointListPainter
public TLcdGXYAISPointListPainter()Constructs a newTLcdGXYAISPointListPainter
object.By default, pointLists will be drawn as polygons, unless they contain only one point. In the latter case, an instance of the
TLcdGXYAISIconProviderPainter
class will be used to draw an icon at the location of the single point.
-
-
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 classTLcdGXYPointListPainter
- Returns:
- a clone of this painter provider.
- See Also:
-
setObject
Specifies the object to be painted.The specified object should be an instance of an implementation of the
ILcdPointList
interface.- Specified by:
setObject
in interfaceILcdGXYEditor
- Specified by:
setObject
in interfaceILcdGXYPainter
- Overrides:
setObject
in classTLcdGXYPointListPainter
- Parameters:
aObject
- the object to be painted- See Also:
-
paint
Description copied from class:TLcdGXYPointListPainter
Displays the representation of the object in the given mode on the Graphics passed, taking into account the context passed.This implementation will use the specified render mode to determine how the object needs to be rendered. In
ILcdGXYPainter.TRANSLATING
mode, theILcdPointList
object is rendered as if all points were moved along the same distance in view coordinates as passed in the context. InILcdGXYPainter.RESHAPING
mode, the object is painted with one point moved as defined in the context. InILcdGXYPainter.CREATING
mode, the object is painted as if the current mouse position is the last point of theILcdPointList
. In the above render modes, the object is painted using the edit paint mode (ALcdGXYAreaPainter.getEditMode()
).In the render mode
ILcdGXYPainter.SELECTED
, the object is painted using the selection paint mode (ALcdGXYAreaPainter.getSelectionMode()
). In all other render modes, the paint mode (TLcdGXYPointListPainter.getMode()
) is used.Note: when the paint mode is set to
TLcdGXYPointListPainter.POINT
orTLcdGXYPointListPainter.POLYLINE
, the objects will be painted as, respectively points and polylines. The selectionMode and editMode property are not taken into account when finding the mode in which the object should be painted.- Specified by:
paint
in interfaceILcdGXYPainter
- Overrides:
paint
in classTLcdGXYPointListPainter
- 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.
-
isTouched
Description copied from class:TLcdGXYPointListPainter
Depending on the render mode and paint mode, returns whether one of the handles (the source point list), the painted point list or the interior of the point list is touched.This implementation will use the specified
paint mode
to determine how the object is represented. Depending on the representation of theILcdPointList
object, the object is touched when- the painted point list is touched,
- its interior space is touched when the paint mode is
TLcdGXYPointListPainter.FILLED
, - the source point list is touched when the render mode is
ILcdGXYPainter.SELECTED
.
The method
insidePolygon
determines whether the current mouse position is located inside theILcdPointList
object or not.It is not possible to derive from this method which part of the point list has been touched. To determine which part of the
ILcdPointList
object is touched, the methodsgetTouchedPoint
andgetTouchedSegment
will return the required information.- Specified by:
isTouched
in interfaceILcdGXYPainter
- Overrides:
isTouched
in classTLcdGXYPointListPainter
- Parameters:
aGraphics
- The graphics to paint the object on.aMode
- The mode to render the object in.aGXYContext
- The context in which the object is rendered.- Returns:
- whether one of the points, segments or the interior of the point list is touched.
- See Also:
-
boundsSFCT
public void boundsSFCT(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext, ILcd2DEditableBounds a2DEditableBounds) throws TLcdNoBoundsException Description copied from class:TLcdGXYPointListPainter
Sets the supplied bounds (in view coordinates, pixels) so that it encompasses the representation of the object in the given mode taking into account the given context.If this method returns without exception the bounds argument must encompass the representation of the object. A point outside the bounds will not be contained within the painted object.
The bounds returned in this method can be seen as the equivalent in the view space of the bounds in the model space for
ILcdBounded
objects.- Specified by:
boundsSFCT
in interfaceILcdGXYPainter
- Overrides:
boundsSFCT
in classTLcdGXYPointListPainter
- 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.a2DEditableBounds
- The bounds to update.- Throws:
TLcdNoBoundsException
- if no bounds can be determined for the representation of the object. This can happen when the object does not have a representation in the given context, for example when it is located in a part of the world which is not visible in the current view.- See Also:
-
supportSnap
Description copied from class:TLcdGXYPointListPainter
Supports snapping when the
ILcdPointList
object set to this painter contains at least one point.- Specified by:
supportSnap
in interfaceILcdGXYPainter
- Overrides:
supportSnap
in classTLcdGXYPointListPainter
- Parameters:
aGraphics
- the graphics on which is worked.aGXYContext
- the context of the snapping.- Returns:
true
if theILcdPointList
object contains at least one point,false
otherwise.
-
snapTarget
Description copied from class:TLcdGXYPointListPainter
Returns a point of the
ILcdPointList
object if the point is touched. If no point was touched,null
will be returned.- Specified by:
snapTarget
in interfaceILcdGXYPainter
- Overrides:
snapTarget
in classTLcdGXYPointListPainter
- Parameters:
aGraphics
- the graphics on which is worked.aGXYContext
- the context of the snapping.- Returns:
- a point of the
ILcdPointList
object if the point is touched,null
otherwise. - See Also:
-
getCursor
Description copied from class:TLcdGXYPointListPainter
Returns aCursor
that clarifies the render mode and context this painter is operating in. When no specificCursor
is required,null
is returned.- Specified by:
getCursor
in interfaceILcdGXYPainter
- Overrides:
getCursor
in classTLcdGXYPointListPainter
- Parameters:
aGraphics
- The graphics on which the object is painted.aMode
- The mode to render the object in.aGXYContext
- The context in which the object is rendered.- Returns:
- a cursor to indicate the type of operating mode and context. Returns
null
if no particular cursor is required.
-
getPointPainter
Returns the painter that will be used to paint pointLists consisting of only one point.This painter is able to paint instances of implementations of the
ILcdPoint
and theILcdShape
interface. It will paint an icon at the location of the point or at the location of the focus point of the shape.- Returns:
- the painter that will be used to paint pointLists consisting of only one point
-
setPointPainter
Specifies a painter that is able to paint instances of implementations of theILcdPoint
and theILcdShape
interface. It should paint an icon at the location of the point or at the location of the focus point of the shape.The given painter will be used to paint pointLists consisting of only one point.
- Parameters:
aPointPainter
- a painter that is able to paint an icon at the location of a point or at the location of the focus point of a shape
-