Class TLcdSLDFeatureTypeStylePainter
- All Implemented Interfaces:
ILcdCloneable
,ILcdPropertyChangeSource
,ILcdGXYEditor
,ILcdGXYEditorProvider
,ILcdGXYLabelPainter
,ILcdGXYLabelPainter2
,ILcdGXYLabelPainterProvider
,ILcdGXYMultiLabelPainter
,ILcdGXYPainter
,ILcdGXYPainterProvider
,Serializable
,Cloneable
ALcdSLDFeatureTypeStylePainter
that
- checks whether the scale of the view it is painting is valid for the object set to it,
-
delegates to its rule painters for objects that are accepted by the rule painters for all of
its
ILcdGXYPainter
functionalities (paint, isTouched, boundsSFCT, ...), -
delegates to its rule painters for objects that are accepted by the rule painters for all of
its
ILcdGXYLabelPainter
functionalities (paintLabel, labelBoundsSFCT, ...).
- See Also:
-
Field Summary
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.ILcdGXYLabelPainter2
BODY, CREATING, HANDLES, RESHAPING, SNAPS, TRANSLATING
Fields inherited from interface com.luciad.view.gxy.ILcdGXYPainter
BODY, CREATING, DEFAULT, HANDLES, RESHAPING, SELECTED, SNAPS, TRANSLATING
-
Constructor Summary
ConstructorDescriptionTLcdSLDFeatureTypeStylePainter
(String aFeatureTypeName, ALcdSLDRulePainter[] aRulePainters) -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
Checks whether the feature type style in this painter should be applied to the given object.boolean
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
addPropertyChangeListener
(PropertyChangeListener aPropertyChangeListener) Feature type style painters do not support property change events.void
anchorPointSFCT
(Graphics aGraphics, int aPainterMode, ILcdGXYContext aGXYContext, Point aPoint) Delegates computation of the anchor point to the first of its rule painters that is valid in the given scale, accepts the object and does not throw a TLcdNoBoundsException.void
boundsSFCT
(Graphics aGraphics, int aPaintMode, ILcdGXYContext aGXYContext, ILcd2DEditableBounds a2DEditableBounds) Delegates computation of the bounds to all rule painters that accept the object and for the which the views scale is in range.clone()
Calls super.clone and makes a deep clone of the collection of rule painters.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.int
Returns the number user interactions required to complete the initialization of an object set to this editor.getCursor
(Graphics aGraphics, int aPainterMode, ILcdGXYContext aGXYContext) Feature type style painters do not provide cursors.Always returns "Feature Type Style Painter".getGXYEditor
(Object aObject) Always returns this as editor.getGXYLabelPainter
(Object aObject) Always returns this as label painter.getGXYPainter
(Object aObject) Always returns this as painter.int
getLabelCount
(Graphics aGraphics, ILcdGXYContext aGXYContext) Returns the number of labels for the object set to this label painter.getLabelCursor
(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext) Returns aCursor
to indicate the type of editingaMode
andaGXYContext
.int
Returns the index of the label that is currently painted or scheduled to paint.Returns theTLcdLabelLocation
that was previously set that contains the information on the whereabouts of the label.int
Retrieves a location index, based on the location indices of all the rules that could accept the object, regardless of the scale.Returns the object set to this painter.int
getPossibleLocationCount
(Graphics aGraphics) Returns the result of the multiplication of the possible location count for all applicable rules.int
getSubLabelCount
(int aLabelIndex) Return the number of sublabels in a label.int
Returns the index of the sublabel to paint.final boolean
Returns whether only the touched geometries objects should be edited or all of them.boolean
isLabelTouched
(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext) Tests if the label specified bysetObject
,setLabelIndex
andsetSubLabelIndex
is touched at view location(specified by aGXYContext.getX()
andaGXYContext.getY()
), considering the mode and theILcdGXYContext
instance.boolean
isScaleValid
(ILcdGXYView aView) Checks whether one of the rule painters accepts the scale in the view passed.boolean
isTouched
(Graphics aGraphics, int aPainterMode, ILcdGXYContext aGXYContext) Delegates to the rule painters which accept this object and for which the views scale is in range.void
labelAnchorPointSFCT
(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext, Point aPointSFCT) SetsaPointSFCT
to the anchor point of the label specified bysetObject
,setLabelIndex
andsetSubLabelIndex
.double
labelBoundsSFCT
(Graphics aGraphics, int aLabelPainterMode, ILcdGXYContext aGXYContext, Rectangle aRectangle) Delegates computation of the label bounds to the rule painters which accept the object set and for which the view in the context is in scale range.labelSnapTarget
(Graphics aGraphics, ILcdGXYContext aGXYContext) Returns anObject
that can be used as snapping target when graphically editing anotherObject
or label than the one this ILcdGXYLabelPainter2 represents.void
paint
(Graphics aGraphics, int aPainterMode, ILcdGXYContext aGXYContext) Delegates the painting to the rule painters that accept the object and for which the views scale is in range.void
paintLabel
(Graphics aGraphics, int aLabelPainterMode, ILcdGXYContext aGXYContext) Delegates the label painting to the rule painters that accept the object and for which the views scale is in range.void
removePropertyChangeListener
(PropertyChangeListener aPropertyChangeListener) Feature type style painters do not support property change events.final void
setEditTouchedOnly
(boolean aEditTouchedOnly) Determines whether only the geometries that touched are edited or whether all geometries should be edited.void
setLabelIndex
(int aLabelIndex) Sets the label.void
setLabelLocation
(TLcdLabelLocation aLabelLocation) Sets the label location of the label.void
setLocationIndex
(int aLocationIndex) Sets a location index to all rules which accept the object, regardless of the scale of the view.void
Sets the object to all of the rule painters that accept this object.void
setSubLabelIndex
(int aSubLabelIndex) Sets the sublabel index.snapTarget
(Graphics aGraphics, ILcdGXYContext aGXYContext) Delegates to the first rule painter which accepts the object, for which the view is in scale range and which returns a non null snap target.boolean
supportLabelSnap
(Graphics aGraphics, ILcdGXYContext aGXYContext) Returns whether this label painter supports snapping for the label specified bysetObject
,setLabelIndex
andsetSubLabelIndex
, considering the givenILcdGXYContext
instance.boolean
supportSnap
(Graphics aGraphics, ILcdGXYContext aGXYContext) Delegates to the rule painters which accept the object and for which the view is in scale range.Methods inherited from class com.luciad.ogc.sld.view.gxy.ALcdSLDFeatureTypeStylePainter
getFeatureTypeName, getRulePainter, getRulePainterCount
-
Constructor Details
-
TLcdSLDFeatureTypeStylePainter
-
-
Method Details
-
isScaleValid
Checks whether one of the rule painters accepts the scale in the view passed.- Parameters:
aView
- the view the scale is derived from.- Returns:
- true when one of the rule painters contained accepts the scale.
-
setObject
Sets the object to all of the rule painters that accept this object.- Specified by:
setObject
in interfaceILcdGXYEditor
- Specified by:
setObject
in interfaceILcdGXYLabelPainter
- Specified by:
setObject
in interfaceILcdGXYLabelPainter2
- Specified by:
setObject
in interfaceILcdGXYPainter
- Parameters:
aObject
- the object to be rendered.- See Also:
-
accept
Checks whether the feature type style in this painter should be applied to the given object. This implementation always returns true.- Specified by:
accept
in classALcdSLDFeatureTypeStylePainter
- Parameters:
aObject
- the object to check the feature type name for.- Returns:
- true. This implementation accepts all objects.
-
getObject
Returns the object set to this painter.- Specified by:
getObject
in interfaceILcdGXYEditor
- Specified by:
getObject
in interfaceILcdGXYLabelPainter
- Specified by:
getObject
in interfaceILcdGXYPainter
- Returns:
- the object set to this painter.
- See Also:
-
setEditTouchedOnly
public final void setEditTouchedOnly(boolean aEditTouchedOnly) Determines whether only the geometries that touched are edited or whether all geometries should be edited. By default, this property is set tofalse
.- Parameters:
aEditTouchedOnly
- a flag indicating whether only the touched geometries are edited or all geometries.- See Also:
-
isEditTouchedOnly
public final boolean isEditTouchedOnly()Returns whether only the touched geometries objects should be edited or all of them.- Returns:
- whether only the touched geometries should be edited or all of them.
- See Also:
-
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 representation of the object is paintedaMode
- indicates how the user interaction should be interpreted. Is one of the following:TRANSLATED
,RESHAPED
,START_CREATION
,CREATING
,END_CREATION
.
aGXYContext
- contains information on the user interaction and the transformations to transform from view space to the object model space.- Returns:
- true if the object has changed when this method returns, false otherwise.
- See Also:
-
getCreationClickCount
public int getCreationClickCount()Description copied from interface:ILcdGXYEditor
Returns the number user interactions required to complete the initialization of an object set to this editor. For example, for a circle this can be two: one to determine the center point of the circle and one to determine the radius of the circle. A negative number indicates that there is no upper limit to the number of user interactions. For example, for a polyline this could be -2: it requires a minimum of two clicks to establish a polyline, but there is no upper limit on the number of polyline points.- Specified by:
getCreationClickCount
in interfaceILcdGXYEditor
- Returns:
- the number of user interactions required to initialize the object set to this editor.
-
acceptSnapTarget
Description copied from interface:ILcdGXYEditor
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
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
.- Specified by:
acceptSnapTarget
in interfaceILcdGXYEditor
- Parameters:
aGraphics
- the Graphics on which the representation of the object is paintedaGXYContext
- the context containing the information on the user interaction and the snap target.- 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.
- See Also:
-
paint
Delegates the painting to the rule painters that accept the object and for which the views scale is in range.- Specified by:
paint
in interfaceILcdGXYPainter
- Parameters:
aGraphics
- the Graphics on which the representation of the object is paintedaPainterMode
- the mode the object is represented in (see class documentation).aGXYContext
- theILcdGXYContext
the drawing depends on.
-
boundsSFCT
public void boundsSFCT(Graphics aGraphics, int aPaintMode, ILcdGXYContext aGXYContext, ILcd2DEditableBounds a2DEditableBounds) throws TLcdNoBoundsException Delegates computation of the bounds to all rule painters that accept the object and for the which the views scale is in range. The result is the union of all the bounds computed by the above rule painters.- Specified by:
boundsSFCT
in interfaceILcdGXYPainter
- Parameters:
aGraphics
- the Graphics on which the representation of the object is paintedaPaintMode
- the mode the object is represented in (see class documentation). For example, an object may be represented differently in SELECTED mode compared to DEFAULT mode. The returned bounds of the representation must take this different representation into account.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.a2DEditableBounds
- the bounds that must be adapted to encompass the representation of the object in the given mode and context. These bounds must not be taken into account when the method has thrown an exception.- Throws:
TLcdNoBoundsException
- when no rule painter accepted this object and was in range or when the rule painters will render nothing for the given object.- See Also:
-
isTouched
Delegates to the rule painters which accept this object and for which the views scale is in range.- Specified by:
isTouched
in interfaceILcdGXYPainter
- Parameters:
aGraphics
- the Graphics on which the representation of the object is paintedaPainterMode
- the mode the object is represented inaGXYContext
- contains the location of the interaction and the transformations to convert this location into model coordinates- Returns:
- true if at least one of the rule painters above returns true, false otherwise.
- See Also:
-
anchorPointSFCT
public void anchorPointSFCT(Graphics aGraphics, int aPainterMode, ILcdGXYContext aGXYContext, Point aPoint) throws TLcdNoBoundsException Delegates computation of the anchor point to the first of its rule painters that is valid in the given scale, accepts the object and does not throw a TLcdNoBoundsException.- Specified by:
anchorPointSFCT
in interfaceILcdGXYPainter
- Parameters:
aGraphics
- the Graphics on which the representation of the object is paintedaPainterMode
- 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.aPoint
- 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
- when no rule painters are valid in the given context, or when all rule painters which are in scale throw a TLcdNoBoundsException.- See Also:
-
getDisplayName
Always returns "Feature Type Style Painter".- Specified by:
getDisplayName
in interfaceILcdGXYEditor
- Specified by:
getDisplayName
in interfaceILcdGXYLabelPainter2
- Specified by:
getDisplayName
in interfaceILcdGXYPainter
- Returns:
- "Feature Type Style Painter"
-
setLocationIndex
public void setLocationIndex(int aLocationIndex) Sets a location index to all rules which accept the object, regardless of the scale of the view. The location index per rule is computed based on the order of the rule and the possible location count of the rule.- Specified by:
setLocationIndex
in interfaceILcdGXYLabelPainter
- Parameters:
aLocationIndex
-- See Also:
-
getLocationIndex
public int getLocationIndex()Retrieves a location index, based on the location indices of all the rules that could accept the object, regardless of the scale.- Specified by:
getLocationIndex
in interfaceILcdGXYLabelPainter
- Returns:
- the location index based on the location index of the rules which accept the object, regardless of the scale.
- See Also:
-
paintLabel
Delegates the label painting to the rule painters that accept the object and for which the views scale is in range.- Specified by:
paintLabel
in interfaceILcdGXYLabelPainter
- Specified by:
paintLabel
in interfaceILcdGXYLabelPainter2
- Parameters:
aGraphics
- The graphics object to paint the label onaLabelPainterMode
- A bitwise combination ofaGXYContext
- the drawing context for the label- See Also:
-
getPossibleLocationCount
Returns the result of the multiplication of the possible location count for all applicable rules.- Specified by:
getPossibleLocationCount
in interfaceILcdGXYLabelPainter
- Parameters:
aGraphics
- the Graphics to render labels on.- Returns:
- the result of the multiplication of the possible location count for all applicable rules.
- See Also:
-
labelBoundsSFCT
public double labelBoundsSFCT(Graphics aGraphics, int aLabelPainterMode, ILcdGXYContext aGXYContext, Rectangle aRectangle) throws TLcdNoBoundsException Delegates computation of the label bounds to the rule painters which accept the object set and for which the view in the context is in scale range. The result is the union of all label bounds returned by the rule label painters taking into account the rotation. The rotation of the resulting bounds is 0. If there is only one applicable rule, the label bounds of that rule are returned, in which case the rotation might be different from 0.- Specified by:
labelBoundsSFCT
in interfaceILcdGXYLabelPainter
- Specified by:
labelBoundsSFCT
in interfaceILcdGXYLabelPainter2
- Parameters:
aGraphics
- the graphics the label will be rendered on.aLabelPainterMode
- the label painter mode, default or selected.aGXYContext
- the context in which the label should be rendered.aRectangle
- the rectangle to modify to store the result in.- Returns:
- the rotation that should be applied to the rectangle.
- Throws:
TLcdNoBoundsException
- when no rules apply, or when all rules that apply throw a TLcdNoBoundsException.- See Also:
-
getGXYLabelPainter
Always returns this as label painter.- Specified by:
getGXYLabelPainter
in interfaceILcdGXYLabelPainterProvider
- Parameters:
aObject
- the object to return a label painter for.- Returns:
- always itself.
-
supportSnap
Delegates to the rule painters which accept the object and for which the view is in scale range.- Specified by:
supportSnap
in interfaceILcdGXYPainter
- Parameters:
aGraphics
- the Graphics on which the representation of the object is paintedaGXYContext
- the context in which this object is represented and in which the editing of an object occurs.- Returns:
- true if at least one of the rule painters which accepts the object and for which the view is in scale range supports snapping. false otherwise.
-
snapTarget
Delegates to the first rule painter which accepts the object, for which the view is in scale range and which returns a non null snap target.- Specified by:
snapTarget
in interfaceILcdGXYPainter
- Parameters:
aGraphics
- the Graphics on which the representation of the object is paintedaGXYContext
- the context in which this object is represented and in which the editing of an object occurs.- Returns:
- the snap target of the first rule painter which accepts the object, for which the view is in scale range and which returns a non null snap target. Null if all rule painters for which the view is in scale range and which accept the object return null.
- See Also:
-
getCursor
Feature type style painters do not provide cursors.- Specified by:
getCursor
in interfaceILcdGXYPainter
- Parameters:
aGraphics
- the Graphics on which the representation of the object is paintedaPainterMode
- the rendering mode to return the cursor for.aGXYContext
- the context in which the rendering occurs.- Returns:
- always null.
-
addPropertyChangeListener
Feature type style painters do not support property change events.- Specified by:
addPropertyChangeListener
in interfaceILcdPropertyChangeSource
- Parameters:
aPropertyChangeListener
- is ignored.- See Also:
-
removePropertyChangeListener
Feature type style painters do not support property change events.- Specified by:
removePropertyChangeListener
in interfaceILcdPropertyChangeSource
- Parameters:
aPropertyChangeListener
- is ignored.- See Also:
-
getGXYPainter
Always returns this as painter.- Specified by:
getGXYPainter
in interfaceILcdGXYPainterProvider
- Parameters:
aObject
- the object to retrieve a painter for.- Returns:
- this.
-
getGXYEditor
Always returns this as editor.- Specified by:
getGXYEditor
in interfaceILcdGXYEditorProvider
- Parameters:
aObject
- the object to retrieve an editor for.- Returns:
- this
- Since:
- 2024.0
-
clone
Description copied from class:ALcdSLDFeatureTypeStylePainter
Calls super.clone and makes a deep clone of the collection of rule painters.- Specified by:
clone
in interfaceILcdCloneable
- Specified by:
clone
in interfaceILcdGXYEditorProvider
- Specified by:
clone
in interfaceILcdGXYLabelPainter
- Specified by:
clone
in interfaceILcdGXYLabelPainter2
- Specified by:
clone
in interfaceILcdGXYLabelPainterProvider
- Specified by:
clone
in interfaceILcdGXYPainterProvider
- Overrides:
clone
in classALcdSLDFeatureTypeStylePainter
- Returns:
- a clone of the current painter.
- See Also:
-
setLabelIndex
public void setLabelIndex(int aLabelIndex) Description copied from interface:ILcdGXYMultiLabelPainter
Sets the label. The results of any subsequent method calls to
ILcdGXYLabelPainter.paintLabel(java.awt.Graphics, int, com.luciad.view.gxy.ILcdGXYContext)
andILcdGXYLabelPainter.labelBoundsSFCT(java.awt.Graphics, int, com.luciad.view.gxy.ILcdGXYContext, java.awt.Rectangle)
etc. will apply to the label and sublabel indicated by this label index.- Specified by:
setLabelIndex
in interfaceILcdGXYMultiLabelPainter
- Parameters:
aLabelIndex
- The label index. This should be larger than or equal to0
and less than the resultILcdGXYMultiLabelPainter.getLabelCount(java.awt.Graphics, com.luciad.view.gxy.ILcdGXYContext)
.- See Also:
-
getLabelIndex
public int getLabelIndex()Description copied from interface:ILcdGXYMultiLabelPainter
Returns the index of the label that is currently painted or scheduled to paint.- Specified by:
getLabelIndex
in interfaceILcdGXYMultiLabelPainter
- Returns:
- the index of the label that is currently painted or scheduled to paint.
- See Also:
-
getLabelCount
Description copied from interface:ILcdGXYMultiLabelPainter
Returns the number of labels for the object set to this label painter.
Note: when returning multiple (moveable) labels for the same object, it might be useful to useTLcdGXYEditControllerModel2.EDIT_WHAT_FIRST_TOUCHED_LABEL
to avoid that a mouse drag moves them all together.- Specified by:
getLabelCount
in interfaceILcdGXYMultiLabelPainter
- Parameters:
aGraphics
- The Graphics currently painting onaGXYContext
- The ILcdGXYContext currently valid- Returns:
- The number of label for the given object.
-
getSubLabelIndex
public int getSubLabelIndex()Description copied from interface:ILcdGXYMultiLabelPainter
Returns the index of the sublabel to paint.- Specified by:
getSubLabelIndex
in interfaceILcdGXYMultiLabelPainter
- Returns:
- the index of the sublabel to paint.
- See Also:
-
setSubLabelIndex
public void setSubLabelIndex(int aSubLabelIndex) Description copied from interface:ILcdGXYMultiLabelPainter
Sets the sublabel index. The results of any subsequent method calls toILcdGXYLabelPainter.paintLabel(java.awt.Graphics, int, com.luciad.view.gxy.ILcdGXYContext)
andILcdGXYLabelPainter.labelBoundsSFCT(java.awt.Graphics, int, com.luciad.view.gxy.ILcdGXYContext, java.awt.Rectangle)
etc. will apply to the label and sublabel indicated by this sublabel index.- Specified by:
setSubLabelIndex
in interfaceILcdGXYMultiLabelPainter
- Parameters:
aSubLabelIndex
- The sub label index. This should be larger than or equal to0
and less than the resultILcdGXYMultiLabelPainter.getSubLabelCount(int)
.- See Also:
-
getSubLabelCount
public int getSubLabelCount(int aLabelIndex) Description copied from interface:ILcdGXYMultiLabelPainter
Return the number of sublabels in a label. The value should be 1 or higher.- Specified by:
getSubLabelCount
in interfaceILcdGXYMultiLabelPainter
- Parameters:
aLabelIndex
- the index of the label.- Returns:
- The number of sublabels of the label with the given index.
-
setLabelLocation
Description copied from interface:ILcdGXYLabelPainter2
Sets the label location of the label. This label location will be used to determine what the bounds of the label are, where it must be painted, etc.
Note that
aLabelLocation
also contains a label location index. This is independent of theILcdGXYLabelPainter.getLocationIndex()
of the super interface. Contrary to the location index returned bygetLocationIndex
, the location index inaLabelLocation
can be less than0
, in which case the labels are freely placed.This method has to be called after
ILcdGXYLabelPainter2.setObject(java.lang.Object)
has been called, as callingsetObject
clears this label location.- Specified by:
setLabelLocation
in interfaceILcdGXYLabelPainter2
- Parameters:
aLabelLocation
- TheTLcdLabelLocation
instance containing all the information about the location of the label.- See Also:
-
getLabelLocation
Description copied from interface:ILcdGXYLabelPainter2
Returns theTLcdLabelLocation
that was previously set that contains the information on the whereabouts of the label.- Specified by:
getLabelLocation
in interfaceILcdGXYLabelPainter2
- Returns:
- The label location that was previously set.
- See Also:
-
isLabelTouched
Description copied from interface:ILcdGXYLabelPainter2
Tests if the label specified bysetObject
,setLabelIndex
andsetSubLabelIndex
is touched at view location(specified by aGXYContext.getX()
andaGXYContext.getY()
), considering the mode and theILcdGXYContext
instance.Before calling this method, the domain object, the label index, the sublabel index and the location of the label should be set using the respective methods.
- Specified by:
isLabelTouched
in interfaceILcdGXYLabelPainter2
- Parameters:
aGraphics
- TheGraphics
instance on which the label is painted.aMode
- the mode to consider. This is a bitwise combinations of several constants. SeeILcdGXYLabelPainter2.paintLabel(java.awt.Graphics, int, com.luciad.view.gxy.ILcdGXYContext)
for more information.aGXYContext
- theILcdGXYContext
to consider.- Returns:
- true if the representation of the Object returned by getObject() is touched, false otherwise
- See Also:
-
labelAnchorPointSFCT
public void labelAnchorPointSFCT(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext, Point aPointSFCT) throws TLcdNoBoundsException Description copied from interface:ILcdGXYLabelPainter2
Sets
aPointSFCT
to the anchor point of the label specified bysetObject
,setLabelIndex
andsetSubLabelIndex
.If the location index is less than 0, the label anchor point is unambiguously determined by the
label location
. The actual label is to be painted somewhere around this anchor point. This method is typically called to compare the result with the label bounds, thus determining the exact relation between thelabel
and itslocation
.Before calling this method, the domain object, the label index, the sublabel index and the location of the label should be set using the respective methods.
- Specified by:
labelAnchorPointSFCT
in interfaceILcdGXYLabelPainter2
- Parameters:
aGraphics
- TheGraphics
instance on which the label is painted.aMode
- The mode to consider. This can be a bitwise combination of several constants. SeeILcdGXYLabelPainter2.paintLabel(java.awt.Graphics, int, com.luciad.view.gxy.ILcdGXYContext)
for more information.aGXYContext
- TheILcdGXYContext
that can be used to retrieve extra information.aPointSFCT
- The point which will be updated to reflect the location of the anchor point.- Throws:
TLcdNoBoundsException
- if the Object doesn't have any valid anchor point, e.g. if it is always invisible in the current projection.- See Also:
-
supportLabelSnap
Description copied from interface:ILcdGXYLabelPainter2
Returns whether this label painter supports snapping for the label specified by
setObject
,setLabelIndex
andsetSubLabelIndex
, considering the givenILcdGXYContext
instance. When the label painter supports snap for the specified label and context, it can return a snap target for this label and context.Before calling this method, the domain object, the label index, the sublabel index and the location of the label should be set using the respective methods.
- Specified by:
supportLabelSnap
in interfaceILcdGXYLabelPainter2
- Parameters:
aGraphics
- the Graphics on which is worked.aGXYContext
- the ILcdGXYContext of the snapping.- Returns:
true
if this label painter supports snapping for the specified label.- See Also:
-
labelSnapTarget
Description copied from interface:ILcdGXYLabelPainter2
Returns anObject
that can be used as snapping target when graphically editing anotherObject
or label than the one this ILcdGXYLabelPainter2 represents. The returnedObject
can be theObject
this ILcdGXYLabelPainter2 represents or any other (e.g. anILcdPoint
if getObject() is anILcdPointList
).- Specified by:
labelSnapTarget
in interfaceILcdGXYLabelPainter2
- Parameters:
aGraphics
- the Graphics on which is worked.aGXYContext
- the ILcdGXYContext of the snapping.- Returns:
- an
Object
that can be used as snapping target when graphically editing anotherObject
or label than the one this ILcdGXYLabelPainter2 represents (returned by getObject()). This object can benull
.
-
getLabelCursor
Description copied from interface:ILcdGXYLabelPainter2
Returns aCursor
to indicate the type of editingaMode
andaGXYContext
.- Specified by:
getLabelCursor
in interfaceILcdGXYLabelPainter2
- Parameters:
aGraphics
- TheGraphics
instance on which the label is painted.aMode
- The mode to consider. SeeILcdGXYLabelPainter2.paintLabel(java.awt.Graphics, int, ILcdGXYContext)
for more information.aGXYContext
- TheILcdGXYContext
containing extra information, such as the layer, the view and the mouse position.- Returns:
- a
Cursor
to indicate the type of editingaMode
andaGXYContext
. Returnsnull
if no particularCursor
is required.
-