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
setPointPaintermethod can be used to define another painter, - the
getPointPaintermethod can be used to retrieve the default painter. TheTLcdGXYAISIconProviderPainterclass provides asetSymbolProvidermethod 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_CURVEFields inherited from class com.luciad.view.gxy.painter.ALcdGXYAreaPainter
OUTLINEDFields 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
ConstructorsConstructorDescriptionConstructs a newTLcdGXYAISPointListPainterobject. -
Method Summary
Modifier and TypeMethodDescriptionvoidboundsSFCT(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 aCursorthat 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.booleanisTouched(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.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.voidSpecifies the object to be painted.voidsetPointPainter(ILcdGXYPainter aPointPainter) Specifies a painter that is able to paint instances of implementations of theILcdPointand theILcdShapeinterface.snapTarget(Graphics aGraphics, ILcdGXYContext aGXYContext) Returns a point of theILcdPointListobject if the point is touched.booleansupportSnap(Graphics aGraphics, ILcdGXYContext aGXYContext) Supports snapping when theILcdPointListobject 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, translate2DPointMethods inherited from class com.luciad.view.gxy.painter.ALcdGXYAreaPainter
getEditMode, getFillStyle, getLineStyle, getSelectionMode, setEditMode, setFillStyle, setLineStyle, setSelectionModeMethods inherited from class com.luciad.view.gxy.ALcdGXYPainter
addPropertyChangeListener, firePropertyChangeEvent, firePropertyChangeEvent, getDisplayName, getGXYPainter, removePropertyChangeListener, setClassTraceOn, setDisplayNameMethods 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
-
TLcdGXYAISPointListPainter
public TLcdGXYAISPointListPainter()Constructs a newTLcdGXYAISPointListPainterobject.By default, pointLists will be drawn as polygons, unless they contain only one point. In the latter case, an instance of the
TLcdGXYAISIconProviderPainterclass will be used to draw an icon at the location of the single point.
-
-
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 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
ILcdPointListinterface.- Specified by:
setObjectin interfaceILcdGXYEditor- Specified by:
setObjectin interfaceILcdGXYPainter- Overrides:
setObjectin classTLcdGXYPointListPainter- Parameters:
aObject- the object to be painted- See Also:
-
paint
Description copied from class:TLcdGXYPointListPainterDisplays 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.TRANSLATINGmode, theILcdPointListobject is rendered as if all points were moved along the same distance in view coordinates as passed in the context. InILcdGXYPainter.RESHAPINGmode, the object is painted with one point moved as defined in the context. InILcdGXYPainter.CREATINGmode, 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.POINTorTLcdGXYPointListPainter.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:
paintin interfaceILcdGXYPainter- Overrides:
paintin 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:TLcdGXYPointListPainterDepending 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 modeto determine how the object is represented. Depending on the representation of theILcdPointListobject, 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
insidePolygondetermines whether the current mouse position is located inside theILcdPointListobject 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
ILcdPointListobject is touched, the methodsgetTouchedPointandgetTouchedSegmentwill return the required information.- Specified by:
isTouchedin interfaceILcdGXYPainter- Overrides:
isTouchedin 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:TLcdGXYPointListPainterSets 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
ILcdBoundedobjects.- Specified by:
boundsSFCTin interfaceILcdGXYPainter- Overrides:
boundsSFCTin 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:TLcdGXYPointListPainterSupports snapping when the
ILcdPointListobject set to this painter contains at least one point.- Specified by:
supportSnapin interfaceILcdGXYPainter- Overrides:
supportSnapin classTLcdGXYPointListPainter- Parameters:
aGraphics- the graphics on which is worked.aGXYContext- the context of the snapping.- Returns:
trueif theILcdPointListobject contains at least one point,falseotherwise.
-
snapTarget
Description copied from class:TLcdGXYPointListPainterReturns a point of the
ILcdPointListobject if the point is touched. If no point was touched,nullwill be returned.- Specified by:
snapTargetin interfaceILcdGXYPainter- Overrides:
snapTargetin classTLcdGXYPointListPainter- Parameters:
aGraphics- the graphics on which is worked.aGXYContext- the context of the snapping.- Returns:
- a point of the
ILcdPointListobject if the point is touched,nullotherwise. - See Also:
-
getCursor
Description copied from class:TLcdGXYPointListPainterReturns aCursorthat clarifies the render mode and context this painter is operating in. When no specificCursoris required,nullis returned.- Specified by:
getCursorin interfaceILcdGXYPainter- Overrides:
getCursorin 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
nullif 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
ILcdPointand theILcdShapeinterface. 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 theILcdPointand theILcdShapeinterface. 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
-