Class TLcdGXYEditableLabelPainter
- All Implemented Interfaces:
ILcdCloneable
,ILcdPropertyChangeSource
,ILcdGXYEditor
,ILcdGXYEditorProvider
,ILcdGXYLabelPainter
,ILcdGXYLabelPainterProvider
,ILcdGXYPainter
,ILcdGXYPainterProvider
,Serializable
,Cloneable
ILcdGXYLabelPainter
implementation that allows to edit the labels by
moving them around.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.luciad.view.gxy.painter.TLcdGXYIconPainter
TLcdGXYIconPainter.ScalingMode
-
Field Summary
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.ILcdGXYLabelPainter
DEFAULT, SELECTED
Fields inherited from interface com.luciad.view.gxy.ILcdGXYPainter
BODY, CREATING, DEFAULT, HANDLES, RESHAPING, SELECTED, SNAPS, TRANSLATING
-
Constructor Summary
ConstructorDescriptionDeprecated.TLcdGXYEditableLabelPainter
(TLcdGXYEditableLabelPainter aGXYEditableLabelPainter) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionvoid
anchorPointSFCT
(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext, Point aPointSFCT) Deprecated.ImplementsILcdGXYPainter.anchorPointSFCT
.void
boundsSFCT
(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext, ILcd2DEditableBounds aBoundsSFCT) Deprecated.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()
Deprecated.Creates and returns a copy of this object.boolean
edit
(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext) Deprecated.This implementation edits theILcdShape
object set to the painter.protected boolean
editLabel
(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext) Deprecated.Deprecated.getDeltaLabelLocation
(Object aObject) Deprecated.Returns the fixed distance in screen coordinates between the objects anchor point and the labels anchor point.final ILcdGXYEditor
getGXYEditor
(Object aObject) Deprecated.Returns this instance as editor for editing the specifiedObject
.final ILcdGXYLabelPainter
getGXYLabelPainter
(Object aObject) Deprecated.Finds anILcdGXYLabelPainter
that can be used to label the object passed.final ILcdGXYPainter
getGXYPainter
(Object aObject) Deprecated.Finds anILcdGXYPainter
that can be used to paint or locate the object passed.Deprecated.int
Deprecated.Delegates to to the inner label painter.int
getPossibleLocationCount
(Graphics aGraphics) Deprecated.Delegates to to the inner label painter.Deprecated.boolean
isFrame()
Deprecated.Labels can be drawn surrounded by a frame, the frame property determines whether to frame the labels.boolean
Deprecated.protected boolean
isLabelSensitive
(int aMode) Deprecated.This method returns whether the label is taken into account as a mouse- sensitive part of the object when touching the object in mode aMode.boolean
Deprecated.boolean
isTouched
(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext) Deprecated.Returns whether the mouse position in the given context is touching the painted icon.double
labelBoundsSFCT
(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext, Rectangle aRectangleSFCT) Deprecated.Delegates to to the inner label painter.void
paint
(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext) Deprecated.Displays the representation of the object in the given mode on the Graphics passed, taking into account the context passed.void
paintLabel
(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext) Deprecated.Delegates to to the inner label painter.protected void
paintPin
(Graphics aGraphics, int aMode, int aStartPointX, int aStartPointY, int aEndPointX, int aEndPointY) Deprecated.Draws the pin on the given graphics between the given lines.void
putBoundsToFollow
(Object aObject, Rectangle aBounds) Deprecated.void
putDeltaLabelLocation
(Object aObject, Dimension aDimension) Deprecated.Sets the fixed distance in screen coordinates between the objects anchor point and the labels anchor point.void
Deprecated.Clears the table indicating which labels absolute position cannot be changed.void
Deprecated.Clears the location table.void
removeBoundsToFollow
(Object aObject) Deprecated.void
removeDeltaLabelLocation
(Object aObject) Deprecated.Clears the distance in screens coordinates between the objects anchor point and the labels anchor point.protected String[]
retrieveLabels
(int aMode, ILcdGXYContext aGXYContext) Deprecated.Retrieves the labels to be painted for aObject.protected String[]
retrieveLabels
(ILcdGXYContext aGXYContext) Deprecated.replaced byretrieveLabels(int, ILcdGXYContext)
void
setForcePinOnNonDefaultLocation
(boolean aForcePinOnNonDefaultLocation) Deprecated.If set to true, this forces drawing of the pin when the label has been edited regardless of the value ofALcdGXYStampLabelPainter.isWithPin()
of the inner label painter.void
setFrame
(boolean aFrame) Deprecated.Labels can be drawn surrounded by a frame, the frame property determines whether to frame the labels.void
setIconSensitive
(boolean aIconSensitive) Deprecated.void
setLabelLocation
(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext) Deprecated.void
setLocationIndex
(int aLocationIndex) Deprecated.Delegates to the inner label painter.void
Deprecated.Sets the object to paint and edit.void
setSelectionBackground
(Color aSelectionBackground) Deprecated.Sets the background color of the label if isSelectionFilled().void
setSelectionFilled
(boolean aSelectionFilled) Deprecated.Sets whether the selected label should be filled.Methods inherited from class com.luciad.view.gxy.painter.TLcdGXYIconPainter
acceptSnapTarget, clearImageCache, clearImageCache, firePropertyChangeEvent, getCreationClickCount, getCursor, getHaloAlgorithm, getHaloColor, getHaloThickness, getIcon, getIcon, getIconProvider, getObject, getPaintCache, getScale, getScalingMode, getSelectionIcon, getSelectionIconProvider, getSnapIcon, isHaloEnabled, isUseImageCache, isUseOrientation, paintSnap, setHaloAlgorithm, setHaloColor, setHaloEnabled, setHaloThickness, setIcon, setIconProvider, setModelModelTransformationClass, setPaintCache, setScale, setScalingMode, setSelectionIcon, setSelectionIconProvider, setSnapIcon, setUseImageCache, setUseOrientation, snapTarget, supportSnap
Methods inherited from class com.luciad.view.gxy.ALcdGXYPainter
addPropertyChangeListener, 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
acceptSnapTarget, getCreationClickCount, getDisplayName, getObject
Methods inherited from interface com.luciad.view.gxy.ILcdGXYLabelPainter
getObject
Methods inherited from interface com.luciad.view.gxy.ILcdGXYPainter
getCursor, getDisplayName, getObject, snapTarget, supportSnap
Methods inherited from interface com.luciad.util.ILcdPropertyChangeSource
addPropertyChangeListener, removePropertyChangeListener
-
Constructor Details
-
TLcdGXYEditableLabelPainter
public TLcdGXYEditableLabelPainter()Deprecated. -
TLcdGXYEditableLabelPainter
Deprecated.
-
-
Method Details
-
getInnerLabelPainter
Deprecated. -
setForcePinOnNonDefaultLocation
public void setForcePinOnNonDefaultLocation(boolean aForcePinOnNonDefaultLocation) Deprecated.If set to true, this forces drawing of the pin when the label has been edited regardless of the value ofALcdGXYStampLabelPainter.isWithPin()
of the inner label painter. -
getBoundsToFollow
Deprecated. -
setObject
Deprecated.Description copied from class:TLcdGXYIconPainter
Sets the object to paint and edit. The object should be an instance of or
refer to
an instance ofILcdShape
for painting andILcd2DEditableShape
for 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
ILcdShape
and shall throw aClassCastException
if it does not.When this painter is used as editor with an object that does not implement the interface
ILcd2DEditableShape
, theedit
method shall throw the necessary exception.- Specified by:
setObject
in interfaceILcdGXYEditor
- Specified by:
setObject
in interfaceILcdGXYLabelPainter
- Specified by:
setObject
in interfaceILcdGXYPainter
- Overrides:
setObject
in classTLcdGXYIconPainter
- Parameters:
aObject
- The object to paint and edit.- See Also:
-
setIconSensitive
public void setIconSensitive(boolean aIconSensitive) Deprecated. -
isLabelSensitive
protected boolean isLabelSensitive(int aMode) Deprecated.This method returns whether the label is taken into account as a mouse- sensitive part of the object when touching the object in mode aMode. This default implementation always returns true. Overwrite this method if other behavior is desirable (e.g. only sensitive in selected mode).- Parameters:
aMode
- The painter or editor mode during the touch- Returns:
- true.
-
isIconSensitive
public boolean isIconSensitive()Deprecated. -
setFrame
public void setFrame(boolean aFrame) Deprecated.Labels can be drawn surrounded by a frame, the frame property determines whether to frame the labels. Sets the property frame tonewFrame
. -
isFrame
public boolean isFrame()Deprecated.Labels can be drawn surrounded by a frame, the frame property determines whether to frame the labels.- Returns:
true
if frame holdstrue
, elsefalse
is returned.
-
anchorPointSFCT
public void anchorPointSFCT(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext, Point aPointSFCT) throws TLcdNoBoundsException Deprecated.Description copied from class:ALcdGXYPainter
ImplementsILcdGXYPainter.anchorPointSFCT
.aPointSFCT
will be set to the center of the bounds calculated by boundsSFCT.- Specified by:
anchorPointSFCT
in interfaceILcdGXYPainter
- Overrides:
anchorPointSFCT
in classTLcdGXYIconPainter
- 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:
-
boundsSFCT
public void boundsSFCT(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext, ILcd2DEditableBounds aBoundsSFCT) throws TLcdNoBoundsException Deprecated.Description copied from class:TLcdGXYIconPainter
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 classTLcdGXYIconPainter
- 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.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:
-
isTouched
Deprecated.Description copied from class:TLcdGXYIconPainter
Returns whether the mouse position in the given context is touching the painted icon.
This implementation will use the method
TLcdGXYIconPainter.getIcon(int)
with the specified render mode to determine which icon needs to be touched.- Specified by:
isTouched
in interfaceILcdGXYPainter
- Overrides:
isTouched
in classTLcdGXYIconPainter
- 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 the focus point of the
ILcdShape
object is touched. - See Also:
-
setLocationIndex
public void setLocationIndex(int aLocationIndex) Deprecated.Delegates to the inner label painter.- Specified by:
setLocationIndex
in interfaceILcdGXYLabelPainter
- Parameters:
aLocationIndex
- the index of the location. Must be between 0 and getPossibleLocationCount() - 1.- See Also:
-
getLocationIndex
public int getLocationIndex()Deprecated.Delegates to to the inner label painter.- Specified by:
getLocationIndex
in interfaceILcdGXYLabelPainter
- Returns:
- the index of the position. Must be between 0 and getPossibleLocationCount() - 1.
- See Also:
-
getPossibleLocationCount
Deprecated.Delegates to to the inner label painter.- Specified by:
getPossibleLocationCount
in interfaceILcdGXYLabelPainter
- Parameters:
aGraphics
- the Graphics the label will be painted on.- Returns:
- the number of possible locations where this
ILcdGXYLabelPainter
can paint/draw the labels of the set Object. - See Also:
-
setSelectionFilled
public void setSelectionFilled(boolean aSelectionFilled) Deprecated.Sets whether the selected label should be filled. Takes only effect if the label is not filled by default. -
isSelectionFilled
public boolean isSelectionFilled()Deprecated.- See Also:
-
setSelectionBackground
Deprecated.Sets the background color of the label if isSelectionFilled(). Takes only effect if the label is not filled by default. -
getSelectionBackground
Deprecated.- See Also:
-
labelBoundsSFCT
public double labelBoundsSFCT(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext, Rectangle aRectangleSFCT) throws TLcdNoBoundsException Deprecated.Delegates to to the inner label painter.- Specified by:
labelBoundsSFCT
in interfaceILcdGXYLabelPainter
- Parameters:
aGraphics
- theaGraphics
to consider.aMode
- the representation mode of the label.aGXYContext
- theILcdGXYContext
the drawing depends on.aRectangleSFCT
- theRectangle
containing the bounds of the label in view / graphics coordinates as side effect.- Returns:
- the angle orientation of the rectangle around the labels in RADIANs, clockwise, 0 at 3 o'clock.
- Throws:
TLcdNoBoundsException
- if the Object doesn't have any valid bounds, e.g. if it is always invisible in the current projection.- See Also:
-
paint
Deprecated.Description copied from class:TLcdGXYIconPainter
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
TLcdGXYIconPainter.getIcon(int)
with the specified render mode to determine how the object needs to be rendered. InILcdGXYPainter.RESHAPING
andILcdGXYPainter.TRANSLATING
mode, theILcdShape
object 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:
paint
in interfaceILcdGXYPainter
- Overrides:
paint
in classTLcdGXYIconPainter
- 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.
-
edit
Deprecated.Description copied from class:TLcdGXYIconPainter
This implementation edits the
ILcdShape
object set to the painter. The object needs to implement the interfaceILcd2DEditableShape
otherwise aClassCastException
will be thrown.In
ILcdGXYEditor.START_CREATION
,ILcdGXYEditor.TRANSLATED
andILcdGXYEditor.RESHAPED
render mode, the focus point of theILcdShape
object 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:
edit
in interfaceILcdGXYEditor
- Overrides:
edit
in classTLcdGXYIconPainter
- Parameters:
aGraphics
- The graphics to edit the object on.aMode
- 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.
- See Also:
-
getGXYPainter
Deprecated.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.
-
getGXYEditor
Deprecated.Description copied from class:TLcdGXYIconPainter
Returns this instance as editor for editing the specifiedObject
. If thisObject
is not the same as theObject
set to this painter, theTLcdGXYIconPainter.setObject(Object)
method is called to update the object set to the painter.- Specified by:
getGXYEditor
in interfaceILcdGXYEditorProvider
- Overrides:
getGXYEditor
in classTLcdGXYIconPainter
- Parameters:
aObject
- the object to be edited.- Returns:
- this instance as editor for editing the specified
Object
.
-
getGXYLabelPainter
Deprecated.Description copied from interface:ILcdGXYLabelPainterProvider
Finds anILcdGXYLabelPainter
that can be used to label the object passed.The label painter provider is responsible for setting the object to the label painter before returning the label painter. An implementation should therefore have the following structure:
public ILcdGXYLabelPainter getGXYLabelPainter(Object aObject) { ILcdGXYLabelPainter labelPainter = ... // find the label painter for the object if (labelPainter != null) { labelPainter.setObject(aObject); } return labelPainter; }
- Specified by:
getGXYLabelPainter
in interfaceILcdGXYLabelPainterProvider
- Parameters:
aObject
- the object to find a label painter for- Returns:
- a label painter that can be used to label the object; or null if no label painter could be found for the given object, or the object could not be set on the retrieved label painter.
-
putBoundsToFollow
Deprecated. -
removeBoundsToFollow
Deprecated. -
retrieveLabels
Deprecated.Retrieves the labels to be painted for aObject. This method is called within the paintLabel method. By default, it returns an array of oneString
containingaObject.toString()
. Re-define this method in sub-classes for returning other labels. Never modify the content of the returned array. If it is not redefined it calls the methodretrieveLabels(ILcdGXYContext)
- Parameters:
aMode
- the label painting mode
-
retrieveLabels
Deprecated.replaced byretrieveLabels(int, ILcdGXYContext)
- See Also:
-
paintLabel
Deprecated.Delegates to to the inner label painter.- Specified by:
paintLabel
in interfaceILcdGXYLabelPainter
- Parameters:
aGraphics
- theGraphics
instance on which to paint.aMode
- a combination of ILcdGXYLabelPainter.DEFAULT and ILcdGXYLabelPainter.SELECTED.aGXYContext
- theILcdGXYContext
in which the label painting has to be performed.- See Also:
-
getDeltaLabelLocation
Deprecated.Returns the fixed distance in screen coordinates between the objects anchor point and the labels anchor point.- Parameters:
aObject
- the object to return the delta for.- Returns:
- the fixed distance in screen coordinates between the objects anchor point and the labels anchor point.
- See Also:
-
putDeltaLabelLocation
Deprecated.Sets the fixed distance in screen coordinates between the objects anchor point and the labels anchor point.- Parameters:
aObject
- the object to store the delta for.aDimension
- the delta for the label in screen coordinates. This is the vector between the objects anchor point and the labels anchor point. Once this is set, the location index of the inner label painter is ignored.- See Also:
-
removeDeltaLabelLocation
Deprecated.Clears the distance in screens coordinates between the objects anchor point and the labels anchor point. This means the location index will be taken into account to determine the location of the label on the view.- Parameters:
aObject
- the object to remove the delta for.- See Also:
-
paintPin
protected void paintPin(Graphics aGraphics, int aMode, int aStartPointX, int aStartPointY, int aEndPointX, int aEndPointY) Deprecated.Draws the pin on the given graphics between the given lines. Overwrite this method if you want to change the look of the pin, by manipulating the graphics passed.- Parameters:
aGraphics
- the graphics to paint the pin on.aMode
- the mode this objects label is painted in (e.g. ILcdGXYLabelPainter.SELECTED). This method is called by the inner label painter to paint a pin.aStartPointX
- the x coordinate of the start point of the pin.aStartPointY
- the y coordinate of the start point of the pin.aEndPointX
- the x coordinate of the end point of the pin.aEndPointY
- the y coordinate of the end point of the pin.
-
editLabel
Deprecated. -
setLabelLocation
Deprecated. -
removeAllDeltaLabelLocation
public void removeAllDeltaLabelLocation()Deprecated.Clears the location table. All labels will be painted at the location where they would have been painted before the label was dragged. -
removeAllBoundsToFollow
public void removeAllBoundsToFollow()Deprecated.Clears the table indicating which labels absolute position cannot be changed. -
clone
Deprecated.Description copied from class:TLcdGXYIconPainter
Creates and returns a copy of this object. Deep copies are made of fallback icons (TLcdGXYIconPainter.getIcon()
andTLcdGXYIconPainter.getSelectionIcon()
) and the snap icon but shallow copies are made of the icon providers.- Specified by:
clone
in interfaceILcdCloneable
- Specified by:
clone
in interfaceILcdGXYEditorProvider
- Specified by:
clone
in interfaceILcdGXYLabelPainter
- Specified by:
clone
in interfaceILcdGXYLabelPainterProvider
- Specified by:
clone
in interfaceILcdGXYPainterProvider
- Overrides:
clone
in classTLcdGXYIconPainter
- Returns:
- a clone of this instance.
- See Also:
-
ILcdGXYLabelEditor
. This interface has a much cleaner separation of concerns, and is independent of theILcdGXYPainter
used for the domain object.