Class TLcdGXYArcBandPainter

All Implemented Interfaces:
ILcdCloneable, ILcdPropertyChangeSource, ILcdGXYEditor, ILcdGXYEditorProvider, ILcdGXYPainter, ILcdGXYPainterProvider, ILcdGXYPathPainter, Serializable, Cloneable

public class TLcdGXYArcBandPainter extends ALcdGXYAreaPainter implements ILcdGXYPainter, ILcdGXYPathPainter, ILcdGXYEditor, ILcdGXYEditorProvider
Paints and locates ILcdArcBand objects and enables visual editing of ILcd2DEditableArcBand objects in an ILcdGXYView.

Painting an ILcdArcBand

Body

This painter provides three paint modes to paint the body of an ILcdArcBand object. The mode property can be set using the method setMode and allows the arc band to be painted as:


An arc band
A filled arc band
A filled and outlined arc band
An outlined arc band (OUTLINED)
A filled arc band (FILLED)
A filled and outlined arc band (OUTLINED_FILLED)

Objects that are selected or that are being edited, are painted as defined by the selectionMode and editMode properties, respectively. The same values as above can be used for both mode properties.

Handles

This painter defines the four corner points of the ILcdArcBand object as a handle of the arc band. The following image clarifies the handle location, the corner points are represented by red points.

The different handles

Note that the center point of the arc band is painted in BODY mode depending on the drawCenter property. When painted, it can be used as a handle to edit the object.

Snap targets

One of the four corner points of the ILcdArcBand object can be returned on the condition that it is touched. If the center point is painted (see isDrawCenter()) or when snapping to invisible points is enabled (see isSnapToInvisiblePoints()), the center point can also be returned. The point returned as a snap target is highlighted with the snapIcon.

Styling options

The visualization of the ILcdArcBand object is governed by the line style and fill style set to this painter. Depending on the paint mode chosen one or both of these will be taken into account.

Locating an ILcdArcBand in a view

Anchor point of an ILcdArcBand

The location of the anchor point can be set using setAnchorPointLocation(int) to the middle of the arcband's bounds or to the middle of arcband itself. By default the anchor point is located at the center point of the bounds, calculated by boundsSFCT. Note that the center point of the ILcdArcBand object is not taken into account.

When is an ILcdArcBand touched

Depending on the paint mode, an arc band is touched when either the contour, one of the corner points, the center point, or the internal area (when filled) of the arc band is touched. Note that the center point can only be touched if it is painted.

Visual bounds of an ILcdArcBand

The bounds of the ILcdArcBand object contains the contour of the arc band and the center point if it is painted.

Visually editing and creating an ILcd2DEditableArcBand

Modifying an ILcd2DEditableArcBand

This editor provides the following edit functionality for the different render modes:

  • RESHAPED: the arc segment or the angle line is reshaped, depending on whether they are touched. The images below illustrate the editing behavior. The small black arrow indicates the path of the mouse cursor while reshaping the arc band.

    Moving an arc segment
    Moving an angle line
    Moving an arc segment.
    Moving an angle line.

  • TRANSLATED: a corner point or the whole arc band is translated, depending on whether a corner point, the contour or the interior is touched. The images below illustrate the editing behavior. The small black arrow indicates the path of the mouse cursor while translating the arc band.

    Moving a corner point
    Moving the contour
    Moving the interior
    Moving a corner point.
    Moving the contour.
    Moving the interior.

    Note that, if the center point of the arc band is touched (and painted), the whole arc band can be translated as if the contour was touched.

Creating an ILcd2DEditableArcBand

When initializing an arc band via interaction through the view, 3 user interactions are required to complete the initialization. The first point defines the center point of the arc band, the second the start angle and the third the width of the arc band.

The creationOrientation property defines the orientation of the arc band during creation.

Accepted snap targets

All points are accepted as snap target as long as:

  • the point can be transformed to the reference of the ILcdArcBand object with the model to model transformation,
  • the point is not one of the snappable points of the ILcdArcBand object set to this painter.

Additional properties

Caching

This painter implementation supports caching for objects implementing ILcdCache. Caching can be turned on/off with the setPaintCache method.

Drawing the center point

The drawCenter and drawCenterWhenSelected properties define when the center point needs to be painted. If the center point is painted, it can be touched, moved,...

See Also:
  • Field Details

    • OUTLINED

      public static final int OUTLINED
      Draw the ILcdArcBand object as an outlined arc band, only the contour of the arc band defined by the ILcdArcBand is painted.
      See Also:
    • FILLED

      public static final int FILLED
      Draw the ILcdArcBand object as a filled arc band, only the area of the arc band defined by the ILcdArcBand is painted.
      See Also:
    • OUTLINED_FILLED

      public static final int OUTLINED_FILLED
      Draw the ILcdArcBand object as an outlined and filled arc band, both the area and the contour of the arc band defined by the ILcdArcBand are painted.
      See Also:
    • CENTER

      protected static final int CENTER
      Constant value denoting the center point of the arc band.
      See Also:
    • BODY

      protected static final int BODY
      Constant value denoting the body of the arc band.
      See Also:
    • MIN_RADIUS_ARC

      protected static final int MIN_RADIUS_ARC
      Constant value denoting the minimum arc segment of the arc band.
      See Also:
    • MAX_RADIUS_ARC

      protected static final int MAX_RADIUS_ARC
      Constant value denoting the maximum arc segment of the arc band.
      See Also:
    • START_ANGLE_LINE

      protected static final int START_ANGLE_LINE
      Constant value denoting the start angle line of the arc band.
      See Also:
    • END_ANGLE_LINE

      protected static final int END_ANGLE_LINE
      Constant value denoting the end angle line of the arc band.
      See Also:
    • MIN_RADIUS_START_CORNER

      protected static final int MIN_RADIUS_START_CORNER
      Constant value denoting the corner point at the start angle and the minimum radius of the arc band.
      See Also:
    • MAX_RADIUS_START_CORNER

      protected static final int MAX_RADIUS_START_CORNER
      Constant value denoting the corner point at the start angle and the maximum radius of the arc band.
      See Also:
    • MIN_RADIUS_END_CORNER

      protected static final int MIN_RADIUS_END_CORNER
      Constant value denoting the corner point at the end angle and the minimum radius of the arc band.
      See Also:
    • MAX_RADIUS_END_CORNER

      protected static final int MAX_RADIUS_END_CORNER
      Constant value denoting the corner point at the end angle and the maximum radius of the arc band.
      See Also:
    • sCursorTranslating

      public static volatile Cursor sCursorTranslating
      Cursor to return to indicate the object will be translated.
    • sCursorReshaping

      public static Cursor sCursorReshaping
      Cursor to return to indicate the object will be reshaped.
    • sCursorResizing

      public static Cursor[] sCursorResizing
      Cursor to return to indicate the object will be reshaped. Direction depends on the shape of the object.
    • CLOCKWISE

      public static final int CLOCKWISE
      Constant for a clockwise orientation when creating an arc band.
      See Also:
    • COUNTERCLOCKWISE

      public static final int COUNTERCLOCKWISE
      Constant for a counter clockwise orientation when creating an arc band.
      See Also:
    • MIDDLE_OF_BOUNDS

      public static final int MIDDLE_OF_BOUNDS
      Constant value indicating that the anchor point should be chosen in the middle of the arcband's bounds, calculated by boundsSFCT. Note that the center point of the ILcdArcBand object is not taken into account.
      See Also:
    • FOCUS_POINT

      public static final int FOCUS_POINT
      Constant value indicating that the anchor point should be chosen as the focus point of the arcband. If this point cannot be calculated, the MIDDLE_OF_BOUNDS method is used to calculate the anchor point.
      See Also:
    • MIDDLE_OF_ARCBAND

      public static final int MIDDLE_OF_ARCBAND
      Constant value indicating that the anchor point should be chosen in the middle of the arcband itself.
      See Also:
  • Constructor Details

    • TLcdGXYArcBandPainter

      public TLcdGXYArcBandPainter()
      Constructs a default TLcdGXYArcBandPainter and sets the display name to "Arc Band".
  • Method Details

    • setTraceOn

      public void setTraceOn(boolean aTraceOn)
      Deprecated.
      This method has been deprecated. It is recommended to use the standard Java logging framework directly.
      Enables tracing for this class instance. Calling this method with either true or false as argument automatically turns off tracing for all other class instances for which setTraceOn has not been called. If the argument is false then only the informative, warning and error log messages are recorded.
      Overrides:
      setTraceOn in class ALcdGXYPainter
      Parameters:
      aTraceOn - if true then all log messages are recorded for this instance. If false, then only the informative, warning and error log messages are recorded.
    • isTraceOn

      public boolean isTraceOn()
      Deprecated.
      This method has been deprecated. It is recommended to use the standard Java logging framework directly.
      Returns true if tracing is enabled for this class.
      Overrides:
      isTraceOn in class ALcdGXYPainter
      Returns:
      true if tracing is enabled for this class, false otherwise.
    • setObject

      public void setObject(Object aObject)

      Sets the object to paint and edit. The object should be an instance of ILcdArcBand for painting and an instance of ILcd2DEditableArcBand 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 ILcdArcBand and shall throw a ClassCastException if it does not.

      When this painter is used as editor with an object that does not implement the interface ILcd2DEditableArcBand, the edit method shall throw the necessary exception.

      Specified by:
      setObject in interface ILcdGXYEditor
      Specified by:
      setObject in interface ILcdGXYPainter
      Parameters:
      aObject - The object to paint and edit.
      Throws:
      ClassCastException - when the object does not implement ILcdArcBand.
      See Also:
    • getObject

      public final Object getObject()
      Returns the object that can currently be painted or edited by this painter/editor.
      Specified by:
      getObject in interface ILcdGXYEditor
      Specified by:
      getObject in interface ILcdGXYPainter
      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 representation of the object on or off. Caching greatly reduces the time to paint an object but requires more memory. The representation of an object can only be cached for objects which implement ILcdCache. 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:
      true if caching is used to paint this painter's object, false otherwise.
      See Also:
    • setCreateCounterClockwise

      public void setCreateCounterClockwise(boolean aCreateCounterClockwise)
      Deprecated.
      Use the method setCreationOrientation(int). Note that this method will fire two property change events for backward compatibility.
      Sets whether the ILcdArcBand should be initialized with a preference for counter clockwise arcs.
      Parameters:
      aCreateCounterClockwise - A flag indicating whether the ILcdArcBand should be initialized with a preference for counter clockwise arcs.
      See Also:
    • isCreateCounterClockwise

      public boolean isCreateCounterClockwise()
      Deprecated.
      Returns whether the ILcdArcBand should be created with a preference for counter clockwise arcs.
      Returns:
      whether the ILcdArcBand should be created with a preference for counter clockwise arcs.
      See Also:
    • setCreationOrientation

      public void setCreationOrientation(int aCreationOrientation)
      Sets the orientation used while creating ILcdArcBand objects. The value passed should be CLOCKWISE or COUNTERCLOCKWISE. The default value is COUNTERCLOCKWISE for backward compatibility reasons.
      Parameters:
      aCreationOrientation - A flag indicating the orientation of the arc band during creation.
      See Also:
    • getCreationOrientation

      public int getCreationOrientation()
      Returns the orientation used while creating ILcdArcBand objects.
      Returns:
      the orientation used while creating ILcdArcBand objects.
      See Also:
    • setMode

      public void setMode(int aDefaultMode)

      Sets the default mode to decide how to paint an ILcdArcBand object. The object can be painted as an outlined arc band (OUTLINED), as a filled arc band (FILLED), or as a filled and outlined arc band (OUTLINED_FILLED).

      As a side effect, this method will set the display name and initialize the line style if no line style was defined. The used display name are respectively "OutlinedArcBand", "FilledArcBand", "OutlinedFilledArcBand".

      Overrides:
      setMode in class ALcdGXYAreaPainter
      Parameters:
      aDefaultMode - The default paint mode to paint ILcdArcBand objects.
      See Also:
    • setDrawCenter

      public void setDrawCenter(boolean aDrawCenter)
      Sets whether the center point of the arc band should be displayed or not. The default value of this property is false. This setting has an influence on the methods boundsSFCT, isTouched and snapping. Regardless of this setting, the center point is always displayed as a handle in HANDLES mode to allow editing.
      Parameters:
      aDrawCenter - A flag indicating whether the center point should be displayed or not.
      See Also:
    • isDrawCenter

      public boolean isDrawCenter()
      Returns whether the center point of the arc band should be displayed.
      Returns:
      whether the center point of the arc band should be displayed.
      See Also:
    • setDrawCenterWhenSelected

      public void setDrawCenterWhenSelected(boolean aDrawCenterWhenSelected)
      Sets whether the center point of the arc band should be displayed when it is painted in selected mode or not. The default value of this property is true. This setting has an influence on the methods boundsSFCT, isTouched and snapping. Regardless of this setting, the center point is always displayed as a handle in HANDLES mode to allow editing.
      Parameters:
      aDrawCenterWhenSelected - A flag indicating whether the center point should be displayed when it is painted in selected mode or not.
      See Also:
    • isDrawCenterWhenSelected

      public boolean isDrawCenterWhenSelected()
      Returns whether the center point of the arc band should be displayed when it is painted in selected mode.
      Returns:
      whether the center point of the arc band should be displayed when it is painted in selected mode.
      See Also:
    • setCenterIcon

      public void setCenterIcon(ILcdIcon aIcon)
      Sets the icon for the center point's default representation, if isDrawCenter() returns true.
      Parameters:
      aIcon - the icon for the center point's default representation
      See Also:
    • getCenterIcon

      public ILcdIcon getCenterIcon()
      Returns the icon for the center point's default representation, used if isDrawCenter() returns true.
      Returns:
      the icon for the center point's default representation
    • setCenterIconWhenSelected

      public void setCenterIconWhenSelected(ILcdIcon aIcon)
      Sets the icon for the center point's selected representation, if isDrawCenterWhenSelected() returns true.
      Parameters:
      aIcon - the icon for the center point's selected representation
      See Also:
    • getCenterIconWhenSelected

      public ILcdIcon getCenterIconWhenSelected()
      Returns the icon for the center point's selected representation, used if isDrawCenterWhenSelected() returns true.
      Returns:
      the icon for the center point's selected representation
    • setCenterPointFormat

      public void setCenterPointFormat(Format aCenterPointFormat)
      Sets the format that will be used when displaying the center point while the ILcdArcBand object is being moved.
      Parameters:
      aCenterPointFormat - The Format used to display the center point information.
    • setAnglesFormat

      public void setAnglesFormat(Format aAnglesFormat)
      Sets the format that will be used when displaying the angles of the ILcdArcBand while the angles are being edited.
      Parameters:
      aAnglesFormat - The Format used to display the angle information.
    • setMinRadiusFormat

      public void setMinRadiusFormat(Format aMinRadiusFormat)
      Sets the format that will be used when displaying the minimum radius of the ILcdArcBand while the minimum radius is being edited.
      Parameters:
      aMinRadiusFormat - The Format used to display the minimum radius information.
    • setMaxRadiusFormat

      public void setMaxRadiusFormat(Format aMaxRadiusFormat)
      Sets the format that will be used when displaying the maximum radius of the ILcdArcBand while the maximum radius is being edited.
      Parameters:
      aMaxRadiusFormat - The Format used to display the maximum radius information.
    • setSnapToInvisiblePoints

      public void setSnapToInvisiblePoints(boolean aSnapToInvisiblePoints)
      Sets whether the other shapes can snap to invisible points of this shape. For an ILcdArcBand object, there's only one invisible point, being the center point of the arc band when it is not drawn. The default value is false.
      Parameters:
      aSnapToInvisiblePoints - A flag indicating whether snapping to the invisible points is allowed.
      See Also:
    • isSnapToInvisiblePoints

      public boolean isSnapToInvisiblePoints()
      Returns whether the painter allows snapping to the invisible points of the shape.
      Returns:
      whether the painter allows snapping to the invisible points of the shape.
      See Also:
    • setMinimumEditDelta

      public void setMinimumEditDelta(int aDelta)
      Sets the minimum pixel distance the input device (a mouse, for example) must move before editing the shape. A larger value ensures that the object easily "snaps" back in place, a small value allows fine editing.
      Parameters:
      aDelta - the minimum pixel distance the input device should move in either the X or Y direction
    • getMinimumEditDelta

      public int getMinimumEditDelta()
      Returns the minimum pixel distance the input device (a mouse, for example) must move before editing the shape. A larger value ensures that the object easily "snaps" back in place, a small value allows fine editing. The default value is 3 pixels.
      Returns:
      the minimum pixel distance the input device should move in either the X or Y direction
    • setSnapIcon

      public void setSnapIcon(ILcdIcon aSnapIcon)
      Sets the icon that marks snap targets of the object currently set to this painter. This icon is painted when the paint method is called with the render mode ILcdGXYPainter.SNAPS.
      Parameters:
      aSnapIcon - The icon that should be used to paint snap target points.
      See Also:
    • getSnapIcon

      public ILcdIcon 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:
    • getAnchorPointLocation

      public int getAnchorPointLocation()
      Returns the location of the anchor point (by default: MIDDLE_OF_BOUNDS).
      Returns:
      one of MIDDLE_OF_BOUNDS, FOCUS_POINT, MIDDLE_OF_ARCBAND
    • setAnchorPointLocation

      public void setAnchorPointLocation(int aAnchorPointLocation)
      Sets the preferred anchor point location.
      Parameters:
      aAnchorPointLocation - one of MIDDLE_OF_BOUNDS, FOCUS_POINT, MIDDLE_OF_ARCBAND
    • setupGraphicsForLine

      protected void setupGraphicsForLine(Graphics aGraphics, Object aObject, int aRenderMode, ILcdGXYContext aGXYContext)

      Called just before painting a line on the specified Graphics object. It can be redefined in order to set specific Graphics properties like Color, etc...

      This implementation calls ILcdGXYPainterStyle.setupGraphics(java.awt.Graphics, java.lang.Object, int, com.luciad.view.gxy.ILcdGXYContext) on the lineStyle property if a line style has been set to this instance.

      Parameters:
      aGraphics - The graphics to paint the object on.
      aObject - The object to paint.
      aRenderMode - The mode to render the object in.
      aGXYContext - The context to render the object in.
    • setupGraphicsForFill

      protected void setupGraphicsForFill(Graphics aGraphics, int aRenderMode, ILcdGXYContext aGXYContext)

      Called just before filling arc bands on the specified Graphics object. It can be redefined in order to set specific Graphics properties like Color, etc...

      This implementation calls ILcdGXYPainterStyle.setupGraphics(java.awt.Graphics, java.lang.Object, int, com.luciad.view.gxy.ILcdGXYContext) on the fillStyle property if a fill style has been set to this instance.

      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.
    • paint

      public void paint(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.

      This implementation will use the specified render mode to determine how the object needs to be rendered. In ILcdGXYPainter.CREATING, ILcdGXYPainter.RESHAPING and ILcdGXYPainter.TRANSLATING mode, the object is painted using the edit paint mode (ALcdGXYAreaPainter.getEditMode()). The object is rendered as shown in the images of the class documentation.

      In the render mode ILcdGXYPainter.SELECTED, the object is painted using the selection paint mode (ALcdGXYAreaPainter.getSelectionMode()). In all other render modes, the paint mode (ALcdGXYAreaPainter.getMode()) is used.

      Specified by:
      paint in interface ILcdGXYPainter
      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.
    • appendAWTPath

      public boolean appendAWTPath(ILcdGXYContext aGXYContext, int aRenderMode, ILcdAWTPath aAWTPathSFCT)
      Description copied from interface: ILcdGXYPathPainter
      Appends a discretized representation in view coordinates to the given path.
      Specified by:
      appendAWTPath in interface ILcdGXYPathPainter
      Parameters:
      aGXYContext - the graphics context
      aRenderMode - the rendering mode
      aAWTPathSFCT - the path to append to
      Returns:
      true if a discretization of the shape could be successfully appended to the path
    • appendGeneralPath

      public boolean appendGeneralPath(ILcdGXYContext aGXYContext, int aRenderMode, ILcdGeneralPath aGeneralPathSFCT)
      Description copied from interface: ILcdGXYPathPainter
      Appends a discretized representation in world coordinates to the given path.
      Specified by:
      appendGeneralPath in interface ILcdGXYPathPainter
      Parameters:
      aGXYContext - the graphics context
      aRenderMode - the rendering mode
      aGeneralPathSFCT - the path to append to
      Returns:
      true if a discretization of the shape could be successfully appended to the path
    • paintEditingLabels

      protected void paintEditingLabels(Graphics aGraphics, ILcdArcBand aArcBand, int aTouchedLocation, ILcdGXYContext aGXYContext)

      Called by the paint method when editing an ILcd2DEditableArcBand. It draws labels indicating the values of properties being changed. For example, the coordinates of the center point of the arc band, the minimum or maximum radius, the start angle, etc ... This method draws the default labels but it can be redefined for specific needs.

      The aTouchedLocation argument indicates which part of the arc band is being edited. For example, MAX_RADIUS_START_CORNER corresponds to the corner point at the start angle and the maximum radius of the arc band. It should be one of the following constants: CENTER, MIN_RADIUS_ARC, MAX_RADIUS_ARC, MIN_RADIUS_START_CORNER, MAX_RADIUS_START_CORNER, MIN_RADIUS_END_CORNER, MAX_RADIUS_END_CORNER

      Parameters:
      aGraphics - The graphics to paint the object on.
      aArcBand - The arc band that is being edited.
      aTouchedLocation - The part of the arc band that is being edited.
      aGXYContext - The context to render the object in.
    • boundsSFCT

      public void boundsSFCT(Graphics aGraphics, int aRenderMode, ILcdGXYContext aGXYContext, ILcd2DEditableBounds aBoundsSFCT) throws TLcdNoBoundsException
      Computes the bounds of the representation of an ILcdArcBand in AWT coordinates. The bounds will include the center point of the arc band depending on whether it is rendered or not. This in turn depends on the painter mode passed and the values of the properties drawCenter and drawCenterWhenSelected.
      Specified by:
      boundsSFCT in interface ILcdGXYPainter
      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 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:
    • boundsOfEditingLabelsSFCT

      protected void boundsOfEditingLabelsSFCT(Graphics aGraphics, ILcdArcBand aArcBand, int aTouchedLocation, ILcdGXYContext aGXYContext, ILcd2DEditableBounds aBoundsSFCT)

      Called by the boundsSFCT method when editing an ILcd2DEditableArcBand. It calculates the bounds of the labels indicating the values of properties being changed. For example, the coordinates of the center point of the arc band, the minimum or maximum radius, the start angle, etc ...

      Note that the ILcd2DEditableBounds object already contains the bounds of the edited object. Upon exit of this method, this object should be set to the union of the bounds of the edited object and the labels painted while editing.

      The aTouchedLocation argument indicates which part of the arc band is being edited. For example, MAX_RADIUS_START_CORNER corresponds to the corner point at the start angle and the maximum radius of the arc band. It should be one of the following constants: CENTER, MIN_RADIUS_ARC, MAX_RADIUS_ARC, MIN_RADIUS_START_CORNER, MAX_RADIUS_START_CORNER, MIN_RADIUS_END_CORNER, MAX_RADIUS_END_CORNER

      Parameters:
      aGraphics - The graphics to paint the object on.
      aArcBand - The arc band that is being edited.
      aTouchedLocation - The part of the arc band that is being edited.
      aGXYContext - The context to render the object in.
      aBoundsSFCT - The bounds in view coordinates to be updated.
    • isTouched

      public boolean isTouched(Graphics aGraphics, int aRenderMode, ILcdGXYContext aGXYContext)
      Depending on the rendering mode, returns whether one or more of the contour, the corner points, the center point, or the interior of the arc band is touched. Note that the center point can only be touched if it is painted.

      This implementation will use the specified paint mode to determine how the object is represented. Depending on the representation of the ILcdArcBand object, the object is touched if the contour, one of its corner points, the center point (when painted) or, its interior space (when it is painted filled) is touched. The coordinate for which the check is done is derived from the context passed as argument.

      Specified by:
      isTouched in interface ILcdGXYPainter
      Parameters:
      aGraphics - The graphics to paint the object on.
      aRenderMode - The mode to render the object in, a combination of the constants in ILcdGXYPainter.
      aGXYContext - The context in which the object is rendered.
      Returns:
      the contour, the corner points, the center point, or the interior of the arc band is touched.
      See Also:
    • getCursor

      public Cursor getCursor(Graphics aGraphics, int aRenderMode, ILcdGXYContext aGXYContext)
      Returns a Cursor that clarifies the render mode and context this painter is operating in. When no specific Cursor is required, null is returned.
      Specified by:
      getCursor in interface ILcdGXYPainter
      Overrides:
      getCursor in class ALcdGXYPainter
      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 null if no particular cursor is required.
    • getGXYEditor

      public ILcdGXYEditor getGXYEditor(Object aObject)
      Returns this instance as editor for editing the specified Object. If this Object is not the same as the Object set to this painter, the setObject(Object) method is called to update the object set to the painter.
      Specified by:
      getGXYEditor in interface ILcdGXYEditorProvider
      Parameters:
      aObject - the object to be edited.
      Returns:
      this instance as editor for editing the specified Object.
    • edit

      public boolean edit(Graphics aGraphics, int aRenderMode, ILcdGXYContext aGXYContext)

      This implementation edits the ILcdArcBand object set to the painter. The object needs to implement the interface ILcd2DEditableArcBand otherwise a ClassCastException will be thrown.

      In ILcdGXYEditor.TRANSLATED render mode, the ILcdArcBand object is edited as follows:

      • While touching a corner point, the corner point gets translated.
      • While touching the center point, the object gets translated as a whole.
      • While touching the contour, the object gets translated as a whole.
      • While touching the interior and the selected object is painted as filled, the object gets translated as a whole.

      In ILcdGXYEditor.RESHAPED render mode, the ILcdArcBand object is edited as follows:

      • While touching an arc segment, the arc segment will move while enlarging or reducing the width of the arc band.
      • While touching an angle line, the angle line will move while enlarging or reducing the arc angle of the arc band.

      In the creation render modes, the first action defines the center point of the arc band, the second the start angle and the third the width of the arc band.

      If, in all render modes, a snap target is found for a moved or created point, the snap target location is used for the moved/created point.

      Specified by:
      edit in interface ILcdGXYEditor
      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 implement ILcd2DEditableArcBand.
      See Also:
    • getCreationClickCount

      public int getCreationClickCount()
      Returns 3 as the number of required user interactions.
      Specified by:
      getCreationClickCount in interface ILcdGXYEditor
      Returns:
      3.
    • setModelModelTransformationClass

      public void setModelModelTransformationClass(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. The transformation will be instantiated and setup to transform points from the model of the snap layer to points in the model which contains the current object of this painter. The default value is the TLcdGeoReference2GeoReference class.

      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

      public boolean acceptSnapTarget(Graphics aGraphics, ILcdGXYContext aGXYContext)

      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 ILcd2DEditableArcBand.
      • The snap target is an ILcdPoint whose coordinates are expressed in the same coordinate system as the current objects coordinate system or the model to model transformation can transform the point to a point in the objects coordinate system.
      • The snap object is not one of the snappable points of the current object. If this is wanted, override the function and return true if the snap object is one of the snappable points.
      • One of the corner points or the center point is touched or both minimum and maximum radius are 0. This enables snapping when creating an arc band.

      Specified by:
      acceptSnapTarget in interface ILcdGXYEditor
      Parameters:
      aGraphics - the graphics on which the snap target should be checked.
      aGXYContext - the context in which the snap target should be checked.
      Returns:
      true if the above conditions are met, false otherwise.
      See Also:
    • snapTarget

      public Object snapTarget(Graphics aGraphics, ILcdGXYContext aGXYContext)

      Returns the center point or one of the end points of the ILcdArcBand if it is touched. If no point was touched, null will be returned. Note that the center point is only returned if the center point is drawn (see isDrawCenter()) or when snapping to invisible points is enabled (see isSnapToInvisiblePoints()).

      Specified by:
      snapTarget in interface ILcdGXYPainter
      Overrides:
      snapTarget in class ALcdGXYPainter
      Parameters:
      aGraphics - the graphics on which is worked.
      aGXYContext - the context of the snapping.
      Returns:
      the center point or one of the end points of the ILcdArcBand if it is touched, null otherwise.
      See Also:
    • supportSnap

      public boolean supportSnap(Graphics aGraphics, ILcdGXYContext aGXYContext)
      This implementation supports snapping, always returns true.
      Specified by:
      supportSnap in interface ILcdGXYPainter
      Overrides:
      supportSnap in class ALcdGXYPainter
      Parameters:
      aGraphics - the graphics on which is worked.
      aGXYContext - the context of the snapping.
      Returns:
      true.
    • anchorPointSFCT

      public void anchorPointSFCT(Graphics aGraphics, int aRenderMode, ILcdGXYContext aGXYContext, Point aPointSFCT) throws TLcdNoBoundsException

      Moves the specified aPointSFCT to the anchor point of the ILcdArcBand object

      Specified by:
      anchorPointSFCT in interface ILcdGXYPainter
      Overrides:
      anchorPointSFCT in class ALcdGXYPainter
      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.
      aPointSFCT - The point that needs to be updated.
      Throws:
      TLcdNoBoundsException - if the ILcdArcBand object doesn't have a valid anchor point, e.g. if it is always invisible in the current projection.
      See Also:
    • clone

      public Object clone()
      Description copied from interface: ILcdCloneable

      Makes Object.clone() public.

      When for example extending from java.lang.Object, it can be implemented like this:
      
       public Object clone() {
         try {
           return super.clone();
         } catch ( CloneNotSupportedException e ) {
           // Cannot happen: extends from Object and implements Cloneable (see also Object.clone)
           throw new RuntimeException( e );
         }
       }
       
      Specified by:
      clone in interface ILcdCloneable
      Specified by:
      clone in interface ILcdGXYEditorProvider
      Specified by:
      clone in interface ILcdGXYPainterProvider
      Overrides:
      clone in class ALcdGXYAreaPainter
      Returns:
      a clone of this painter provider.
      See Also: