Class TLcdGXYIconPainter
- All Implemented Interfaces:
ILcdCloneable,ILcdPropertyChangeSource,ILcdGXYEditor,ILcdGXYEditorProvider,ILcdGXYPainter,ILcdGXYPainterProvider,Serializable,Cloneable
- Direct Known Subclasses:
TLcdGXYAISIconProviderPainter,TLcdGXYEditableLabelPainter,TLcdVPFPointPainter
ILcdShape objects as points and enables visual editing of
ILcd2DEditableShape objects as points in an ILcdGXYView.
Painting an ILcdShape
Body
This painter paints ILcdShape objects by painting an ILcdIcon at the location of
the shapes focus point. Two icons are used, one to be used as default icon and one to be used when selected.
When the object is being edited, the selection icon is used. If the ILcdShape
implements ILcdOriented, the top of the icon can be
automatically rotated according to the orientation. If an icon implements
ILcdAnchoredIcon, the painter maps its anchor point on the object's focus point. If not, the center
of the icon is mapped to the object's focus point. In addition, the icon can be
automatically scaled.
The painter has the ability to add a halo effect around the painted icons. For a more detailed explanation
of halos, please refer to TLcdGXYHaloLabelPainter. The methods that control the appearance of the
halos are equivalent to those in TLcdGXYHaloLabelPainter.
It is possible to use an ILcdObjectIconProvider for the default icon and the selection icon with
setIconProvider(ILcdObjectIconProvider) and setSelectionIconProvider(ILcdObjectIconProvider).
If an icon provider is set, the icon getIcon() is used only as a fallback icon when the
icon provider cannot provide an icon for the current object. The method getIcon() always
returns the fallback icon, and this is not always the icon that will be painted.
For the selection icon, similar functionality and methods are used.
The method getIcon(int) returns the icon that will be actually painted for the given rendering mode,
so this method may also return the icon given by the icon provider for the current object.
Handles
The icon displayed acts as a handle. Since this is already painted in ILcdGXYPainter.BODY mode, no additional
handles are painted.
Snap targets
The focus point of the ILcdShape object can be returned on the condition that it is touched,
see isTouched. If the focus
point is defined as snap target, it will be highlighted with the snapIcon.
Styling options
The visualization of the ILcdShape object is governed by the icon and selection icon set to this painter.
Locating an ILcdShape in a view
Anchor point of an ILcdShape
The anchor point is located at the focus point of the ILcdShape object.
When is an ILcdShape touched
An ILcdShape object is touched when the mouse position is over the painted icon.
Visually editing and creating an ILcd2DEditableShape
Modifying an ILcd2DEditableShape
This editor will move the ILcd2DEditableShape in both RESHAPED and
TRANSLATED mode. The shape is moved to the location of the mouse pointer.
Creating an ILcd2DEditableShape
When initializing an ILcd2DEditableShape object via interaction through the view, the
ILcdShape object will be moved when calling edit with START_CREATION mode. The shape is moved to the location of the
mouse pointer. In CREATING or END_CREATION mode, the object
will not be updated.
Accepted snap targets
All points are accepted as snap target as long as:
- the point can be transformed to the reference of the
ILcdShapeobject with themodel to model transformation, - the point is not the focus point of the
ILcdShapeobject set to this painter.
Additional properties
Caching
This painter implementation may cache images of the icons used. Image caching can be turned on/off with the
setUseImageCache method.
Halo effect
The painter has the ability to add a halo effect around the painted icons. For a more detailed explanation
of halos, please refer to TLcdGXYHaloLabelPainter. The methods that control the appearance of the
halos are equivalent to those in TLcdGXYHaloLabelPainter.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumPossible icon scaling modes. -
Field Summary
Fields 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 defaultTLcdGXYIconPainterand sets the display name to "Point".TLcdGXYIconPainter(String aDisplayName) Constructs a defaultTLcdGXYIconPainterwith the given display name. -
Method Summary
Modifier and TypeMethodDescriptionbooleanacceptSnapTarget(Graphics aGraphics, ILcdGXYContext aGXYContext) Determines whether a snap target should be accepted or not.voidanchorPointSFCT(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext, Point aPointSFCT) ImplementsILcdGXYPainter.anchorPointSFCT.voidboundsSFCT(Graphics aGraphics, int aRenderMode, 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.voidClears the entire image cache.voidclearImageCache(Object aObject) Clears the icon image cache for the given object.clone()Creates and returns a copy of this object.booleanedit(Graphics aGraphics, int aRenderMode, ILcdGXYContext aGXYContext) This implementation edits theILcdShapeobject set to the painter.protected voidfirePropertyChangeEvent(PropertyChangeEvent aPropertyChangeEvent) Fires aPropertyChangeEventto all PropertyChangeListeners that have been registered to thisILcdGXYPainter.intReturns1as the number of required user interactions.getCursor(Graphics aGraphics, int aRenderMode, ILcdGXYContext aGXYContext) Returns a translationCursorwhen appropriate, ornullotherwise.getGXYEditor(Object aObject) Returns this instance as editor for editing the specifiedObject.Returns the algorithm that is used for rendering halo's.Returns the color of the halo effect.intReturns the thickness of the halo effect.getIcon()Returns theILcdIconused for painting in default mode.protected ILcdIcongetIcon(int aRenderMode) Returns the icon that needs to be painted for the specified rendering mode.Returns theILcdIconProviderused for painting in default mode.final ObjectReturns the object that can currently be painted or edited by this painter/editor.booleanReturns whether caching is used when painting this painter's object.doublegetScale()Returns the current size factor.Returns the current icon scaling mode.Returns theILcdIconused for painting in selected mode.Returns theILcdIconProviderused for painting in selected mode.Returns the icon that is used to paint snap target points of the object set to this painter.booleanReturns whether the painter will add a halo effect around the icons.booleanisTouched(Graphics aGraphics, int aRenderMode, ILcdGXYContext aGXYContext) Returns whether the mouse position in the given context is touching the painted icon.booleanReturnstruewhen icon halo image caching is enabled,falseotherwise.booleanReturns if the icon will be rotated when the painted object implementsILcdOriented.voidpaint(Graphics aGraphics, int aRenderMode, ILcdGXYContext aGXYContext) Displays the representation of the object in the given mode on the Graphics passed, taking into account the context passed.protected voidpaintSnap(Graphics aGraphics, int aRenderMode, ILcdGXYContext aGXYContext) Called when this painter needs to paint its object in the rendering modeILcdGXYPainter.SNAPS.voidsetHaloAlgorithm(TLcdHaloAlgorithm aHaloAlgorithm) Sets the algorithm to be used for rendering halo's.voidsetHaloColor(Color aHaloColor) Sets the color of the halo effect.voidsetHaloEnabled(boolean aHaloEnabled) Determines whether the painter will add a halo effect around the icons.voidsetHaloThickness(int aHaloThickness) Sets the thickness defined in pixels of the halo effect.voidSets theILcdIconused for painting in default mode.voidsetIconProvider(ILcdObjectIconProvider aIconProvider) Sets theILcdIconProviderused for painting in default mode.voidsetModelModelTransformationClass(Class aModel2ModelTransformationClass) Sets the transformation class that should be used when snapping to points that are defined in a different reference than the reference of this painter's object.voidSets the object to paint and edit.voidsetPaintCache(boolean aPaintCache) Turns caching of the object location on or off.voidsetScale(double aScale) Sets the new size factor for the icons.voidsetScalingMode(TLcdGXYIconPainter.ScalingMode aScalingMode) Sets the icon scaling mode, which determines how thesetScale(double)property is interpreted.voidsetSelectionIcon(ILcdIcon aSelectionIcon) Sets theILcdIconused for painting in selected mode.voidsetSelectionIconProvider(ILcdObjectIconProvider aSelectionIconProvider) Sets theILcdIconProviderused for painting in selected mode.voidsetSnapIcon(ILcdIcon aSnapIcon) Sets the icon that marks snap targets of the object currently set to this painter.voidsetUseImageCache(boolean aUseImageCache) Enables or disables the caching of icons with halo as images.voidsetUseOrientation(boolean aUseOrientation) Sets whether to paint a rotated icon when the painted object implementsILcdOriented.snapTarget(Graphics aGraphics, ILcdGXYContext aGXYContext) Returns the focus point of theILcdShapeobject if the point is touched.booleansupportSnap(Graphics aGraphics, ILcdGXYContext aGXYContext) Supports snapping when theILcdShapeobject set to this painter is visible in the view.Methods inherited from class com.luciad.view.gxy.ALcdGXYPainter
addPropertyChangeListener, firePropertyChangeEvent, getDisplayName, getGXYPainter, 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
-
TLcdGXYIconPainter
public TLcdGXYIconPainter()Constructs a defaultTLcdGXYIconPainterand sets the display name to "Point". -
TLcdGXYIconPainter
Constructs a defaultTLcdGXYIconPainterwith the given display name.- Parameters:
aDisplayName- The display name for this painter, used for textual representation of this painter.
-
-
Method Details
-
firePropertyChangeEvent
Fires aPropertyChangeEventto all PropertyChangeListeners that have been registered to thisILcdGXYPainter.This implementation will also clear the image cache when a property change event is fired.
- Overrides:
firePropertyChangeEventin classALcdGXYPainter- Parameters:
aPropertyChangeEvent- The PropertyChangeEvent object.
-
anchorPointSFCT
public void anchorPointSFCT(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext, Point aPointSFCT) throws TLcdNoBoundsException Description copied from class:ALcdGXYPainterImplementsILcdGXYPainter.anchorPointSFCT.aPointSFCTwill be set to the center of the bounds calculated by boundsSFCT.- Specified by:
anchorPointSFCTin interfaceILcdGXYPainter- Overrides:
anchorPointSFCTin classALcdGXYPainter- Parameters:
aGraphics- the Graphics on which the representation of the object is paintedaMode- the mode the object is painted in (see class documentation)aGXYContext- the context for which the representation of the object is painted. It contains amongst others the transformations from model to world and world to view.aPointSFCT- the point that has to be moved to the location of the anchor point of the representation of the object. This point must not be taken into account when the method has thrown a TLcdNoBoundsException.- Throws:
TLcdNoBoundsException- if no anchor point can be determined for the representation of the object. This can be 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 projection as set in the views world reference.- See Also:
-
setObject
Sets the object to paint and edit. The object should be an instance of or
refer toan instance ofILcdShapefor painting andILcd2DEditableShapefor editing.This painter/editor can be used to paint the object without using the edit functionality. This method shall therefore only check if the object implements
ILcdShapeand shall throw aClassCastExceptionif it does not.When this painter is used as editor with an object that does not implement the interface
ILcd2DEditableShape, theeditmethod shall throw the necessary exception.- Specified by:
setObjectin interfaceILcdGXYEditor- Specified by:
setObjectin interfaceILcdGXYPainter- Parameters:
aObject- The object to paint and edit.- Throws:
ClassCastException- when the object does not implementILcdShape.- See Also:
-
getObject
Returns the object that can currently be painted or edited by this painter/editor.- Specified by:
getObjectin interfaceILcdGXYEditor- Specified by:
getObjectin interfaceILcdGXYPainter- Returns:
- the object that can currently be painted or edited by this painter/editor.
- See Also:
-
setPaintCache
public void setPaintCache(boolean aPaintCache) Turns caching of the object location on or off. Caching greatly reduces the time to paint an object but requires more memory. The location can only be cached for objects which implementILcdCache. By default, caching is turned on.- Parameters:
aPaintCache- A flag indicating whether to use caching when painting an object.- See Also:
-
getPaintCache
public boolean getPaintCache()Returns whether caching is used when painting this painter's object.- Returns:
trueif caching is used to paint this painter's object,falseotherwise.- See Also:
-
setIcon
Sets theILcdIconused for painting in default mode. For painting, this is a fallback icon, it is only painted if there is no icon provider set or the icon provider can't provide an icon for the current object. When the given icon implements ILcdAnchoredIcon, the painter maps its anchor point on the object's focus point. If not, the center of the icon is mapped to the object's focus point.- Parameters:
aIcon- the icon to paint in default mode.- See Also:
-
getIcon
Returns theILcdIconused for painting in default mode. For painting, this is a fallback icon, it is only painted if there is no icon provider set or the icon provider can't provide an icon for the current object.- Returns:
- the
ILcdIconused for painting in default mode. - See Also:
-
setSelectionIcon
Sets theILcdIconused for painting in selected mode. For painting, this is a fallback icon, it is only painted if there is no selection icon provider set or the selection icon provider can't provide an icon for the current object. When the given icon implements ILcdAnchoredIcon, the painter maps its anchor point on the object's focus point. If not, the center of the icon is mapped to the object's focus point.- Parameters:
aSelectionIcon- theILcdIconused for painting in selected mode.- See Also:
-
getSelectionIcon
Returns theILcdIconused for painting in selected mode. For painting, this is a fallback icon, it is only painted if there is no selection icon provider set or the selection icon provider can't provide an icon for the current object.- Returns:
- the
ILcdIconused for painting in selected mode. - See Also:
-
setSnapIcon
Sets the icon that marks snap targets of the object currently set to this painter. This icon is painted when thepaintmethod is called with the render modeILcdGXYPainter.SNAPS. When the given icon implements ILcdAnchoredIcon, the painter maps its anchor point on the object's focus point. If not, the center of the icon is mapped to the object's focus point.- Parameters:
aSnapIcon- The icon that should be used to paint snap target points.- See Also:
-
getSnapIcon
Returns the icon that is used to paint snap target points of the object set to this painter.- Returns:
- the icon that is used to paint snap target points of the object set to this painter.
- See Also:
-
setIconProvider
Sets the
ILcdIconProviderused for painting in default mode.If an icon provider is set that can provide an icon for the object, it overrides the icon that is set with
setIcon(ILcdIcon)for painting.- Parameters:
aIconProvider- the icon provider to paint in default mode.- Since:
- 10.0
- See Also:
-
getIconProvider
Returns theILcdIconProviderused for painting in default mode.- Returns:
- the
ILcdIconProviderused for painting in default mode. - Since:
- 10.0
- See Also:
-
setSelectionIconProvider
Sets theILcdIconProviderused for painting in selected mode.If a selection icon provider is set that can provide an icon for the object, it overrides the icon that is set with
setSelectionIcon(ILcdIcon)for painting.- Parameters:
aSelectionIconProvider- theILcdIconProviderused for painting in selected mode.- Since:
- 10.0
- See Also:
-
getSelectionIconProvider
Returns theILcdIconProviderused for painting in selected mode.- Returns:
- the
ILcdIconProviderused for painting in selected mode. - Since:
- 10.0
- See Also:
-
isHaloEnabled
public boolean isHaloEnabled()Returns whether the painter will add a halo effect around the icons.- Returns:
- whether the painter will add a halo effect around the icons.
- See Also:
-
setHaloEnabled
public void setHaloEnabled(boolean aHaloEnabled) Determines whether the painter will add a halo effect around the icons. By default, this property is set tofalse.- Parameters:
aHaloEnabled- a flag indicating whether to add a halo effect around the icons.- See Also:
-
getHaloThickness
public int getHaloThickness()Returns the thickness of the halo effect.- Returns:
- the thickness of the halo effect.
- See Also:
-
setHaloThickness
public void setHaloThickness(int aHaloThickness) Sets the thickness defined in pixels of the halo effect. By default, this property is set to1.- Parameters:
aHaloThickness- the thickness defined in pixels of the halo effect.- See Also:
-
getHaloColor
Returns the color of the halo effect.- Returns:
- the color of the halo effect.
- See Also:
-
setHaloColor
Sets the color of the halo effect. By default, this property is set toColor.white.- Parameters:
aHaloColor- the color of the halo effect.- See Also:
-
setHaloAlgorithm
Sets the algorithm to be used for rendering halo's. The choice of the halo algorithm may have a major impact on the overall performance of this painter. SeeTLcdHaloAlgorithmfor more information on the available algorithms.- Parameters:
aHaloAlgorithm- the algorithm to be used for rendering halo's.- See Also:
-
getHaloAlgorithm
Returns the algorithm that is used for rendering halo's.- Returns:
- the algorithm that is used for rendering halo's.
- See Also:
-
isUseImageCache
public boolean isUseImageCache()Returnstruewhen icon halo image caching is enabled,falseotherwise.- Returns:
truewhen icon halo image caching is enabled,falseotherwise.
-
setUseImageCache
public void setUseImageCache(boolean aUseImageCache) Enables or disables the caching of icons with halo as images. By default, image caching is turned on. This setting does not have any effect if halo painting is disabled.- Parameters:
aUseImageCache- a flag indicating whether image caching should be enabled.- See Also:
-
clearImageCache
public void clearImageCache()Clears the entire image cache.
To remove a single item from the cache, use
clearImageCache(Object).- See Also:
-
clearImageCache
Clears the icon image cache for the given object. The next time this object is painted, a new image will be created and cached for it. To remove all cached images at once, useclearImageCache().- Parameters:
aObject- the object for which the cache to be cleared.- See Also:
-
paint
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 method
getIcon(int)with the specified render mode to determine how the object needs to be rendered. InILcdGXYPainter.RESHAPINGandILcdGXYPainter.TRANSLATINGmode, theILcdShapeobject is rendered as if the point was moved along the same distance in view coordinates as passed in the context.If the halo effect is enabled, a halo effect will be added around the icon. Note that the halo effect will only be added when the rendering mode does not contain the mode
SELECTED.- Specified by:
paintin interfaceILcdGXYPainter- Parameters:
aGraphics- The graphics to paint the object on.aRenderMode- The mode to render the object in.aGXYContext- The context to render the object in.
-
paintSnap
Called when this painter needs to paint its object in the rendering modeILcdGXYPainter.SNAPS.- Parameters:
aGraphics- The graphics to paint the object on.aRenderMode- The mode to render the object in,ILcdGXYPainter.SNAPSincluded.aGXYContext- The context to render the object in.
-
getScale
public double getScale()Returns the current size factor.- Returns:
- the current size factor
- See Also:
-
setScale
public void setScale(double aScale) Sets the new size factor for the icons. The interpretation of this value depends on the value ofgetScalingMode().- Parameters:
aScale- the new size factor- See Also:
-
getScalingMode
Returns the current icon scaling mode.- Returns:
- the current icon scaling mode
- See Also:
-
setScalingMode
Sets the icon scaling mode, which determines how thesetScale(double)property is interpreted.- Parameters:
aScalingMode- the new icon scaling mode- See Also:
-
isUseOrientation
public boolean isUseOrientation()Returns if the icon will be rotated when the painted object implementsILcdOriented.- Returns:
- true if the icon is rotated when the painted object implements
ILcdOriented, false if the icon is painted without applying rotation.
-
setUseOrientation
public void setUseOrientation(boolean aUseOrientation) Sets whether to paint a rotated icon when the painted object implementsILcdOriented.- Parameters:
aUseOrientation- if true, and if the painted object implementsILcdOriented, the icon is rotated so that the top of the original icon follows the orientation with respect to the north
-
getIcon
Returns the icon that needs to be painted for the specified rendering mode. This implementation will return the selection icon if the rendering mode contains
SELECTED. If the mode containsBODYorDEFAULT, the default icon is returned. The method returnsnullin all other cases.The default icon is the icon returned by
getIconProvider()if the icon provider is not null and the icon it returns for the current object is not null, otherwise it is the fallback icon, gotten withgetIcon()The selection icon is the icon returned by
*getSelectionIconProvider()if the icon provider is not null and the icon it returns for the current object is not null, otherwise it is the fallback selection icon, gotten withgetSelectionIcon()- Parameters:
aRenderMode- The mode to render the object in.- Returns:
- the default icon for painting, the selection icon for painting or
null. - See Also:
-
isTouched
Returns whether the mouse position in the given context is touching the painted icon.
This implementation will use the method
getIcon(int)with the specified render mode to determine which icon needs to be touched.- Specified by:
isTouchedin interfaceILcdGXYPainter- Parameters:
aGraphics- The graphics to paint the object on.aRenderMode- The mode to render the object in.aGXYContext- The context in which the object is rendered.- Returns:
- whether the focus point of the
ILcdShapeobject is touched. - See Also:
-
getCursor
Returns a translationCursorwhen appropriate, ornullotherwise.- Specified by:
getCursorin interfaceILcdGXYPainter- Overrides:
getCursorin classALcdGXYPainter- Parameters:
aGraphics- The graphics on which the object is painted.aRenderMode- 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.
-
boundsSFCT
public void boundsSFCT(Graphics aGraphics, int aRenderMode, ILcdGXYContext aGXYContext, ILcd2DEditableBounds aBoundsSFCT) throws TLcdNoBoundsException 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
ILcdBoundedobjects.- Specified by:
boundsSFCTin interfaceILcdGXYPainter- Parameters:
aGraphics- The graphics to paint the object on.aRenderMode- The mode to render the object in.aGXYContext- The context to render the object in.aBoundsSFCT- 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
Supports snapping when the
ILcdShapeobject set to this painter is visible in the view.- Specified by:
supportSnapin interfaceILcdGXYPainter- Overrides:
supportSnapin classALcdGXYPainter- Parameters:
aGraphics- the graphics on which is worked.aGXYContext- the context of the snapping.- Returns:
trueif theILcdShapeobject is visible in the view,falseotherwise.
-
snapTarget
Returns the focus point of the
ILcdShapeobject if the point is touched. If not,nullwill be returned.- Specified by:
snapTargetin interfaceILcdGXYPainter- Overrides:
snapTargetin classALcdGXYPainter- Parameters:
aGraphics- the graphics on which is worked.aGXYContext- the context of the snapping.- Returns:
- the focus point of the
ILcdShapeobject if the point is touched,nullotherwise. - See Also:
-
edit
This implementation edits the
ILcdShapeobject set to the painter. The object needs to implement the interfaceILcd2DEditableShapeotherwise aClassCastExceptionwill be thrown.In
ILcdGXYEditor.START_CREATION,ILcdGXYEditor.TRANSLATEDandILcdGXYEditor.RESHAPEDrender mode, the focus point of theILcdShapeobject is moved to the location beneath the mouse pointer.If, in all render modes, a snap target is found for the moved point, the snap target location is used for the moved point.
- Specified by:
editin interfaceILcdGXYEditor- Parameters:
aGraphics- The graphics to edit the object on.aRenderMode- The mode to render the object in.aGXYContext- The context to render the object in.- Returns:
- true if the object has changed when this method returns, false otherwise.
- Throws:
ClassCastException- if the painter's object does not implementILcd2DEditableShape.- See Also:
-
getCreationClickCount
public int getCreationClickCount()Returns1as the number of required user interactions.- Specified by:
getCreationClickCountin interfaceILcdGXYEditor- Returns:
1.
-
setModelModelTransformationClass
Sets the transformation class that should be used when snapping to points that are defined in a different reference than the reference of this painter's object. 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
TLcdGeoReference2GeoReferenceclass.This property allows the painter to snap to points defined in a different model reference.
Instances of this specified class should implement
ILcdModelModelTransformation, otherwise the snapping functionality to different model references will not work.- Parameters:
aModel2ModelTransformationClass- the transformation used as described above.
-
acceptSnapTarget
Determines whether a snap target should be accepted or not. A snap target is accepted if the following conditions are met:
- The current object is an
ILcd2DEditableShape. - The snap target is an
ILcdPointwhose 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 snap object is not the focus point of the current object. If this is wanted, override the function and return true if the snap object is the focus point.
- The current object is touched. This avoids that when multiple points are edited at once, they all snap to the same point. This would give the impression that the other points disappeared.
- Specified by:
acceptSnapTargetin 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:
trueif the above conditions are met,falseotherwise.- See Also:
- The current object is an
-
getGXYEditor
Returns this instance as editor for editing the specifiedObject. If thisObjectis not the same as theObjectset to this painter, thesetObject(Object)method is called to update the object set to the painter.- Specified by:
getGXYEditorin interfaceILcdGXYEditorProvider- Parameters:
aObject- the object to be edited.- Returns:
- this instance as editor for editing the specified
Object.
-
clone
Creates and returns a copy of this object. Deep copies are made of fallback icons (getIcon()andgetSelectionIcon()) and the snap icon but shallow copies are made of the icon providers.- Specified by:
clonein interfaceILcdCloneable- Specified by:
clonein interfaceILcdGXYEditorProvider- Specified by:
clonein interfaceILcdGXYPainterProvider- Overrides:
clonein classALcdGXYPainter- Returns:
- a clone of this instance.
- See Also:
-