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
ILcdGXYPainterfunctionalities (paint, isTouched, boundsSFCT, ...), -
delegates to its rule painters for objects that are accepted by the rule painters for all of
its
ILcdGXYLabelPainterfunctionalities (paintLabel, labelBoundsSFCT, ...).
- See Also:
-
Field Summary
Fields inherited from interface com.luciad.view.gxy.ILcdGXYEditor
CREATING, END_CREATION, RESHAPED, START_CREATION, TRANSLATEDFields inherited from interface com.luciad.view.gxy.ILcdGXYLabelPainter
DEFAULT, SELECTEDFields inherited from interface com.luciad.view.gxy.ILcdGXYLabelPainter2
BODY, CREATING, HANDLES, RESHAPING, SNAPS, TRANSLATINGFields inherited from interface com.luciad.view.gxy.ILcdGXYPainter
BODY, CREATING, DEFAULT, HANDLES, RESHAPING, SELECTED, SNAPS, TRANSLATING -
Constructor Summary
ConstructorsConstructorDescriptionTLcdSLDFeatureTypeStylePainter(String aFeatureTypeName, ALcdSLDRulePainter[] aRulePainters) -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanChecks whether the feature type style in this painter should be applied to the given object.booleanacceptSnapTarget(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.voidaddPropertyChangeListener(PropertyChangeListener aPropertyChangeListener) Feature type style painters do not support property change events.voidanchorPointSFCT(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.voidboundsSFCT(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.booleanedit(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.intReturns 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.intgetLabelCount(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 aCursorto indicate the type of editingaModeandaGXYContext.intReturns the index of the label that is currently painted or scheduled to paint.Returns theTLcdLabelLocationthat was previously set that contains the information on the whereabouts of the label.intRetrieves 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.intgetPossibleLocationCount(Graphics aGraphics) Returns the result of the multiplication of the possible location count for all applicable rules.intgetSubLabelCount(int aLabelIndex) Return the number of sublabels in a label.intReturns the index of the sublabel to paint.final booleanReturns whether only the touched geometries objects should be edited or all of them.booleanisLabelTouched(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext) Tests if the label specified bysetObject,setLabelIndexandsetSubLabelIndexis touched at view location(specified by aGXYContext.getX()andaGXYContext.getY()), considering the mode and theILcdGXYContextinstance.booleanisScaleValid(ILcdGXYView aView) Checks whether one of the rule painters accepts the scale in the view passed.booleanisTouched(Graphics aGraphics, int aPainterMode, ILcdGXYContext aGXYContext) Delegates to the rule painters which accept this object and for which the views scale is in range.voidlabelAnchorPointSFCT(Graphics aGraphics, int aMode, ILcdGXYContext aGXYContext, Point aPointSFCT) SetsaPointSFCTto the anchor point of the label specified bysetObject,setLabelIndexandsetSubLabelIndex.doublelabelBoundsSFCT(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 anObjectthat can be used as snapping target when graphically editing anotherObjector label than the one this ILcdGXYLabelPainter2 represents.voidpaint(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.voidpaintLabel(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.voidremovePropertyChangeListener(PropertyChangeListener aPropertyChangeListener) Feature type style painters do not support property change events.final voidsetEditTouchedOnly(boolean aEditTouchedOnly) Determines whether only the geometries that touched are edited or whether all geometries should be edited.voidsetLabelIndex(int aLabelIndex) Sets the label.voidsetLabelLocation(TLcdLabelLocation aLabelLocation) Sets the label location of the label.voidsetLocationIndex(int aLocationIndex) Sets a location index to all rules which accept the object, regardless of the scale of the view.voidSets the object to all of the rule painters that accept this object.voidsetSubLabelIndex(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.booleansupportLabelSnap(Graphics aGraphics, ILcdGXYContext aGXYContext) Returns whether this label painter supports snapping for the label specified bysetObject,setLabelIndexandsetSubLabelIndex, considering the givenILcdGXYContextinstance.booleansupportSnap(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:
setObjectin interfaceILcdGXYEditor- Specified by:
setObjectin interfaceILcdGXYLabelPainter- Specified by:
setObjectin interfaceILcdGXYLabelPainter2- Specified by:
setObjectin 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:
acceptin 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:
getObjectin interfaceILcdGXYEditor- Specified by:
getObjectin interfaceILcdGXYLabelPainter- Specified by:
getObjectin 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:ILcdGXYEditorDefines 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:
TRANSLATEDRESHAPED
START_CREATIONCREATINGEND_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
ILcdShapeobjects 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
getXandgetYcontain the location(s) of the user interaction. The methodsgetDeltaXandgetDeltaYcontain the distance(s) over which the user interaction is taking place. For example,getXandgetYmay contain the current mouse location whilegetDeltaXandgetDeltaYcontain 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:
editin 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:ILcdGXYEditorReturns 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:
getCreationClickCountin interfaceILcdGXYEditor- Returns:
- the number of user interactions required to initialize the object set to this editor.
-
acceptSnapTarget
Description copied from interface:ILcdGXYEditorReturns 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 theeditmethod 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
XandYcoordinates, and thedistance in X directionanddistance in Y directionover which the user interaction is taking place. For example,getXandgetYmay contain the current mouse location whilegetDeltaXandgetDeltaYcontain the distance over which the mouse has been dragged. The context also contains the candidatesnap targetand thelayer the snap target is contained in.- Specified by:
acceptSnapTargetin 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:
paintin 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- theILcdGXYContextthe 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:
boundsSFCTin 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:
isTouchedin 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:
anchorPointSFCTin 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:
getDisplayNamein interfaceILcdGXYEditor- Specified by:
getDisplayNamein interfaceILcdGXYLabelPainter2- Specified by:
getDisplayNamein 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:
setLocationIndexin 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:
getLocationIndexin 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:
paintLabelin interfaceILcdGXYLabelPainter- Specified by:
paintLabelin 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:
getPossibleLocationCountin 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:
labelBoundsSFCTin interfaceILcdGXYLabelPainter- Specified by:
labelBoundsSFCTin 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:
getGXYLabelPainterin 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:
supportSnapin 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:
snapTargetin 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:
getCursorin 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:
addPropertyChangeListenerin interfaceILcdPropertyChangeSource- Parameters:
aPropertyChangeListener- is ignored.- See Also:
-
removePropertyChangeListener
Feature type style painters do not support property change events.- Specified by:
removePropertyChangeListenerin interfaceILcdPropertyChangeSource- Parameters:
aPropertyChangeListener- is ignored.- See Also:
-
getGXYPainter
Always returns this as painter.- Specified by:
getGXYPainterin interfaceILcdGXYPainterProvider- Parameters:
aObject- the object to retrieve a painter for.- Returns:
- this.
-
getGXYEditor
Always returns this as editor.- Specified by:
getGXYEditorin interfaceILcdGXYEditorProvider- Parameters:
aObject- the object to retrieve an editor for.- Returns:
- this
- Since:
- 2024.0
-
clone
Description copied from class:ALcdSLDFeatureTypeStylePainterCalls super.clone and makes a deep clone of the collection of rule painters.- Specified by:
clonein interfaceILcdCloneable- Specified by:
clonein interfaceILcdGXYEditorProvider- Specified by:
clonein interfaceILcdGXYLabelPainter- Specified by:
clonein interfaceILcdGXYLabelPainter2- Specified by:
clonein interfaceILcdGXYLabelPainterProvider- Specified by:
clonein interfaceILcdGXYPainterProvider- Overrides:
clonein classALcdSLDFeatureTypeStylePainter- Returns:
- a clone of the current painter.
- See Also:
-
setLabelIndex
public void setLabelIndex(int aLabelIndex) Description copied from interface:ILcdGXYMultiLabelPainterSets 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:
setLabelIndexin interfaceILcdGXYMultiLabelPainter- Parameters:
aLabelIndex- The label index. This should be larger than or equal to0and less than the resultILcdGXYMultiLabelPainter.getLabelCount(java.awt.Graphics, com.luciad.view.gxy.ILcdGXYContext).- See Also:
-
getLabelIndex
public int getLabelIndex()Description copied from interface:ILcdGXYMultiLabelPainterReturns the index of the label that is currently painted or scheduled to paint.- Specified by:
getLabelIndexin interfaceILcdGXYMultiLabelPainter- Returns:
- the index of the label that is currently painted or scheduled to paint.
- See Also:
-
getLabelCount
Description copied from interface:ILcdGXYMultiLabelPainterReturns 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_LABELto avoid that a mouse drag moves them all together.- Specified by:
getLabelCountin 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:ILcdGXYMultiLabelPainterReturns the index of the sublabel to paint.- Specified by:
getSubLabelIndexin interfaceILcdGXYMultiLabelPainter- Returns:
- the index of the sublabel to paint.
- See Also:
-
setSubLabelIndex
public void setSubLabelIndex(int aSubLabelIndex) Description copied from interface:ILcdGXYMultiLabelPainterSets 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:
setSubLabelIndexin interfaceILcdGXYMultiLabelPainter- Parameters:
aSubLabelIndex- The sub label index. This should be larger than or equal to0and less than the resultILcdGXYMultiLabelPainter.getSubLabelCount(int).- See Also:
-
getSubLabelCount
public int getSubLabelCount(int aLabelIndex) Description copied from interface:ILcdGXYMultiLabelPainterReturn the number of sublabels in a label. The value should be 1 or higher.- Specified by:
getSubLabelCountin 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:ILcdGXYLabelPainter2Sets 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
aLabelLocationalso 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 inaLabelLocationcan 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 callingsetObjectclears this label location.- Specified by:
setLabelLocationin interfaceILcdGXYLabelPainter2- Parameters:
aLabelLocation- TheTLcdLabelLocationinstance containing all the information about the location of the label.- See Also:
-
getLabelLocation
Description copied from interface:ILcdGXYLabelPainter2Returns theTLcdLabelLocationthat was previously set that contains the information on the whereabouts of the label.- Specified by:
getLabelLocationin interfaceILcdGXYLabelPainter2- Returns:
- The label location that was previously set.
- See Also:
-
isLabelTouched
Description copied from interface:ILcdGXYLabelPainter2Tests if the label specified bysetObject,setLabelIndexandsetSubLabelIndexis touched at view location(specified by aGXYContext.getX()andaGXYContext.getY()), considering the mode and theILcdGXYContextinstance.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:
isLabelTouchedin interfaceILcdGXYLabelPainter2- Parameters:
aGraphics- TheGraphicsinstance 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- theILcdGXYContextto 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:ILcdGXYLabelPainter2Sets
aPointSFCTto the anchor point of the label specified bysetObject,setLabelIndexandsetSubLabelIndex.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 thelabeland 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:
labelAnchorPointSFCTin interfaceILcdGXYLabelPainter2- Parameters:
aGraphics- TheGraphicsinstance 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- TheILcdGXYContextthat 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:ILcdGXYLabelPainter2Returns whether this label painter supports snapping for the label specified by
setObject,setLabelIndexandsetSubLabelIndex, considering the givenILcdGXYContextinstance. 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:
supportLabelSnapin interfaceILcdGXYLabelPainter2- Parameters:
aGraphics- the Graphics on which is worked.aGXYContext- the ILcdGXYContext of the snapping.- Returns:
trueif this label painter supports snapping for the specified label.- See Also:
-
labelSnapTarget
Description copied from interface:ILcdGXYLabelPainter2Returns anObjectthat can be used as snapping target when graphically editing anotherObjector label than the one this ILcdGXYLabelPainter2 represents. The returnedObjectcan be theObjectthis ILcdGXYLabelPainter2 represents or any other (e.g. anILcdPointif getObject() is anILcdPointList).- Specified by:
labelSnapTargetin interfaceILcdGXYLabelPainter2- Parameters:
aGraphics- the Graphics on which is worked.aGXYContext- the ILcdGXYContext of the snapping.- Returns:
- an
Objectthat can be used as snapping target when graphically editing anotherObjector label than the one this ILcdGXYLabelPainter2 represents (returned by getObject()). This object can benull.
-
getLabelCursor
Description copied from interface:ILcdGXYLabelPainter2Returns aCursorto indicate the type of editingaModeandaGXYContext.- Specified by:
getLabelCursorin interfaceILcdGXYLabelPainter2- Parameters:
aGraphics- TheGraphicsinstance on which the label is painted.aMode- The mode to consider. SeeILcdGXYLabelPainter2.paintLabel(java.awt.Graphics, int, ILcdGXYContext)for more information.aGXYContext- TheILcdGXYContextcontaining extra information, such as the layer, the view and the mouse position.- Returns:
- a
Cursorto indicate the type of editingaModeandaGXYContext. Returnsnullif no particularCursoris required.
-