Class TLcdProjectionPen

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

public final class TLcdProjectionPen extends ALcdGXYPen implements ILcdGXYPen
ILcdGXYPen that paints and edits elementary shapes as if they were defined in the geodetic reference system of the world reference. The given model coordinates are assumed to be latitude longitude coordinates (the height is not used).

The straightLineMode property allows to control the level of accuracy versus the time efficiency of the line drawing. If true, only a coarse approximation of a geodesic is computed as straight lines between the end points of the line in the view reference system. This is the default mode. If false, a much better approximation of the geodesic is computed by adaptively calculating intermediate points on the true geodesic. Furthermore, lines, polylines and polygons are correctly broken if they cross a border of the projection area. Polygons are automatically broken into subpolygons if they cross one side and continue on the other side of the projection area.

See Also:
  • Constructor Details

    • TLcdProjectionPen

      public TLcdProjectionPen()
      Default constructor.
    • TLcdProjectionPen

      public TLcdProjectionPen(boolean aStraightLineMode)
      Constructor that sets the line drawing mode to aStraightLineMode.
      Parameters:
      aStraightLineMode - boolean indicating whether straight lines are sufficient to approximate geodesic lines.
    • TLcdProjectionPen

      public TLcdProjectionPen(TLcdProjectionPen aProjectionPen)
      Copy constructor.
      Parameters:
      aProjectionPen - the projection pen which has to be cloned
  • Method Details

    • setStraightLineMode

      public void setStraightLineMode(boolean aStraightLineMode)
      Sets the line drawing mode. If set to true, only a coarse approximation of a geodesic is computed as straight lines between the end points of the line in the view reference system. If set to false, a better approximation of the geodesic is computed by adaptively calculating intermediate points on the true geodesic.
      Parameters:
      aStraightLineMode - a boolean indicating whether to approximate geodesic lines with straight lines or not.
      See Also:
    • isStraightLineMode

      public boolean isStraightLineMode()
      Returns the current line drawing mode.
      Returns:
      a boolean indicating whether to approximate geodesic lines with straight lines or not.
      See Also:
    • 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.
    • isLineTouched

      public boolean isLineTouched(ILcdPoint aPoint1, ILcdPoint aPoint2, double aX, double aY, 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)
      aX - the x-coordinate of the AWT point
      aY - 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: