Class TLcdGXYBufferPainter
- All Implemented Interfaces:
ILcdCloneable
,ILcdPropertyChangeSource
,ILcdGXYEditor
,ILcdGXYEditorProvider
,ILcdGXYPainter
,ILcdGXYPainterProvider
,Serializable
,Cloneable
TLcdLonLatBuffer
and
TLcdLonLatHeightBuffer
objects in an ILcdGXYView
.
We recommend using TLcdGXYGeoBufferPainter
instead, as it offers higher quality visualization and supports
the ILcdGeoBuffer
or ILcdVariableGeoBuffer
shapes as well.- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Deprecated.static final int
Draw the area defined by the buffer filled with the foreground color.static final int
Draw only the outline of the buffer.static final int
Draw the buffer as an outlined and filled area.static final int
Draw the buffer as an outlined and filled area where the outline is open at both ends.static final int
Draw the outline of the buffer which is open at both ends.static final int
Deprecated.useOUTLINED
insteadFields 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 TypeMethodDescriptionboolean
acceptSnapTarget
(Graphics aGraphics, ILcdGXYContext aGXYContext) Returns whether the object set to the editor can be edited so that (part of) the object snaps to the object passed as snap target in the context.void
boundsSFCT
(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext, ILcd2DEditableBounds aBoundsSFCT) 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.protected void
calculateBoundsSFCT
(int aMode, ILcdGXYContext aGXYContext, ILcd2DEditableBounds aBoundsSFCT) Computes the bounds of the current object of the paint as the bounds that holds all contour points which are visible in the given context.clone()
MakesObject.clone()
public.boolean
edit
(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext) Defines how an object shall be edited by this editor, taking into account the mode and the context passed.double
Returns the buffer width set for creation of a new buffer.int
Returns the number of points needed for creation of a new buffer.getCursor
(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext) ImplementsILcdGXYPainter.getCursor
.boolean
boolean
Deprecated.This property is not used.getGXYEditor
(Object aObject) This implementation always returns this instance as an editor, with the object passed set as object.int
Returns the minimum pixel distance the input device (a mouse, for example) must move before editing the shape.final Object
Returns the object set to paint or edit.boolean
Returns whether caching will be used when painting the buffer.Returns the icon to paint snap target points of the object set to this painter.boolean
Returns whether the axis should be painted.boolean
Returns whether the axis points should be painted.boolean
Returns whether the painter draws the axis points of the buffer when it is painted in selected mode.boolean
Returns whether the painter draws the axis of the buffer when it is painted in selected mode.boolean
Deprecated.This property is not used.boolean
Returns whether the painter allows snapping to the invisible points of the shape.boolean
isTouched
(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext) Depending on the painter mode, returns whether the current object of the painter is touched by the mouse in the given context.boolean
Deprecated.This method has been deprecated.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 supplied context.void
setCreationBufferWidth
(double aBufferWidth) Sets the width of the buffer to be set at creation time.void
setDrawAxis
(boolean aDrawAxis) drawAxis determines whether to paint the central axis when the object is not inILcdGXYPainter.SELECTED
mode.void
setDrawAxisPoints
(boolean aDrawAxisPoints) DrawAxisPoints determines whether to paint the central axis point when the object is not inILcdGXYPainter.SELECTED
mode.void
setDrawAxisPointsWhenSelected
(boolean aDrawAxisPointsWhenSelected) Sets whether the axis points of the buffer should be drawn when selected.void
setDrawAxisWhenSelected
(boolean aDrawAxisWhenSelected) Sets whether the axis of the buffer should be drawn when selected.void
setDrawIntersection
(boolean aDrawIntersection) Deprecated.This property is not used.void
setMinimumEditDelta
(int aDelta) Sets the minimum pixel distance the input device (a mouse, for example) must move before editing the shape.void
setMode
(int aMode) Sets the mode to decide how to paint an object: the outline (ALcdGXYAreaPainter.OUTLINED
), as a filled area (ALcdGXYAreaPainter.FILLED
), or as a filled and outlined area (ALcdGXYAreaPainter.OUTLINED_FILLED
).void
setModelModelTransformationClass
(Class aModel2ModelTransformationClass) Sets the transformation class to use to transform points when snapping to points in models with non equal model references.void
Sets the object to paint or edit with this painter/editor.void
setPaintCache
(boolean aPaintCache) The property paintCache determines whether the painter will cache the points it has drawn.void
setSelectionMode
(int aSelectionMode) Sets the selection mode to decide how to paint a selected object: the outline (ALcdGXYAreaPainter.OUTLINED
), as a filled area (ALcdGXYAreaPainter.FILLED
), or as a filled and outlined area (ALcdGXYAreaPainter.OUTLINED_FILLED
).void
setSnapIcon
(ILcdIcon aSnapIcon) Sets the icon to paint snap target points of the object set to this painter.void
setSnapToInvisiblePoints
(boolean aSnapToInvisiblePoints) Sets whether the other shapes can snap to invisible points of this shape.void
setTraceOn
(boolean aTraceOn) Deprecated.This method has been deprecated.protected void
setupGraphicsForFill
(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext) This method is called by thisILcdGXYPainter
just before drawing Fills on aGraphics.protected void
setupGraphicsForLine
(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext) This method is called by thisILcdGXYPainter
just before drawing lines on aGraphics.void
setWidthFormat
(Format aWidthFormat) Deprecated.This property is not used, because the width is not displayed when editing the buffer.snapTarget
(Graphics aGraphics, ILcdGXYContext aGXYContext) Returns one of the axis or contour points of the buffer if it is touched.boolean
supportSnap
(Graphics aGraphics, ILcdGXYContext aGXYContext) This implementation supports snapping.Methods inherited from class com.luciad.view.gxy.painter.ALcdGXYAreaPainter
getEditMode, getFillStyle, getLineStyle, getMode, getSelectionMode, setEditMode, setFillStyle, setLineStyle
Methods inherited from class com.luciad.view.gxy.ALcdGXYPainter
addPropertyChangeListener, anchorPointSFCT, 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
anchorPointSFCT, getDisplayName
Methods inherited from interface com.luciad.util.ILcdPropertyChangeSource
addPropertyChangeListener, removePropertyChangeListener
-
Field Details
-
OUTLINED
public static final int OUTLINEDDraw only the outline of the buffer.- Since:
- 1.4
- See Also:
-
FILLED
public static final int FILLEDDraw the area defined by the buffer filled with the foreground color.- Since:
- LuciadLightspeed1.4
- See Also:
-
OUTLINED_FILLED
public static final int OUTLINED_FILLEDDraw the buffer as an outlined and filled area.- See Also:
-
OUTLINED_OPEN
public static final int OUTLINED_OPENDraw the outline of the buffer which is open at both ends.- See Also:
-
OUTLINED_FILLED_OPEN
public static final int OUTLINED_FILLED_OPENDraw the buffer as an outlined and filled area where the outline is open at both ends.- See Also:
-
POLYGON
public static final int POLYGONDeprecated.useOUTLINED
insteadDraw only the outline of the buffer.- See Also:
-
AREA
public static final int AREADeprecated.useFILLED
insteadDraw the area defined by the buffer filled with the foreground color.- See Also:
-
-
Constructor Details
-
TLcdGXYBufferPainter
public TLcdGXYBufferPainter()Creates a new TLcdGXYBufferPainter.
-
-
Method Details
-
setTraceOn
public void setTraceOn(boolean aTraceOn) Deprecated.This method has been deprecated. It is recommended to use the standard Java logging framework directly.Enables tracing for this class instance. Calling this method with eithertrue
orfalse
as argument automatically turns off tracing for all other class instances for whichsetTraceOn
has not been called. If the argument isfalse
then only the informative, warning and error log messages are recorded.- Overrides:
setTraceOn
in classALcdGXYPainter
- Parameters:
aTraceOn
- if true then all log messages are recorded for this instance. If false, then only the informative, warning and error log messages are recorded.
-
isTraceOn
public boolean isTraceOn()Deprecated.This method has been deprecated. It is recommended to use the standard Java logging framework directly.Returnstrue
if tracing is enabled for this class.- Overrides:
isTraceOn
in classALcdGXYPainter
- Returns:
- true if tracing is enabled for this class, false otherwise.
-
setObject
Sets the object to paint or edit with this painter/editor.- Specified by:
setObject
in interfaceILcdGXYEditor
- Specified by:
setObject
in interfaceILcdGXYPainter
- Parameters:
aObject
- the object to paint or edit with this painter/editor.- See Also:
-
getObject
Returns the object set to paint or edit.- Specified by:
getObject
in interfaceILcdGXYEditor
- Specified by:
getObject
in interfaceILcdGXYPainter
- Returns:
- the object set to paint or edit.
- See Also:
-
setPaintCache
public void setPaintCache(boolean aPaintCache) The property paintCache determines whether the painter will cache the points it has drawn. When the object has to be repainted, the points that haven't been edited, can then be drawn more quickly.- Parameters:
aPaintCache
- the new PaintCache value.- See Also:
-
getPaintCache
public boolean getPaintCache()Returns whether caching will be used when painting the buffer.- Returns:
- true if caching will be used when painting the buffer.
- See Also:
-
setCreationBufferWidth
public void setCreationBufferWidth(double aBufferWidth) Sets the width of the buffer to be set at creation time. In case a negative value is specified the buffer width will be proportional to the length of the first buffer segment.- Parameters:
aBufferWidth
- the new CreationBufferWidth value.- See Also:
-
getCreationBufferWidth
public double getCreationBufferWidth()Returns the buffer width set for creation of a new buffer.- Returns:
- the buffer width set for creation of a new buffer.
- See Also:
-
setMode
public void setMode(int aMode) Description copied from class:ALcdGXYAreaPainter
Sets the mode to decide how to paint an object: the outline (ALcdGXYAreaPainter.OUTLINED
), as a filled area (ALcdGXYAreaPainter.FILLED
), or as a filled and outlined area (ALcdGXYAreaPainter.OUTLINED_FILLED
).- Overrides:
setMode
in classALcdGXYAreaPainter
- Parameters:
aMode
- The mode deciding how to paint an object.- See Also:
-
setSelectionMode
public void setSelectionMode(int aSelectionMode) Description copied from class:ALcdGXYAreaPainter
Sets the selection mode to decide how to paint a selected object: the outline (ALcdGXYAreaPainter.OUTLINED
), as a filled area (ALcdGXYAreaPainter.FILLED
), or as a filled and outlined area (ALcdGXYAreaPainter.OUTLINED_FILLED
).- Overrides:
setSelectionMode
in classALcdGXYAreaPainter
- Parameters:
aSelectionMode
- The mode deciding how to paint a selected object.- See Also:
-
setDrawIntersection
public void setDrawIntersection(boolean aDrawIntersection) Deprecated.This property is not used.Determines whether to paint the point on the central axis that is the closest to the point on the corridor at which the width of the corridor is made to change. Next to the axis point the width is then displayed. The default value is true.- Parameters:
aDrawIntersection
- true to paint the point on the central axis that is the closest to the point on the corridor at which the width of the corridor is made to change.- See Also:
-
isDrawIntersection
public boolean isDrawIntersection()Deprecated.This property is not used.Returns whether to paint the point on the central axis that is the closest to the point on the corridor at which the width of the corridor is made to change.- Returns:
- true to paint the point on the central axis that is the closest to the point on the corridor at which the width of the corridor is made to change.
- See Also:
-
getDrawIntersection
public boolean getDrawIntersection()Deprecated.This property is not used.- See Also:
-
setDrawAxis
public void setDrawAxis(boolean aDrawAxis) drawAxis determines whether to paint the central axis when the object is not inILcdGXYPainter.SELECTED
mode.- Parameters:
aDrawAxis
- true to paint the axis when painting the buffer.- See Also:
-
isDrawAxis
public boolean isDrawAxis()Returns whether the axis should be painted.- Returns:
- true to paint the axis.
- See Also:
-
getDrawAxis
public boolean getDrawAxis()- Returns:
- the return value of isDrawAxis.
-
setDrawAxisWhenSelected
public void setDrawAxisWhenSelected(boolean aDrawAxisWhenSelected) Sets whether the axis of the buffer should be drawn when selected.- Parameters:
aDrawAxisWhenSelected
- the new drawAxisWhenSelected property value.- See Also:
-
isDrawAxisWhenSelected
public boolean isDrawAxisWhenSelected()Returns whether the painter draws the axis of the buffer when it is painted in selected mode.- Returns:
- whether the painter draws the axis of the buffer when it is painted in selected mode.
- See Also:
-
setDrawAxisPoints
public void setDrawAxisPoints(boolean aDrawAxisPoints) DrawAxisPoints determines whether to paint the central axis point when the object is not inILcdGXYPainter.SELECTED
mode.- Parameters:
aDrawAxisPoints
- true to paint the axis points when painting the buffer.- See Also:
-
isDrawAxisPoints
public boolean isDrawAxisPoints()Returns whether the axis points should be painted.- Returns:
- true to paint the axis points.
- See Also:
-
setDrawAxisPointsWhenSelected
public void setDrawAxisPointsWhenSelected(boolean aDrawAxisPointsWhenSelected) Sets whether the axis points of the buffer should be drawn when selected.- Parameters:
aDrawAxisPointsWhenSelected
- the new drawAxisPointsWhenSelected property value.- See Also:
-
isDrawAxisPointsWhenSelected
public boolean isDrawAxisPointsWhenSelected()Returns whether the painter draws the axis points of the buffer when it is painted in selected mode.- Returns:
- whether the painter draws the axis points of the buffer when it is painted in selected mode.
- See Also:
-
setSnapToInvisiblePoints
public void setSnapToInvisiblePoints(boolean aSnapToInvisiblePoints) Sets whether the other shapes can snap to invisible points of this shape. For buffer, all axis points are invisible points if there are not drawn.- Parameters:
aSnapToInvisiblePoints
- the new snapToInvisiblePoints property value.- See Also:
-
isSnapToInvisiblePoints
public boolean isSnapToInvisiblePoints()Returns whether the painter allows snapping to the invisible points of the shape.- Returns:
- whether the painter allows snapping to the invisible points of the shape.
- See Also:
-
setWidthFormat
Deprecated.This property is not used, because the width is not displayed when editing the buffer.Controls how the width will be displayed when editing the buffer.- Parameters:
aWidthFormat
- formats a Double, the distance between the center axis and the contour, as a String containing information on the width of the buffer.
-
setSnapIcon
Sets the icon to paint snap target points of the object set to this painter.- Parameters:
aSnapIcon
- the icon to paint snap target points of the object set to this painter.- See Also:
-
getSnapIcon
Returns the icon to paint snap target points of the object set to this painter.- Returns:
- the icon to paint snap target points of the object set to this painter.
- See Also:
-
setMinimumEditDelta
public void setMinimumEditDelta(int aDelta) Sets the minimum pixel distance the input device (a mouse, for example) must move before editing the shape. A larger value ensures that the object easily "snaps" back in place, a small value allows fine editing.- Parameters:
aDelta
- the minimum pixel distance the input device should move in either the X or Y direction
-
getMinimumEditDelta
public int getMinimumEditDelta()Returns the minimum pixel distance the input device (a mouse, for example) must move before editing the shape. A larger value ensures that the object easily "snaps" back in place, a small value allows fine editing. The default value is 3 pixels.- Returns:
- the minimum pixel distance the input device should move in either the X or Y direction
-
getCursor
ImplementsILcdGXYPainter.getCursor
. A non-null cursor is returned only if aMode is equal toILcdGXYPainter.RESHAPING
orILcdGXYPainter.TRANSLATING
. The kind of cursor that is returned depends on location of the mouse: Cursor.CROSSHAIR_CURSOR, if the mouse pointer is positioned on an axis point. Cursor.MOVE_CURSOR, if the mouse pointer is positioned on an axis segment line. Either Cursor.N_RESIZE_CURSOR, Cursor.W_RESIZE_CURSOR , Cursor.NE_RESIZE_CURSOR or Cursor.NW_RESIZE_CURSOR, if the mouse pointer is positioned on a contour segment line. Which one is actually returned depends on the orientation of the contour segment line.- Specified by:
getCursor
in interfaceILcdGXYPainter
- Overrides:
getCursor
in classALcdGXYPainter
- Parameters:
aGraphics
- the Graphics to get the cursor on.aMode
- the painting mode for which to get the cursor.aGXYContext
- the context in which to get the cursor.- Returns:
- if the mode is equal to
ILcdGXYPainter.RESHAPING
orILcdGXYPainter.TRANSLATING
and:- Cursor.CROSSHAIR_CURSOR, if the mouse pointer is positioned on an axis point.
- Cursor.MOVE_CURSOR, if the mouse pointer is positioned on an axis segment line.
- Cursor.N_RESIZE_CURSOR, Cursor.W_RESIZE_CURSOR , Cursor.NE_RESIZE_CURSOR or Cursor.NW_RESIZE_CURSOR, if the mouse pointer is positioned on a contour segment line depending on the orientation of the contour segment line.
-
getGXYEditor
This implementation always returns this instance as an editor, with the object passed set as object.- Specified by:
getGXYEditor
in interfaceILcdGXYEditorProvider
- Parameters:
aObject
- the object to retrieve an editor for.- Returns:
- this.
-
isTouched
Depending on the painter mode, returns whether the current object of the painter is touched by the mouse in the given context.- Specified by:
isTouched
in interfaceILcdGXYPainter
- Parameters:
aGraphics
- the graphics to check on whether the object in this painter is touched.aMode
- the painting mode to check in whether this painters object is touched.aGXYContext
- the context to check in whether this painters object is touched.- Returns:
- returns true, depending on the mode of the painter (not aMode,
setMode(int)
) if- OUTLINED: the mouse is on a line segment of the axis or the contour of the buffer,
- OUTLINED_OPEN: the mouse is on a line segment of the axis or the contour of the buffer is touched, except for the line segments at the ends of the buffer,
- FILLED, OUTLINED_FILLED, OUTLINED_FILLED_OPEN: the mouse is over the interior of the buffer,
-
false otherwise.
- See Also:
-
getCreationClickCount
public int getCreationClickCount()Returns the number of points needed for creation of a new buffer. This implementation returns -2, meaning unlimited number of point for creation.- Specified by:
getCreationClickCount
in interfaceILcdGXYEditor
- Returns:
- -2, meaning unlimited number of point for creation, with a minimum of two.
-
paint
Description copied from interface:ILcdGXYPainter
Displays the representation of the object in the given mode on the Graphics passed, taking into account the supplied context.The visual representation of an object depends on the context. Depending on the context (e.g. is the location covered by the view), an object may or may not have a representation. The context contains:
- transformations which allow to compute the location in view space of points and bounds given in model, space
- a pen which can connect points with a line or create arcs around a point,
- the view for which the object's representation must be painted. This can be useful when the painted object depends on the scale of the view, or the presence of other layers in the view.
- the current location(s) of the mouse or input device and the last location(s) the mouse or input device was pressed.
The mode passed in this method indicates what part of the object must be painted, whether it should be painted as selected or not, and whether user interaction (via mouse movements) must be taken into account.
When the mode passed contains either TRANSLATING, RESHAPING or CREATING, this method is also responsible for interpreting interaction on the representation of an object and modifying the representation of the object accordingly. The painter is not responsible for modifying the object itself, this is done by a corresponding
ILcdGXYEditor
. Implementations ofILcdGXYPainter
andILcdGXYEditor
interfaces must be consistent for an object: the painter must display the result of the user interaction on the object, while the editor is responsible for modifying the object as a result of the user interaction. A good practice to ensure a consistent implementation is to implement both theILcdGXYPainter
andILcdGXYEditor
interfaces in a single class.When the mode passed includes SNAPS, the part of the representation which corresponds to the object returned as snap target by the method
snapTarget
must be painted in order to provide the user with a visual indication of the snap target.The Graphics passed in this method can be different from the Graphics returned by a view due to techniques such as double buffering (as applied in Swing). Basic drawing operations must always be performed on the Graphics passed as an argument in this method.
- Specified by:
paint
in interfaceILcdGXYPainter
- Parameters:
aGraphics
- the Graphics on which the representation of the object is paintedaMode
- the mode the object is represented in (see class documentation).aGXYContext
- theILcdGXYContext
the drawing depends on.
-
edit
Description copied from interface:ILcdGXYEditor
Defines how an object shall be edited by this editor, taking into account the mode and the context passed.The mode passed indicates how the interaction should be interpreted. It can be one of the following:
TRANSLATED
RESHAPED
START_CREATION
CREATING
END_CREATION
The first two modes designate that the object should be modified, the last three modes are passed when initializing an object. From an implementation point of view there is no difference between TRANSLATED and RESHAPED. These constants only differ in semantics. For
ILcdShape
objects TRANSLATED can be seen as the mode that will be passed when the shape as a whole is moved. RESHAPED is used more often for moving part of a shape.The context contains information on the user interaction at hand. The methods
getX
andgetY
contain the location(s) of the user interaction. The methodsgetDeltaX
andgetDeltaY
contain the distance(s) over which the user interaction is taking place. For example,getX
andgetY
may contain the current mouse location whilegetDeltaX
andgetDeltaY
contain the distance over which the mouse has been dragged. The editing behavior can take into account multiple locations, to respond to, for example, multi-touch input.When a snap target is accepted, the implementation of this method should take that fact into account when editing or initializing an object.
- Specified by:
edit
in interfaceILcdGXYEditor
- Parameters:
aGraphics
- the graphics on which the buffer is being edited. This might be of importance e.g. when a scale or a clip is set on the graphics.aMode
- the editing mode, it will contain either ILcdGXYEditor.TRANSLATING or ILcdGXYEditor.RESHAPINGaGXYContext
- the context in which the buffer will be edited. This contains the graphics on which the buffer is painted, the current and previous mouse position, model to world, world to view transformations and possible snap targets.- Returns:
- true if the buffer was actually changed.
- See Also:
-
boundsSFCT
public void boundsSFCT(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext, ILcd2DEditableBounds aBoundsSFCT) throws TLcdNoBoundsException Description copied from interface:ILcdGXYPainter
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
- Parameters:
aGraphics
-aMode
-aGXYContext
-aBoundsSFCT
-- Throws:
TLcdNoBoundsException
- See Also:
-
supportSnap
This implementation supports snapping.- Specified by:
supportSnap
in interfaceILcdGXYPainter
- Overrides:
supportSnap
in classALcdGXYPainter
- Parameters:
aGraphics
- the Graphics on which the painter supports snap.aGXYContext
- the context in which the painter supports snap.- Returns:
- true
-
snapTarget
Returns one of the axis or contour points of the buffer if it is touched. An axis points is only returned if the axis point is drawn (seeisDrawAxisPoints()
andisDrawAxis()
) or when snapping to invisible points is enabled (seeisSnapToInvisiblePoints()
).- Specified by:
snapTarget
in interfaceILcdGXYPainter
- Overrides:
snapTarget
in classALcdGXYPainter
- Parameters:
aGraphics
- the Graphics on which the snap target is given.aGXYContext
- the context in which the snap target is given.- Returns:
- the snappable
ILcdPoint
that is touched, otherwise null. - See Also:
-
setModelModelTransformationClass
Sets the transformation class to use to transform points when snapping to points in models with non equal model references. The transformation will be instantiated and setup to transform points from the model of the snap layer to points in the model which contains the current object of this painter. The default value is the TLcdGeoReference2GeoReference class.Setting this property allows to snap to points defined in a different model reference.
- Parameters:
aModel2ModelTransformationClass
- the transformation to use as described above. Instances of this class should implementILcdModelModelTransformation
-
acceptSnapTarget
Returns whether the object set to the editor can be edited so that (part of) the object snaps to the object passed as snap target in the context. If the snap target is accepted, a call to theedit
method with this context passed should edit the object so that (part of) the object snaps to the object passed as snap target in the context.The context contains information on the user interaction at hand: the current location of the user interaction, given by its
This editor can snap the current buffer to the given snap target if the following conditions are met:X
andY
coordinates, and thedistance in X direction
anddistance in Y direction
over which the user interaction is taking place. For example,getX
andgetY
may contain the current mouse location whilegetDeltaX
andgetDeltaY
contain the distance over which the mouse has been dragged. The context also contains the candidatesnap target
and thelayer the snap target is contained in
.- The snap target is an
ILcdPoint
whose coordinates are expressed in the same coordinate system as the current objects coordinate system or the model to model transformation can transform the point to a point in the objects coordinate system. - The axis doesn't contain any points or one of its axis points is touched. The axis points can be
touched if they are painted (see
isDrawAxisPoints()
orisDrawAxisPointsWhenSelected()
) or when the axis itself is drawn (seeisDrawAxis()
orisDrawAxisWhenSelected()
)
- Specified by:
acceptSnapTarget
in interfaceILcdGXYEditor
- Parameters:
aGraphics
- the Graphics on which the snap target should be checked.aGXYContext
- the context in which the snap target should be checked.- Returns:
- true if the above conditions are met, false otherwise.
- See Also:
- The snap target is an
-
setupGraphicsForLine
This method is called by thisILcdGXYPainter
just before drawing lines on aGraphics. It can be redefined in order to set specific Graphics properties like Color, etc ... It calls getLineStyle().setupGraphics if such method returns a non null value.- Parameters:
aGraphics
- the graphics to paint the object on.aMode
- the mode to paint the object in.aGXYContext
- the context to paint the object in.
-
setupGraphicsForFill
This method is called by thisILcdGXYPainter
just before drawing Fills on aGraphics. It can be redefined in order to set specific Graphics properties like Color, etc ... It calls getFillStyle().setupGraphics if such method returns a non null value.- Parameters:
aGraphics
- the graphics to paint the object on.aMode
- the mode to paint the object in.aGXYContext
- the context to paint the object in.
-
calculateBoundsSFCT
protected void calculateBoundsSFCT(int aMode, ILcdGXYContext aGXYContext, ILcd2DEditableBounds aBoundsSFCT) throws TLcdNoBoundsException Computes the bounds of the current object of the paint as the bounds that holds all contour points which are visible in the given context.- Parameters:
aMode
- the painting mode to calculate the bounds in.aGXYContext
- the context in which to calculate the boundsaBoundsSFCT
- the bounds to adapt to the bounds of the object of this painter.- Throws:
TLcdNoBoundsException
- if the axis of the buffer contains less than 2 points or if no points of the buffer are visible in the given context.
-
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 classALcdGXYAreaPainter
- Returns:
- a clone of this painter provider.
- See Also:
-
FILLED
instead