Class TLcdGXYPen

java.lang.Object
com.luciad.view.gxy.ALcdGXYPen
com.luciad.view.gxy.TLcdGXYPen
All Implemented Interfaces:
ILcdCloneable, ILcdGXYPen, Serializable, Cloneable

public class TLcdGXYPen extends ALcdGXYPen implements ILcdGXYPen, Serializable
ILcdGXYPen for painting and editing elementary shapes defined in a geodetic model reference or grid reference with very high performance. The given model coordinates are assumed to be latitude longitude coordinates or cartesian grid coordinates (the height is not used). Most of the methods are implemented in an approximate way for the sake of performance (e.g. lines will be straight lines). See TLcdGeodeticPen and TLcdGridPen for more accurate pen implementations.
See Also:
  • Constructor Details

  • Method Details

    • drawLineTo

      public void drawLineTo(ILcdPoint aPoint, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation, Graphics aGraphics) throws TLcdOutOfBoundsException
      Description copied from interface: ILcdGXYPen
      Draws a line from the current position to the given model point onto the given Graphics. The given model coordinates of the end point of the line are transformed to AWT coordinates by applying the given ILcdModelXYWorldTransformation and ILcdGXYViewXYWorldTransformation.
      Specified by:
      drawLineTo in interface ILcdGXYPen
      Overrides:
      drawLineTo in class ALcdGXYPen
      Parameters:
      aPoint - the end point of the line (specified in model coordinates)
      aModelXYWorldTransformation - the transformation between model and world coordinates
      aGXYViewXYWorldTransformation - the transformation between world and view coordinates
      aGraphics - the Graphics onto which the line is drawn
      Throws:
      TLcdOutOfBoundsException - Some implementations may throw an exception in case the given end point of the line is outside the valid area of the transformation but this could be avoided by more advanced implementations.
    • drawHorizontalLineTo

      public void drawHorizontalLineTo(double aDeltaX, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation, Graphics aGraphics) throws TLcdOutOfBoundsException
      Description copied from interface: ILcdGXYPen
      Draws a horizontal line from the current position to the given model point onto the given Graphics. This model point is obtained by translating the model x coordinate of the current position by the given amount. The model coordinates of the end point of the line are transformed to AWT coordinates by applying the given ILcdModelXYWorldTransformation and ILcdGXYViewXYWorldTransformation.
      Specified by:
      drawHorizontalLineTo in interface ILcdGXYPen
      Overrides:
      drawHorizontalLineTo in class ALcdGXYPen
      Parameters:
      aDeltaX - the amount by which the model x coordinate of the current position is translated
      aModelXYWorldTransformation - the transformation between model and world coordinates
      aGXYViewXYWorldTransformation - the transformation between world and view coordinates
      aGraphics - the Graphics on which the line is drawn
      Throws:
      TLcdOutOfBoundsException - Some implementations may throw an exception in case the given end point of the line is outside the valid area of the transformation but this could be avoided by more advanced implementations.
    • drawVerticalLineTo

      public void drawVerticalLineTo(double aDeltaY, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation, Graphics aGraphics) throws TLcdOutOfBoundsException
      Description copied from interface: ILcdGXYPen
      Draws a vertical line from the current position to the given model point onto the given Graphics. This model point is obtained by translating the model y coordinate of the current position by the given amount. The model coordinates of the end point of the line are transformed to AWT coordinates by applying the given ILcdModelXYWorldTransformation and ILcdGXYViewXYWorldTransformation.
      Specified by:
      drawVerticalLineTo in interface ILcdGXYPen
      Overrides:
      drawVerticalLineTo in class ALcdGXYPen
      Parameters:
      aDeltaY - the amount by which the model y coordinate of the current position is translated
      aModelXYWorldTransformation - the transformation between model and world coordinates
      aGXYViewXYWorldTransformation - the transformation between world and view coordinates
      aGraphics - the Graphics on which the line is drawn
      Throws:
      TLcdOutOfBoundsException - Some implementations may throw an exception in case the given end point of the line is outside the valid area of the transformation but this could be avoided by more advanced implementations.
    • drawLineTo

      public void drawLineTo(double aX, double aY, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation, Graphics aGraphics) throws TLcdOutOfBoundsException
      Description copied from interface: ILcdGXYPen
      Draws a line from the current position to the given AWT point onto the given Graphics. The given AWT coordinates of the end point of the line are transformed to model coordinates by applying the given ILcdModelXYWorldTransformation and ILcdGXYViewXYWorldTransformation.
      Specified by:
      drawLineTo in interface ILcdGXYPen
      Overrides:
      drawLineTo in class ALcdGXYPen
      Parameters:
      aX - the AWT x coordinate of the point to which a line is drawn
      aY - the AWT y coordinate of the point to which a line is drawn
      aModelXYWorldTransformation - the transformation between model and world coordinates
      aGXYViewXYWorldTransformation - the transformation between world and view coordinates
      aGraphics - the Graphics on which the line is drawn
      Throws:
      TLcdOutOfBoundsException - Some implementations may throw an exception in case the given end point of the line is outside the valid area of the transformation but this could be avoided by more advanced implementations.
    • drawLineTo

      public void drawLineTo(Point aPoint, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation, Graphics aGraphics) throws TLcdOutOfBoundsException
      Draws a line from the current position to the given AWT point onto the given Graphics. The given AWT coordinates of the end point of the line are transformed to model coordinates by applying the given ILcdModelXYWorldTransformation and ILcdGXYViewXYWorldTransformation.
      Overrides:
      drawLineTo in class ALcdGXYPen
      Parameters:
      aPoint - the point (specified in AWT coordinates) to which a line is drawn
      aModelXYWorldTransformation - the transformation between model and world coordinates
      aGXYViewXYWorldTransformation - the transformation between world and view coordinates
      aGraphics - the Graphics on which the line is drawn
      Throws:
      TLcdOutOfBoundsException - The current implementation does not throw a TLcdOutOfBoundsException if the end point of the line is outside the valid area of the transformation.
    • appendLineTo

      public void appendLineTo(ILcdPoint aPoint, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation, ILcdAWTPath aAWTPathSFCT)
      Description copied from interface: ILcdGXYPen
      Appends a line from the current position to the given model point to the given ILcdAWTPath. The given model coordinates of the end point of the line are transformed to AWT coordinates by means of the given ILcdModelXYWorldTransformation and ILcdGXYViewXYWorldTransformation. If this model point is outside the valid area of the given ILcdModelXYWorldTransformation, a line break is appended to the given ILcdAWTPath.
      Specified by:
      appendLineTo in interface ILcdGXYPen
      Parameters:
      aPoint - the end point (specified in model coordinates) of the line
      aModelXYWorldTransformation - the transformation between model and world coordinates
      aGXYViewXYWorldTransformation - the transformation between world and view coordinates
      aAWTPathSFCT - the AWT path to which the line is appended
    • appendHorizontalLineTo

      public void appendHorizontalLineTo(double aDeltaX, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation, ILcdAWTPath aAWTPathSFCT)
      Description copied from interface: ILcdGXYPen
      Appends a horizontal line starting from the current position to the given ILcdAWTPath. The model coordinates of the end point of this line are obtained by translating the model x coordinate of the current position by the given amount. The model coordinates of the end point of the line are transformed to AWT coordinates by means of the given ILcdModelXYWorldTransformation and ILcdGXYViewXYWorldTransformation. If this model point is outside the valid area of the given ILcdModelXYWorldTransformation, a line break is appended to the given ILcdAWTPath. In case the current position is undefined, nothing is appended.
      Specified by:
      appendHorizontalLineTo in interface ILcdGXYPen
      Parameters:
      aDeltaX - the amount by which the model x coordinate of the current position is translated
      aModelXYWorldTransformation - the transformation between model and world coordinates
      aGXYViewXYWorldTransformation - the transformation between world and view coordinates
      aAWTPathSFCT - the AWT path to which the line is appended
    • appendVerticalLineTo

      public void appendVerticalLineTo(double aDeltaY, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation, ILcdAWTPath aAWTPathSFCT)
      Description copied from interface: ILcdGXYPen
      Appends a vertical line starting from the current position to the given ILcdAWTPath. The model coordinates of the end point of this line are obtained by translating the model y coordinate of the current position by the given amount. The model coordinates of the end point of the line are transformed to AWT coordinates by means of the given ILcdModelXYWorldTransformation and ILcdGXYViewXYWorldTransformation. If this model point is outside the valid area of the given ILcdModelXYWorldTransformation, a line break is appended to the given ILcdAWTPath. In case the current position is undefined, nothing is appended.
      Specified by:
      appendVerticalLineTo in interface ILcdGXYPen
      Parameters:
      aDeltaY - the amount by which the model y coordinate of the current position is translated
      aModelXYWorldTransformation - the transformation between model and world coordinates
      aGXYViewXYWorldTransformation - the transformation between world and view coordinates
      aAWTPathSFCT - the AWT path to which the line is appended
    • appendPointList

      public void appendPointList(ILcdPointList aPointList, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation, ILcdAWTPath aAWTPathSFCT)
      Description copied from interface: ILcdGXYPen
      Appends a polyline to the given ILcdAWTPath. The polyline is given as an ILcdPointList of which the points are specified in model coordinates. These model coordinates are transformed to AWT coordinates by means of the given ILcdModelXYWorldTransformation and ILcdGXYViewXYWorldTransformation. If a model point is outside the valid area of the given ILcdModelXYWorldTransformation, a line break is appended to the given ILcdAWTPath so that the polyline is split.
      Specified by:
      appendPointList in interface ILcdGXYPen
      Parameters:
      aPointList - the point list (specified in model coordinates)
      aModelXYWorldTransformation - the transformation between model and world coordinates
      aGXYViewXYWorldTransformation - the transformation between world and view coordinates
      aAWTPathSFCT - the AWT path to which the given point list is appended
    • appendArc

      public void appendArc(ILcdPoint aCenter, double aA, double aB, double aRotAngle, double aStartAngle, double aArcAngle, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation, ILcdAWTPath aAWTPathSFCT) throws TLcdOutOfBoundsException
      Description copied from interface: ILcdGXYPen
      Appends a polyline approximation of the given arc to the given ILcdAWTPath. The arc is specified as a segment of the circumference of an ellipse. The given ILcdModelXYWorldTransformation and ILcdGXYViewXYWorldTransformation are used to transform model coordinates to AWT coordinates.
      Specified by:
      appendArc in interface ILcdGXYPen
      Parameters:
      aCenter - the center of the ellipse (specified in model coordinates)
      aA - the semi-major axis of the ellipse
      aB - the semi-minor axis of the ellipse
      aRotAngle - the rotation angle of the major axis of the ellipse (expressed in degrees). Positive angles are measured counter-clockwise from the line at 3 o'clock.
      aStartAngle - the start angle of the arc (expressed in degrees). Positive angles are measured counter-clockwise from the line at 3 o'clock.
      aArcAngle - the span of the arc (expressed in degrees), increasing counterclockwise from the start angle
      aModelXYWorldTransformation - the transformation between model and world coordinates
      aGXYViewXYWorldTransformation - the transformation between world and view coordinates
      aAWTPathSFCT - the AWT path to which the polyline approximation of the given arc is appended
      Throws:
      TLcdOutOfBoundsException - Some implementations may throw an exception in case the center of the ellipse is outside the valid area of the transformation but this could be avoided by more advanced implementations.
      See Also:
    • appendLineTo

      public void appendLineTo(ILcdPoint aPoint, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGeneralPath aGeneralPathSFCT)
      Description copied from interface: ILcdGXYPen
      Appends a line from the current position to the given model point to the given ILcdGeneralPath. The given model coordinates of the end point of the line are transformed to world coordinates by means of the given ILcdModelXYWorldTransformation. If this point is outside the valid area of the transformation, a line break is appended to the given ILcdGeneralPath.
      Specified by:
      appendLineTo in interface ILcdGXYPen
      Parameters:
      aPoint - the end point (specified in model coordinates) of the line
      aModelXYWorldTransformation - the transformation between model and world coordinates
      aGeneralPathSFCT - the general path to which the line is appended
    • appendHorizontalLineTo

      public void appendHorizontalLineTo(double aDeltaX, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGeneralPath aGeneralPathSFCT)
      Description copied from interface: ILcdGXYPen
      Appends a horizontal line starting from the current position to the given ILcdGeneralPath. The model coordinates of the end point of this line are obtained by translating the model x coordinate of the current position by the given amount. The model coordinates of the end point of the line are transformed to world coordinates by means of the given ILcdModelXYWorldTransformation. If this point is outside the valid area of this transformation, a line break is appended to the given ILcdGeneralPath. In case the current position is undefined, nothing is appended.
      Specified by:
      appendHorizontalLineTo in interface ILcdGXYPen
      Parameters:
      aDeltaX - the amount by which the model x coordinate of the current position is translated
      aModelXYWorldTransformation - the transformation between model and world coordinates
      aGeneralPathSFCT - the general path to which the line is appended
    • appendVerticalLineTo

      public void appendVerticalLineTo(double aDeltaY, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGeneralPath aGeneralPathSFCT)
      Description copied from interface: ILcdGXYPen
      Appends a vertical line starting from the current position to the given ILcdGeneralPath. The model coordinates of the end point of this line are obtained by translating the model y coordinate of the current position by the given amount. The model coordinates of the end point of the line are transformed to world coordinates by means of the given ILcdModelXYWorldTransformation. If this point is outside the valid area of this transformation, a line break is appended to the given ILcdGeneralPath. In case the current position is undefined, nothing is appended.
      Specified by:
      appendVerticalLineTo in interface ILcdGXYPen
      Parameters:
      aDeltaY - the amount by which the model y coordinate of the current position is translated
      aModelXYWorldTransformation - the transformation between model and world coordinates
      aGeneralPathSFCT - the general path to which the line is appended
    • appendPointList

      public void appendPointList(ILcdPointList aPointList, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGeneralPath aGeneralPathSFCT)
      Description copied from interface: ILcdGXYPen
      Appends a polyline to the given ILcdGeneralPath. The polyline is given as an ILcdPointList of which the points are specified in model coordinates. These model coordinates are transformed to world coordinates by means of the given ILcdModelXYWorldTransformation. If a model point is outside the valid area of this transformation, a line break is appended to the given ILcdGeneralPath so that the polyline is split.
      Specified by:
      appendPointList in interface ILcdGXYPen
      Parameters:
      aPointList - the point list (specified in model coordinates)
      aModelXYWorldTransformation - the transformation between model and world coordinates
      aGeneralPathSFCT - the general path to which the given point list is appended
    • appendArc

      public void appendArc(ILcdPoint aCenter, double aA, double aB, double aRotAngle, double aStartAngle, double aArcAngle, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGeneralPath aGeneralPathSFCT) throws TLcdOutOfBoundsException
      Description copied from interface: ILcdGXYPen
      Appends a polyline approximation of the given arc to the given ILcdGeneralPath. The arc is specified as a segment of the circumference of an ellipse. The given ILcdModelXYWorldTransformation is used to transform model coordinates to world coordinates.
      Specified by:
      appendArc in interface ILcdGXYPen
      Parameters:
      aCenter - the center of the ellipse (specified in model coordinates)
      aA - the semi-major axis of the ellipse
      aB - the semi-minor axis of the ellipse
      aRotAngle - the rotation angle of the major axis of the ellipse (expressed in degrees). Positive angles are measured counter-clockwise from the line at 3 o'clock.
      aStartAngle - the start angle of the arc (expressed in degrees). Positive angles are measured counter-clockwise from the line at 3 o'clock.
      aArcAngle - the span of the arc (expressed in degrees), increasing counterclockwise from the start angle
      aModelXYWorldTransformation - the transformation between model and world coordinates
      aGeneralPathSFCT - the general path to which the polyline approximation of the given arc is appended
      Throws:
      TLcdOutOfBoundsException - Some implementations may throw an exception in case the center of the ellipse is outside the valid area of the transformation but this could be avoided by more advanced implementations.
      See Also:
    • drawArc

      public void drawArc(double aCenterX, double aCenterY, double aStartX, double aStartY, double aArcAngle, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation, Graphics aGraphics) throws TLcdOutOfBoundsException
      Description copied from interface: ILcdGXYPen
      Draws a circular arc onto the given Graphics. The circular arc is specified by the center of the circle, a point on the circumference of the circle which denotes the start point of the arc and the angle spanned by the arc. The given ILcdModelXYWorldTransformation and ILcdGXYViewXYWorldTransformation are used to transform between model coordinates and AWT coordinates.
      Specified by:
      drawArc in interface ILcdGXYPen
      Parameters:
      aCenterX - the AWT x coordinate of the center of the circle
      aCenterY - the AWT y coordinate of the center of the circle
      aStartX - the AWT x coordinate of the start point of the arc
      aStartY - the AWT y coordinate of the start point of the arc
      aArcAngle - the span of the arc (expressed in degrees), increasing counterclockwise from the start angle
      aModelXYWorldTransformation - the transformation between model and world coordinates
      aGXYViewXYWorldTransformation - the transformation between world and view coordinates
      aGraphics - the Graphics onto which the arc is drawn
      Throws:
      TLcdOutOfBoundsException - Some implementations may throw an exception in case one of the defining points of the circular arc and/or one of the points of the arc is outside the valid area of the transformation but this could be avoided by more advanced implementations.
    • modelDistance

      public double modelDistance(double aX1, double aY1, double aX2, double aY2, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation) throws TLcdOutOfBoundsException
      Description copied from interface: ILcdGXYPen
      Calculates the model distance between the two given points expressed in AWT coordinates. These AWT coordinates are transformed to model coordinates by means of the given ILcdModelXYWorldTransformation and ILcdGXYViewXYWorldTransformation.
      Specified by:
      modelDistance in interface ILcdGXYPen
      Parameters:
      aX1 - the x-coordinate of the first AWT point
      aY1 - the y-coordinate of the first AWT point
      aX2 - the x-coordinate of the second AWT point
      aY2 - the y-coordinate of the second AWT point
      aModelXYWorldTransformation - the transformation between model and world coordinates
      aGXYViewXYWorldTransformation - the transformation between world and view coordinates
      Returns:
      the distance between the two given points within the model coordinate system
      Throws:
      TLcdOutOfBoundsException - If one of the two given points is outside the valid area of the given ILcdModelXYWorldTransformation.
    • lineBoundsSFCT

      public void lineBoundsSFCT(ILcdPoint aPoint1, ILcdPoint aPoint2, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation, ILcd2DEditableBounds aBoundsSFCT) throws TLcdNoBoundsException
      Description copied from interface: ILcdGXYPen
      Calculates the bounding box in AWT coordinates of the line between the two given model points. The model coordinates are transformed to AWT coordinates by means of the given ILcdModelXYWorldTransformation and ILcdGXYViewXYWorldTransformation.
      Specified by:
      lineBoundsSFCT in interface ILcdGXYPen
      Overrides:
      lineBoundsSFCT in class ALcdGXYPen
      Parameters:
      aPoint1 - the start point of the line (specified in model coordinates)
      aPoint2 - the end point of the line (specified in model coordinates)
      aModelXYWorldTransformation - the transformation between model and world coordinates
      aGXYViewXYWorldTransformation - the transformation between world and view coordinates
      aBoundsSFCT - the bounding box in AWT coordinates of the given line on completion of the method
      Throws:
      TLcdNoBoundsException - If the line is outside the valid area of the given ILcdModelXYWorldTransformation.
    • polylineBoundsSFCT

      public void polylineBoundsSFCT(ILcdPointList aPointList, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation, ILcd2DEditableBounds aBoundsSFCT) throws TLcdNoBoundsException
      Description copied from interface: ILcdGXYPen
      Calculates the bounding box in AWT coordinates of the given polyline. The polyline is given as an ILcdPointList of which the points are specified in model coordinates. These model coordinates are transformed to AWT coordinates by means of the given ILcdModelXYWorldTransformation and ILcdGXYViewXYWorldTransformation.
      Specified by:
      polylineBoundsSFCT in interface ILcdGXYPen
      Overrides:
      polylineBoundsSFCT in class ALcdGXYPen
      Parameters:
      aPointList - the point list (specified in model coordinates)
      aModelXYWorldTransformation - the transformation between model and world coordinates
      aGXYViewXYWorldTransformation - the transformation between world and view coordinates
      aBoundsSFCT - the bounding box in AWT coordinates of the given polyline on completion of the method
      Throws:
      TLcdNoBoundsException - If the polyline is outside the valid area of the given ILcdModelXYWorldTransformation.
    • isLineTouched

      public boolean isLineTouched(ILcdPoint aPoint1, ILcdPoint aPoint2, double aXView, double aYView, boolean aIncludeHotPoint, int aSensitivity, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation)
      Description copied from interface: ILcdGXYPen
      Tests if a given line is touched by clicking at the given AWT point. The line is specified by means of two given model points. Model coordinates are transformed to AWT coordinates by means of the given ILcdModelXYWorldTransformation and ILcdGXYViewXYWorldTransformation. The user can specify the allowed tolerance (aSensitivity) and whether the test should include the hot points (aIncludeHotPoint).
      Specified by:
      isLineTouched in interface ILcdGXYPen
      Overrides:
      isLineTouched in class ALcdGXYPen
      Parameters:
      aPoint1 - the start point of the line (specified in model coordinates)
      aPoint2 - the end point of the line (specified in model coordinates)
      aXView - the x-coordinate of the AWT point
      aYView - the y-coordinate of the AWT point
      aIncludeHotPoint - boolean indicating whether to include the hot points
      aSensitivity - the allowed tolerance (expressed in pixels)
      aModelXYWorldTransformation - the transformation between model and world coordinates
      aGXYViewXYWorldTransformation - the transformation between world and view coordinates
      Returns:
      a boolean indicating whether the given line is touched by the given AWT point
    • equals

      public boolean equals(Object aObject)
      Overrides:
      equals in class Object
    • 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 ILcdGXYPen
      Overrides:
      clone in class ALcdGXYPen
      See Also: