Class ALcdGXYPen
- All Implemented Interfaces:
ILcdCloneable
,ILcdGXYPen
,Serializable
,Cloneable
- Direct Known Subclasses:
TLcdGeodeticPen
,TLcdGridPen
,TLcdGXYPen
,TLcdProjectionPen
ILcdGXYPen
methods. It
also provides extra functionality which is described below.See
create(com.luciad.model.ILcdModelReference)
for default factory methods.
An ALcdGXYPen
allows to draw curves adaptively. Related methods are:
appendParameterizedPath
appendParameterizedPath
setMinRecursionDepth
getMinRecursionDepth
setMaxRecursionDepth
getMaxRecursionDepth
setViewDistanceThreshold
getViewDistanceThreshold
setWorldDistanceThreshold
getWorldDistanceThreshold
setAngleThreshold
getAngleThreshold
Extra line drawing methods are added as well:
An ALcdGXYPen
provides additional methods to use and/or manipulate the internal path:
Three extra methods are added related to picking objects:
An ALcdGXYPen
also provides additional methods to draw hot points:
Finally, several methods are provided which are only approximate but fast implementations of some of the
methods of the ILcdGXYPen
interface. This so-called "Cartesian mode" involves drawing straight lines, planar arcs, etc. Related methods are:
appendCartesianLineTo
appendCartesianLineTo
appendCartesianPolyline
appendCartesianPolyline
appendCartesianArc
appendCartesianArc
drawCartesianArc
cartesianModelDistance
isCartesianLineTouched
isCartesianArcTouched
This class is subject to change.
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Indicates the rendering quality of the pen. -
Field Summary
Modifier and TypeFieldDescriptionstatic final int
constant representing an arrow at the start of the linestatic final int
constant representing an arrow at both end points of the linestatic final int
constant representing an arrow at the end of the lineprotected ILcdAWTPath
an ILcdAWTPath used to accumulate a pathprotected Color
the current color of hot pointsprotected int
the hot point shape typeprotected int
the current size of hot points in screen pixelsprotected TLcdXYZPoint
the model coordinates of the current positionprotected TLcdXYPoint
the view coordinates of the current positionprotected TLcdXYPoint
the world coordinates of the current positionprotected boolean
Indicates whether the most recent attempt to move the current position was valid, that is to say whether the current position has valid model and world coordinates.static final int
constant representing an arrow in the middle of the line pointing to both the start and the end of the linestatic final int
constant representing an arrow in the middle of the line pointing to the start of the linestatic final int
constant representing an arrow in the middle of the line pointing to the end of the lineFields inherited from interface com.luciad.view.gxy.ILcdGXYPen
CIRCLE, FILLED_CIRCLE, FILLED_SQUARE, HORIZONTAL_CROSS, VERTICAL_CROSS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
accumulateArc
(ILcdPoint aCenter, double aA, double aB, double aRotAngle, double aStartAngle, double aArcAngle, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation) Accumulates a polyline approximation of the given arc to the internally stored path.void
accumulateAWTPoint
(double aX, double aY) Accumulates the given AWT point to the internally stored path.void
accumulateHorizontalLineTo
(double aDeltaX, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation) Accumulates a horizontal line starting from the current position to the internally stored path.void
accumulateLineTo
(ILcdPoint aPoint, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation) Accumulates a line from the current position to the given model point to the internally stored path.void
accumulatePointList
(ILcdPointList aPointList, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation) Accumulates a polyline to the internally stored path.void
Accumulates a line break to the internally stored path.void
accumulateVerticalLineTo
(double aDeltaY, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation) Accumulates a vertical line starting from the current position to the internally stored path.protected void
appendCartesianArc
(ILcdPoint aCenter, double aA, double aB, double aRotAngle, double aStartAngle, double aArcAngle, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGeneralPath aGeneralPathSFCT) Appends a polyline approximation of the given arc to the givenILcdGeneralPath
.protected void
appendCartesianArc
(ILcdPoint aCenter, double aA, double aB, double aRotAngle, double aStartAngle, double aArcAngle, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation, ILcdAWTPath aAWTPathSFCT) Appends a polyline approximation of the given arc to the givenILcdAWTPath
.protected void
appendCartesianLineTo
(ILcdPoint aPoint, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGeneralPath aGeneralPathSFCT) Appends a straight line between the world coordinates of the current position and the given model point to the givenILcdGeneralPath
.protected void
appendCartesianLineTo
(ILcdPoint aPoint, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation, ILcdAWTPath aAWTPathSFCT) Appends a straight line between the AWT coordinates of the current position and the given model point to the givenILcdAWTPath
.protected void
appendCartesianPolyline
(ILcdPointList aPointList, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGeneralPath aGeneralPathSFCT) Appends a polyline to the givenILcdGeneralPath
.protected void
appendCartesianPolyline
(ILcdPointList aPointList, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation, ILcdAWTPath aAWTPathSFCT) Appends a polyline to the givenILcdAWTPath
.void
appendCurve
(ILcdCurve aCurve, boolean aIncludingStartPoint, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGeneralPath aGeneralPathSFCT) Appends a polyline approximation of a curve to the givenILcdGeneralPath
.void
appendCurve
(ILcdCurve aCurve, boolean aIncludingStartPoint, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation, ILcdAWTPath aAWTPathSFCT) Appends a polyline approximation of a curve to the givenILcdAWTPath
.void
appendGeneralPath
(ILcdGeneralPath aGeneralPath, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation, ILcdAWTPath aAWTPathSFCT) Appends the givenILcdGeneralPath
to the givenILcdAWTPath
.void
appendParameterizedPath
(ILcdParameterizedPath aParameterizedPath, boolean aIncludingStartPoint, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGeneralPath aGeneralPathSFCT) Appends a polyline approximation of a curve to the givenILcdGeneralPath
.void
appendParameterizedPath
(ILcdParameterizedPath aParameterizedPath, boolean aIncludingStartPoint, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation, ILcdAWTPath aAWTPathSFCT) Appends a polyline approximation of a curve to the givenILcdAWTPath
.void
arcBoundsSFCT
(ILcdPoint aCenter, double aA, double aB, double aRotAngle, double aStartAngle, double aArcAngle, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation, ILcd2DEditableBounds aBoundsSFCT) Calculates the bounding box in AWT coordinates of the given arc.protected boolean
AWTPathContains
(ILcdAWTPath aAWTPath, double aX, double aY) Checks whether the polygon, specified as anILcdAWTPath
, encloses the given AWT point.void
calculateAccumulatedAWTBounds
(ILcd2DEditableBounds aBoundsSFCT) Calculates the bounding box of the internally stored path.protected double
cartesianModelDistance
(double aX1, double aY1, double aX2, double aY2, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation) Calculates an approximation of the model distance between the two given points expressed in AWT coordinates.clone()
MakesObject.clone()
public.boolean
contains
(ILcdPointList aPointList, double aX, double aY, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation) Checks whether the given polygon encloses the given AWT point.static ALcdGXYPen
create
(ILcdModelReference aModelReference) Creates a pen that suits the given model reference and gives fast rendering results.static ALcdGXYPen
create
(ILcdModelReference aModelReference, ALcdGXYPen.Quality aQuality) Creates a pen that suits the given model reference and using the given rendering quality.void
drawAccumulatedPolygon
(Graphics aGraphics, boolean aEmptyAccumulated) Draws the points stored in the internal path as a polygon.void
drawAccumulatedPolyline
(Graphics aGraphics, boolean aEmptyAccumulated) Draws the points stored in the internal path as a polyline.void
drawArc
(ILcdPoint aCenter, double aA, double aB, double aRotAngle, double aStartAngle, double aArcAngle, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation, Graphics aGraphics) Draws an arc onto the givenGraphics
.protected void
drawCartesianArc
(double aCenterX, double aCenterY, double aStartX, double aStartY, double aArcAngle, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation, Graphics aGraphics) Draws a circular arc onto the givenGraphics
.void
drawHorizontalLineTo
(double aDeltaX, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation, Graphics aGraphics) Draws a horizontal line from the current position to the given model point onto the givenGraphics
.void
drawHotPoint
(double aX, double aY, Graphics aGraphics) Draws a hot point at the given AWT point.void
drawHotPoint
(double aX, double aY, String aReference, Graphics aGraphics) Draws a hot point at the given AWT point and a string next to it.void
drawHotPoint
(ILcdPoint aPoint, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation, Graphics aGraphics) Draws a hot point at the given model point.void
drawHotPoint
(ILcdPoint aPoint, String aReference, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation, Graphics aGraphics) Draws a hot point at the given model point and a string next to this point.void
drawHotPoint
(Point aPoint, Graphics aGraphics) Deprecated.This method is deprecated to support HiDPI displays, which requires additional coordinate precision to accurately apply dpi scaling.void
drawLine
(int aFromX, int aFromY, int aToX, int aToY, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation, Graphics aGraphics) Deprecated.This method is deprecated to support HiDPI displays, which requires additional coordinate precision to accurately apply dpi scaling.void
drawLine
(ILcdPoint aPoint1, ILcdPoint aPoint2, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation, Graphics aGraphics) Draws a line between the two given model points onto the givenGraphics
.void
drawLineTo
(double aX, double aY, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation, Graphics aGraphics) Draws a line from the current position to the given AWT point onto the givenGraphics
.void
drawLineTo
(ILcdPoint aPoint, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation, Graphics aGraphics) Draws a line from the current position to the given model point onto the givenGraphics
.void
drawLineTo
(Point aPoint, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation, Graphics aGraphics) Draws a line from the current position to the given AWT point onto the givenGraphics
.void
drawLineWithArrow
(ILcdPoint aPoint1, ILcdPoint aPoint2, int aLength, double aAngle, int aArrowType, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation, Graphics aGraphics) Draws a line between the two given model points onto the givenGraphics
with arrows at either end or in the middle.void
drawPolygon
(ILcdPointList aPointList, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation, Graphics aGraphics) Draws a polygon onto the givenGraphics
.void
drawPolyline
(ILcdPointList aPointList, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation, Graphics aGraphics) Draws a polyline onto the givenGraphics
.void
drawVerticalLineTo
(double aDeltaY, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation, Graphics aGraphics) Draws a vertical line from the current position to the given model point onto the givenGraphics
.void
Clears the accumulated internal path.void
fillAccumulatedPolygon
(Graphics aGraphics, boolean aEmptyAccumulated) Draws the points stored in the internal path as a filled polygon.void
fillPolygon
(ILcdPointList aPointList, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation, Graphics aGraphics) Draws a filled polygon onto the givenGraphics
.double
Returns the current angle threshold.Gets the hot point color currently used by thisILcdGXYPen
.Gets the hot point icon currently used by thisILcdGXYPen
.int
Gets the hot point shape currently used by thisILcdGXYPen
.int
Gets the size of the shape currently representing a hot point.int
Returns the current maximum recursion depth value of the adaptive drawing algorithm.int
Returns the current minimum recursion depth value of the adaptive drawing algorithm.int
getTouchedSegment
(ILcdPointList aPointList, boolean aAsPolygon, double aX, double aY, boolean aIncludeHotPoints, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation) Gets the index of the line segment of the givenILcdPointList
which is touched by the given AWT point.double
Returns the current threshold on the distance between two consecutive points (view coordinates) of the polyline approximation.double
Returns the current threshold on the distance between two consecutive points (in world coordinates) of the polyline approximation.final int
getX()
Gets the AWT x coordinate of the current position of thisILcdGXYPen
.final double
Gets the AWT x coordinate of the current position of thisILcdGXYPen
.final int
getY()
Gets the AWT y coordinate of the current position of thisILcdGXYPen
.final double
Gets the AWT y coordinate of the current position of thisILcdGXYPen
.boolean
isAccumulatedPolylineTouched
(double aX, double aY, int aSensitivity) Checks whether the given AWT point touches the internally stored path.boolean
isArcTouched
(ILcdPoint aCenter, double aA, double aB, double aRotAngle, double aStartAngle, double aArcAngle, double aX, double aY, int aSensitivity, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation) Tests if the given arc is touched by clicking at the given AWT point taking into account the given tolerance.protected boolean
isCartesianArcTouched
(ILcdPoint aCenter, double aA, double aB, double aRotAngle, double aStartAngle, double aArcAngle, int aViewX, int aViewY, int aSensitivity, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation) Tests if the given arc is touched by clicking at the given AWT point taking into account the given tolerance.protected boolean
isCartesianLineTouched
(ILcdPoint aPoint1, ILcdPoint aPoint2, double aXView, double aYView, boolean aIncludeHotPoint, int aSensitivity, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation) Tests if a given line is touched by clicking at the given AWT point.boolean
isHorizontalLineTouched
(ILcdPoint aPoint, double aDeltaX, double aX, double aY, boolean aIncludeHotPoint, int aSensitivity, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation) Tests if a given horizontal line is touched by clicking at the given AWT point.boolean
isLineTouched
(ILcdPoint aPoint1, ILcdPoint aPoint2, double aX, double aY, boolean aIncludeHotPoint, int aSensitivity, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation) Tests if a given line is touched by clicking at the given AWT point.boolean
isTouched
(double aTargetX, double aTargetY, double aX, double aY, int aSensitivity) Tests if the given target AWT point is touched by clicking at the given AWT point.boolean
isTouched
(ILcdPoint aPoint, double aX, double aY, int aSensitivity, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation) Tests if the given model point is touched by clicking at the given AWT point.boolean
isVerticalLineTouched
(ILcdPoint aPoint, double aDeltaY, double aX, double aY, boolean aIncludeHotPoint, int aSensitivity, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation) Tests if a given vertical line is touched by clicking at the given AWT point.boolean
isViewLineTouched
(Point aPoint1, Point aPoint2, double aX, double aY, boolean aIncludeHotPoints, int aSensitivity) Tests if a given straight line is touched by clicking at the given AWT point.void
lineBoundsSFCT
(ILcdPoint aPoint1, ILcdPoint aPoint2, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation, ILcd2DEditableBounds aBoundsSFCT) Calculates the bounding box in AWT coordinates of the line between the two given model points.final void
moveTo
(double aX, double aY, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation) Moves the current position by setting its AWT coordinates to the given AWT point.final void
moveTo
(ILcdPoint aPoint, ILcdModelXYWorldTransformation aModelXYWorldTransformation) Moves the current position by setting its model coordinates to the given model point.final void
moveTo
(ILcdPoint aPoint, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation) Moves the current position by setting its model coordinates to the given model point.void
polylineBoundsSFCT
(ILcdPointList aPointList, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation, ILcd2DEditableBounds aBoundsSFCT) Calculates the bounding box in AWT coordinates of the given polyline.void
Makes the current position undefined so that it is not involved in the next drawing or append/accumulate operation.void
setAngleThreshold
(double aAngleThreshold) Sets the angle threshold.void
setHotPointColor
(Color aHotPointColor) Sets the hot point color.void
setHotPointIcon
(ILcdIcon aIcon) Sets the hot point icon.void
setHotPointShape
(int aHotPointShape) Sets the hot point shape.void
setHotPointSize
(int aHotPointSize) Sets the hot point size.void
setMaxRecursionDepth
(int aMaxRecursionDepth) Sets the maximum recursion depth of the adaptive drawing algorithm.void
setMinRecursionDepth
(int aMinRecursionDepth) Sets the minimum recursion depth of the adaptive drawing algorithm.void
setViewDistanceThreshold
(double aViewDistanceThreshold) Sets the threshold on the distance between two consecutive points (view coordinates) of the polyline approximation.void
setWorldDistanceThreshold
(double aWorldDistanceThreshold) Sets the threshold on the distance between two consecutive points (in world coordinates) of the polyline approximation.void
translateOf
(double aDeltaX, double aDeltaY, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation) Translates the AWT coordinates of the current position.Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.luciad.view.gxy.ILcdGXYPen
appendArc, appendArc, appendHorizontalLineTo, appendHorizontalLineTo, appendLineTo, appendLineTo, appendPointList, appendPointList, appendVerticalLineTo, appendVerticalLineTo, drawArc, modelDistance
-
Field Details
-
fLastViewPoint
the view coordinates of the current position -
fLastWorldPoint
the world coordinates of the current position -
fLastModelPoint
the model coordinates of the current position -
fValidMove
protected transient boolean fValidMoveIndicates whether the most recent attempt to move the current position was valid, that is to say whether the current position has valid model and world coordinates. This may or may not be the case when the current position is outside the valid area of the transformation between model and world coordinates. -
fAccumulatedAWTPath
an ILcdAWTPath used to accumulate a path -
fHotPointColor
the current color of hot points -
fHotPointSize
protected int fHotPointSizethe current size of hot points in screen pixels -
fHotPointShape
protected int fHotPointShapethe hot point shape type- See Also:
-
END_ARROW_TYPE
public static final int END_ARROW_TYPEconstant representing an arrow at the end of the line- See Also:
-
MIDDLE_TO_END_ARROW_TYPE
public static final int MIDDLE_TO_END_ARROW_TYPEconstant representing an arrow in the middle of the line pointing to the end of the line- See Also:
-
MIDDLE_TO_BEGIN_ARROW_TYPE
public static final int MIDDLE_TO_BEGIN_ARROW_TYPEconstant representing an arrow in the middle of the line pointing to the start of the line- See Also:
-
MIDDLE_BOTH_ARROW_TYPE
public static final int MIDDLE_BOTH_ARROW_TYPEconstant representing an arrow in the middle of the line pointing to both the start and the end of the line- See Also:
-
BEGIN_ARROW_TYPE
public static final int BEGIN_ARROW_TYPEconstant representing an arrow at the start of the line- See Also:
-
END_AND_BEGIN_ARROW_TYPE
public static final int END_AND_BEGIN_ARROW_TYPEconstant representing an arrow at both end points of the line- See Also:
-
-
Constructor Details
-
ALcdGXYPen
public ALcdGXYPen()Default constructor. -
ALcdGXYPen
Copy constructor.- Parameters:
aGXYPen
- the ALcdGXYPen to be copied
-
-
Method Details
-
create
Creates a pen that suits the given model reference and gives fast rendering results.- Parameters:
aModelReference
- the model reference that the pen should work with. Never null.- Since:
- 2017.1
- See Also:
-
create
Creates a pen that suits the given model reference and using the given rendering quality.- Parameters:
aModelReference
- the model reference that the pen should work with. Never null.aQuality
- the rendering quality to use. Never null.- Since:
- 2017.1
-
getX
public final int getX()Description copied from interface:ILcdGXYPen
Gets the AWT x coordinate of the current position of thisILcdGXYPen
.- Specified by:
getX
in interfaceILcdGXYPen
- Returns:
- the AWT x coordinate of the current position of this
ILcdGXYPen
-
getY
public final int getY()Description copied from interface:ILcdGXYPen
Gets the AWT y coordinate of the current position of thisILcdGXYPen
.- Specified by:
getY
in interfaceILcdGXYPen
- Returns:
- the AWT y coordinate of the current position of this
ILcdGXYPen
-
getXAsDouble
public final double getXAsDouble()Description copied from interface:ILcdGXYPen
Gets the AWT x coordinate of the current position of thisILcdGXYPen
.- Specified by:
getXAsDouble
in interfaceILcdGXYPen
- Returns:
- the AWT x coordinate of the current position of this
ILcdGXYPen
-
getYAsDouble
public final double getYAsDouble()Description copied from interface:ILcdGXYPen
Gets the AWT y coordinate of the current position of thisILcdGXYPen
.- Specified by:
getYAsDouble
in interfaceILcdGXYPen
- Returns:
- the AWT y coordinate of the current position of this
ILcdGXYPen
-
moveTo
public final void moveTo(ILcdPoint aPoint, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation) throws TLcdOutOfBoundsException Description copied from interface:ILcdGXYPen
Moves the current position by setting its model coordinates to the given model point. The world and AWT coordinates of the current position are updated by means of the givenILcdModelXYWorldTransformation
andILcdGXYViewXYWorldTransformation
.Setting the current position is only required - and should therefore only be used - to define the start point of a line. This is necessary in combination with one of the
drawLineTo
,drawHorizontalLineTo
, ordrawVerticalLineTo
methods or in case one adds a line to an empty (sub)path with one of theappendLineTo
oraccumulateLineTo
methods.Note that this method does not create a line break.
- Specified by:
moveTo
in interfaceILcdGXYPen
- Parameters:
aPoint
- the model point to which the current position is movedaModelXYWorldTransformation
- the transformation between model and world coordinatesaGXYViewXYWorldTransformation
- the transformation between world and view coordinates- Throws:
TLcdOutOfBoundsException
- If the given point is outside the valid area of the givenILcdModelXYWorldTransformation
.
-
moveTo
public final void moveTo(ILcdPoint aPoint, ILcdModelXYWorldTransformation aModelXYWorldTransformation) throws TLcdOutOfBoundsException Description copied from interface:ILcdGXYPen
Moves the current position by setting its model coordinates to the given model point. The world coordinates of the current position are updated by means of the givenILcdModelXYWorldTransformation
.Setting the current position is only required - and should therefore only be used - to define the start point of a line. This is necessary in combination with one of the
drawLineTo
,drawHorizontalLineTo
, ordrawVerticalLineTo
methods or in case one adds a line to an empty (sub)path with one of theappendLineTo
oraccumulateLineTo
methods.Note that this method does not create a line break.
- Specified by:
moveTo
in interfaceILcdGXYPen
- Parameters:
aPoint
- the model point to which the current position is movedaModelXYWorldTransformation
- the transformation between model and world coordinates- Throws:
TLcdOutOfBoundsException
- If the given point is outside the valid area of the givenILcdModelXYWorldTransformation
.
-
moveTo
public final void moveTo(double aX, double aY, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation) throws TLcdOutOfBoundsException Description copied from interface:ILcdGXYPen
Moves the current position by setting its AWT coordinates to the given AWT point. The world and model coordinates of the current position are updated by means of the givenILcdModelXYWorldTransformation
andILcdGXYViewXYWorldTransformation
.Setting the current position is only required - and should therefore only be used - to define the start point of a line. This is necessary in combination with one of the
drawLineTo
,drawHorizontalLineTo
, ordrawVerticalLineTo
methods or in case one adds a line to an empty (sub)path with one of theappendLineTo
oraccumulateLineTo
methods.Note that this method does not create a line break.
- Specified by:
moveTo
in interfaceILcdGXYPen
- Parameters:
aX
- the x coordinate of the AWT point to which the current position is movedaY
- the y coordinate of the AWT point to which the current position is movedaModelXYWorldTransformation
- the transformation between model and world coordinatesaGXYViewXYWorldTransformation
- the transformation between world and view coordinates- Throws:
TLcdOutOfBoundsException
- If the given point is outside the valid area of the givenILcdModelXYWorldTransformation
.
-
translateOf
public void translateOf(double aDeltaX, double aDeltaY, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation) throws TLcdOutOfBoundsException Description copied from interface:ILcdGXYPen
Translates the AWT coordinates of the current position. The world and model coordinates of the current position are updated by means of the givenILcdModelXYWorldTransformation
andILcdGXYViewXYWorldTransformation
.Setting the current position is only required - and should therefore only be used - to define the start point of a line. This is necessary in combination with one of the
drawLineTo
,drawHorizontalLineTo
, ordrawVerticalLineTo
methods or in case one adds a line to an empty (sub)path with one of theappendLineTo
oraccumulateLineTo
methods.Note that this method does not create a line break.
- Specified by:
translateOf
in interfaceILcdGXYPen
- Parameters:
aDeltaX
- the amount by which the AWT x coordinate of the current position is translatedaDeltaY
- the amount by which the AWT y coordinate of the current position is translatedaModelXYWorldTransformation
- the transformation between model and world coordinatesaGXYViewXYWorldTransformation
- the transformation between world and view coordinates- Throws:
TLcdOutOfBoundsException
- If the translated point is outside the valid area of the givenILcdModelXYWorldTransformation
-
resetPosition
public void resetPosition()Description copied from interface:ILcdGXYPen
Makes the current position undefined so that it is not involved in the next drawing or append/accumulate operation.- Specified by:
resetPosition
in interfaceILcdGXYPen
-
getMinRecursionDepth
public int getMinRecursionDepth()Returns the current minimum recursion depth value of the adaptive drawing algorithm.- Returns:
- the current minimum recursion depth value of the adaptive drawing algorithm
- See Also:
-
setMinRecursionDepth
public void setMinRecursionDepth(int aMinRecursionDepth) Sets the minimum recursion depth of the adaptive drawing algorithm. Its value should not be larger than the maximum recursion depth. The default is 0.- Parameters:
aMinRecursionDepth
- the minimum recursion depth- See Also:
-
getMaxRecursionDepth
public int getMaxRecursionDepth()Returns the current maximum recursion depth value of the adaptive drawing algorithm.- Returns:
- the current maximum recursion depth value of the adaptive drawing algorithm
- See Also:
-
setMaxRecursionDepth
public void setMaxRecursionDepth(int aMaxRecursionDepth) Sets the maximum recursion depth of the adaptive drawing algorithm. Its value should not be smaller than the minimum recursion depth. The default is 7.- Parameters:
aMaxRecursionDepth
- the maximum recursion depth- See Also:
-
getViewDistanceThreshold
public double getViewDistanceThreshold()Returns the current threshold on the distance between two consecutive points (view coordinates) of the polyline approximation. This threshold value is used as a stopcriterion by the adaptive drawing algorithm in case the polyline approximation is added to anILcdAWTPath
.- Returns:
- the current threshold value on the distance between two consecutive points (view coordinates) of the polyline approximation.
- See Also:
-
setViewDistanceThreshold
public void setViewDistanceThreshold(double aViewDistanceThreshold) Sets the threshold on the distance between two consecutive points (view coordinates) of the polyline approximation. This threshold value is used as a stopcriterion by the adaptive drawing algorithm in case the polyline approximation is added to anILcdAWTPath
. The default is 6 pixels.- Parameters:
aViewDistanceThreshold
- the threshold on the distance to be used by the adaptive drawing algorithm- See Also:
-
getWorldDistanceThreshold
public double getWorldDistanceThreshold()Returns the current threshold on the distance between two consecutive points (in world coordinates) of the polyline approximation. This threshold value is used as a stopcriterion by the adaptive drawing algorithm in case the polyline approximation is added to anILcdGeneralPath
.- Returns:
- the current threshold value on the distance between two consecutive points (world coordinates) of the polyline approximation.
- See Also:
-
setWorldDistanceThreshold
public void setWorldDistanceThreshold(double aWorldDistanceThreshold) Sets the threshold on the distance between two consecutive points (in world coordinates) of the polyline approximation. This threshold value is used as a stopcriterion by the adaptive drawing algorithm in case the polyline approximation is added to anILcdGeneralPath
. The default is 1000.- Parameters:
aWorldDistanceThreshold
- the threshold on the world distance to be used by the adaptive drawing algorithm- See Also:
-
getAngleThreshold
public double getAngleThreshold()Returns the current angle threshold. This threshold is used as a stopcriterion by the adaptive drawing algorithm in case the polyline approximation is added to anILcdAWTPath
or anILcdGeneralPath
. The angle corresponding to this threshold measures how much two consecutive line segments of the polyline approximation deviate from being parallel.- Returns:
- the current angle threshold (expressed in degrees) used by the adaptive drawing algorithm
- See Also:
-
setAngleThreshold
public void setAngleThreshold(double aAngleThreshold) Sets the angle threshold. This threshold value is used as a stopcriterion by the adaptive drawing algorithm in case the polyline approximation is added to anILcdAWTPath
or anILcdGeneralPath
. Its value should be between 0 and 90 degrees. The angle corresponding to this threshold measures how much two consecutive line segments of the polyline approximation deviate from being parallel. The default is 5 degrees.- Parameters:
aAngleThreshold
- the threshold on the angle (expressed in degrees) to be used by the adaptive drawing algorithm- Throws:
IllegalArgumentException
- If the given angle threshold is outside the valid range [0,90] degrees.- See Also:
-
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 givenGraphics
. The given model coordinates of the end point of the line are transformed to AWT coordinates by applying the givenILcdModelXYWorldTransformation
andILcdGXYViewXYWorldTransformation
.- Specified by:
drawLineTo
in interfaceILcdGXYPen
- Parameters:
aPoint
- the end point of the line (specified in model coordinates)aModelXYWorldTransformation
- the transformation between model and world coordinatesaGXYViewXYWorldTransformation
- the transformation between world and view coordinatesaGraphics
- 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 givenGraphics
. 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 givenILcdModelXYWorldTransformation
andILcdGXYViewXYWorldTransformation
.- Specified by:
drawHorizontalLineTo
in interfaceILcdGXYPen
- Parameters:
aDeltaX
- the amount by which the model x coordinate of the current position is translatedaModelXYWorldTransformation
- the transformation between model and world coordinatesaGXYViewXYWorldTransformation
- the transformation between world and view coordinatesaGraphics
- 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 givenGraphics
. 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 givenILcdModelXYWorldTransformation
andILcdGXYViewXYWorldTransformation
.- Specified by:
drawVerticalLineTo
in interfaceILcdGXYPen
- Parameters:
aDeltaY
- the amount by which the model y coordinate of the current position is translatedaModelXYWorldTransformation
- the transformation between model and world coordinatesaGXYViewXYWorldTransformation
- the transformation between world and view coordinatesaGraphics
- 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 givenGraphics
. The given AWT coordinates of the end point of the line are transformed to model coordinates by applying the givenILcdModelXYWorldTransformation
andILcdGXYViewXYWorldTransformation
.- Specified by:
drawLineTo
in interfaceILcdGXYPen
- Parameters:
aX
- the AWT x coordinate of the point to which a line is drawnaY
- the AWT y coordinate of the point to which a line is drawnaModelXYWorldTransformation
- the transformation between model and world coordinatesaGXYViewXYWorldTransformation
- the transformation between world and view coordinatesaGraphics
- 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 givenGraphics
. The given AWT coordinates of the end point of the line are transformed to model coordinates by applying the givenILcdModelXYWorldTransformation
andILcdGXYViewXYWorldTransformation
.- Parameters:
aPoint
- the point (expressed in AWT coordinates) to which a line is drawnaModelXYWorldTransformation
- the transformation between model and world coordinatesaGXYViewXYWorldTransformation
- the transformation between world and view coordinatesaGraphics
- 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.
-
accumulateSplit
public void accumulateSplit()Accumulates a line break to the internally stored path. -
accumulateAWTPoint
public void accumulateAWTPoint(double aX, double aY) Accumulates the given AWT point to the internally stored path.- Parameters:
aX
- the x coordinate of the AWT pointaY
- the y coordinate of the AWT point
-
isAccumulatedPolylineTouched
public boolean isAccumulatedPolylineTouched(double aX, double aY, int aSensitivity) Checks whether the given AWT point touches the internally stored path.- Parameters:
aX
- the x coordinate of the AWT pointaY
- the y coordinate of the AWT pointaSensitivity
- the allowed tolerance expressed in pixels- Returns:
- boolean indicating whether the given AWT point touches the internally stored path
-
calculateAccumulatedAWTBounds
public void calculateAccumulatedAWTBounds(ILcd2DEditableBounds aBoundsSFCT) throws TLcdNoBoundsException Calculates the bounding box of the internally stored path. The size of the hot points is taken into account.- Parameters:
aBoundsSFCT
- the bounding box of the internally stored path on completion of the method- Throws:
TLcdNoBoundsException
- If the object does not have bounds.
-
emptyAccumulated
public void emptyAccumulated()Description copied from interface:ILcdGXYPen
Clears the accumulated internal path.- Specified by:
emptyAccumulated
in interfaceILcdGXYPen
- See Also:
-
accumulateLineTo
public void accumulateLineTo(ILcdPoint aPoint, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation) throws TLcdOutOfBoundsException Description copied from interface:ILcdGXYPen
Accumulates a line from the current position to the given model point to the internally stored path. The given model coordinates of the end point of the line are transformed to AWT coordinates by means of the givenILcdModelXYWorldTransformation
andILcdGXYViewXYWorldTransformation
.Note that nothing is painted yet.
- Specified by:
accumulateLineTo
in interfaceILcdGXYPen
- Parameters:
aPoint
- the end point (specified in model coordinates) of the lineaModelXYWorldTransformation
- the transformation between model and world coordinatesaGXYViewXYWorldTransformation
- the transformation between world and view coordinates- Throws:
TLcdOutOfBoundsException
- Some implementations may throw an exception in case the given model point is outside the valid area of the transformation but this could be avoided by more advanced implementations.- See Also:
-
accumulateHorizontalLineTo
public void accumulateHorizontalLineTo(double aDeltaX, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation) throws TLcdOutOfBoundsException Description copied from interface:ILcdGXYPen
Accumulates a horizontal line starting from the current position to the internally stored path. 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 givenILcdModelXYWorldTransformation
andILcdGXYViewXYWorldTransformation
.Note that nothing is painted yet.
- Specified by:
accumulateHorizontalLineTo
in interfaceILcdGXYPen
- Parameters:
aDeltaX
- the amount by which the model x coordinate of the current position is translatedaModelXYWorldTransformation
- the transformation between model and world coordinatesaGXYViewXYWorldTransformation
- the transformation between world and view coordinates- Throws:
TLcdOutOfBoundsException
- Some implementations may throw an exception in case the end point of the line is outside the valid area of the transformation but this could be avoided by more advanced implementations.
-
accumulateVerticalLineTo
public void accumulateVerticalLineTo(double aDeltaY, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation) throws TLcdOutOfBoundsException Description copied from interface:ILcdGXYPen
Accumulates a vertical line starting from the current position to the internally stored path. 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 givenILcdModelXYWorldTransformation
andILcdGXYViewXYWorldTransformation
.Note that nothing is painted yet.
- Specified by:
accumulateVerticalLineTo
in interfaceILcdGXYPen
- Parameters:
aDeltaY
- the amount by which the model y coordinate of the current position is translatedaModelXYWorldTransformation
- the transformation between model and world coordinatesaGXYViewXYWorldTransformation
- the transformation between world and view coordinates- Throws:
TLcdOutOfBoundsException
- Some implementations may throw an exception in case the end point of the line is outside the valid area of the transformation but this could be avoided by more advanced implementations.
-
accumulatePointList
public void accumulatePointList(ILcdPointList aPointList, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation) throws TLcdOutOfBoundsException Description copied from interface:ILcdGXYPen
Accumulates a polyline to the internally stored path. The polyline is given as anILcdPointList
of which the points are specified in model coordinates. These model coordinates are transformed to AWT coordinates by means of the givenILcdModelXYWorldTransformation
andILcdGXYViewXYWorldTransformation
.Note that nothing is painted yet.
- Specified by:
accumulatePointList
in interfaceILcdGXYPen
- Parameters:
aPointList
- the point list (specified in model coordinates)aModelXYWorldTransformation
- the transformation between model and world coordinatesaGXYViewXYWorldTransformation
- the transformation between world and view coordinates- Throws:
TLcdOutOfBoundsException
- Some implementations may throw an exception in case one of the points of the polyline is outside the valid area of the transformation but this could be avoided by more advanced implementations.- See Also:
-
accumulateArc
public void accumulateArc(ILcdPoint aCenter, double aA, double aB, double aRotAngle, double aStartAngle, double aArcAngle, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation) throws TLcdOutOfBoundsException Description copied from interface:ILcdGXYPen
Accumulates a polyline approximation of the given arc to the internally stored path. The arc is specified as a segment of the circumference of an ellipse. The givenILcdModelXYWorldTransformation
andILcdGXYViewXYWorldTransformation
are used to transform model coordinates to AWT coordinates.Note that nothing is painted yet.
- Specified by:
accumulateArc
in interfaceILcdGXYPen
- Parameters:
aCenter
- the center of the ellipse (specified in model coordinates)aA
- the semi-major axis of the ellipseaB
- the semi-minor axis of the ellipseaRotAngle
- 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 angleaModelXYWorldTransformation
- the transformation between model and world coordinatesaGXYViewXYWorldTransformation
- the transformation between world and view coordinates- Throws:
TLcdOutOfBoundsException
- Some implementations may throw an exception in case the center of the ellipse and/or one of the points of the polyline approximation to the arc are outside the valid area of the transformation but this could be avoided by more advanced implementations.- See Also:
-
drawAccumulatedPolyline
Description copied from interface:ILcdGXYPen
Draws the points stored in the internal path as a polyline. IfaEmptyAccumulated
istrue
, the internal path is cleared after the drawing operation.- Specified by:
drawAccumulatedPolyline
in interfaceILcdGXYPen
- Parameters:
aGraphics
- theGraphics
onto which the polyline is drawnaEmptyAccumulated
- boolean indicating whether the internal path should be cleared
-
drawAccumulatedPolygon
Description copied from interface:ILcdGXYPen
Draws the points stored in the internal path as a polygon. IfaEmptyAccumulated
istrue
, the internal path is cleared after the drawing operation.- Specified by:
drawAccumulatedPolygon
in interfaceILcdGXYPen
- Parameters:
aGraphics
- theGraphics
onto which the polyline is drawnaEmptyAccumulated
- boolean indicating whether the internal path should be cleared
-
fillAccumulatedPolygon
Description copied from interface:ILcdGXYPen
Draws the points stored in the internal path as a filled polygon. IfaEmptyAccumulated
istrue
, the internal path is cleared after the drawing operation.- Specified by:
fillAccumulatedPolygon
in interfaceILcdGXYPen
- Parameters:
aGraphics
- theGraphics
onto which the polyline is drawnaEmptyAccumulated
- boolean indicating whether the internal path should be cleared
-
appendGeneralPath
public void appendGeneralPath(ILcdGeneralPath aGeneralPath, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation, ILcdAWTPath aAWTPathSFCT) Description copied from interface:ILcdGXYPen
Appends the givenILcdGeneralPath
to the givenILcdAWTPath
. The world coordinates of the points stored in the givenILcdGeneralPath
are transformed to AWT coordinates by means of the givenILcdGXYViewXYWorldTransformation
. If consecutive world points map to the same AWT point, the AWT path may be simplified in order to reduce memory requirements and improve the performance of further operations.- Specified by:
appendGeneralPath
in interfaceILcdGXYPen
- Parameters:
aGeneralPath
- the general path which is appended to the given AWT pathaGXYViewXYWorldTransformation
- the transformation between world and view coordinatesaAWTPathSFCT
- the AWT path to which the given general path is appended
-
drawLine
@Deprecated public void drawLine(int aFromX, int aFromY, int aToX, int aToY, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation, Graphics aGraphics) throws TLcdOutOfBoundsException Deprecated.This method is deprecated to support HiDPI displays, which requires additional coordinate precision to accurately apply dpi scaling. The recommendation is to usedrawLine(ILcdPoint, ILcdPoint, ILcdModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation, Graphics)
, which relies onILcdPoint
with double-precision coordinates.Draws a line between the two given AWT view points onto the givenGraphics
. The AWT coordinates of the end points of the line are transformed to model coordinates by applying the givenILcdModelXYWorldTransformation
andILcdGXYViewXYWorldTransformation
.- Parameters:
aFromX
- the AWT x-coordinate of the start point of the lineaFromY
- the AWT y-coordinate of the start point of the lineaToX
- the AWT x-coordinate of the end point of the lineaToY
- the AWT y-coordinate of the end point of the lineaModelXYWorldTransformation
- the transformation between model and world coordinatesaGXYViewXYWorldTransformation
- the transformation between world and view coordinatesaGraphics
- the Graphics onto which the line is drawn- Throws:
TLcdOutOfBoundsException
- The current implementation does not throw a TLcdOutOfBoundsException if one of the end points of the line is outside the valid area of the transformation.
-
drawLine
public void drawLine(ILcdPoint aPoint1, ILcdPoint aPoint2, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation, Graphics aGraphics) throws TLcdOutOfBoundsException Description copied from interface:ILcdGXYPen
Draws a line between the two given model points onto the givenGraphics
. The model coordinates of the end points of the line are transformed to AWT coordinates by applying the givenILcdModelXYWorldTransformation
andILcdGXYViewXYWorldTransformation
.- Specified by:
drawLine
in interfaceILcdGXYPen
- 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 coordinatesaGXYViewXYWorldTransformation
- the transformation between world and view coordinatesaGraphics
- the Graphics onto which the line is drawn- Throws:
TLcdOutOfBoundsException
- Some implementations may throw an exception in case one of the given end points of the line is outside the valid area of the transformation but this could be avoided by more advanced implementations.
-
drawLineWithArrow
public void drawLineWithArrow(ILcdPoint aPoint1, ILcdPoint aPoint2, int aLength, double aAngle, int aArrowType, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation, Graphics aGraphics) throws TLcdOutOfBoundsException Draws a line between the two given model points onto the givenGraphics
with arrows at either end or in the middle. The model coordinates of the end points of the line are transformed to AWT coordinates by applying the givenILcdModelXYWorldTransformation
andILcdGXYViewXYWorldTransformation
.- Parameters:
aPoint1
- the start point of the line, expressed in model coordinatesaPoint2
- the end point of the line, expressed in model coordinatesaLength
- length of the arrowhead, expressed in pixelsaAngle
- angle of the arrowhead, expressed in degreesaArrowType
- arrow type (END_ARROW_TYPE, MIDDLE_TO_END_ARROW_TYPE, MIDDLE_TO_BEGIN_ARROW_TYPE, MIDDLE_BOTH_ARROW_TYPE, BEGIN_ARROW_TYPE, END_AND_BEGIN_ARROW_TYPE)aModelXYWorldTransformation
- the transformation between model and world coordinatesaGXYViewXYWorldTransformation
- the transformation between world and view coordinatesaGraphics
- the Graphics onto which the line is drawn- Throws:
TLcdOutOfBoundsException
- The current implementation does not throw a TLcdOutOfBoundsException if one of the end points of the line is outside the valid area of the transformation.
-
drawPolyline
public void drawPolyline(ILcdPointList aPointList, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation, Graphics aGraphics) throws TLcdOutOfBoundsException Description copied from interface:ILcdGXYPen
Draws a polyline onto the givenGraphics
. The polyline is given as anILcdPointList
of which the points are specified in model coordinates. These model coordinates are transformed to AWT coordinates by means of the givenILcdModelXYWorldTransformation
andILcdGXYViewXYWorldTransformation
.- Specified by:
drawPolyline
in interfaceILcdGXYPen
- Parameters:
aPointList
- the point list (specified in model coordinates)aModelXYWorldTransformation
- the transformation between model and world coordinatesaGXYViewXYWorldTransformation
- the transformation between world and view coordinatesaGraphics
- the Graphics onto which the polyline is drawn- Throws:
TLcdOutOfBoundsException
- Some implementations may throw an exception in case one of the points of the polyline is outside the valid area of the transformation but this could be avoided by more advanced implementations.
-
drawPolygon
public void drawPolygon(ILcdPointList aPointList, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation, Graphics aGraphics) throws TLcdOutOfBoundsException Description copied from interface:ILcdGXYPen
Draws a polygon onto the givenGraphics
. The polygon is given as anILcdPointList
of which the points are specified in model coordinates. These model coordinates are transformed to AWT coordinates by means of the givenILcdModelXYWorldTransformation
andILcdGXYViewXYWorldTransformation
.- Specified by:
drawPolygon
in interfaceILcdGXYPen
- Parameters:
aPointList
- the point list (specified in model coordinates)aModelXYWorldTransformation
- the transformation between model and world coordinatesaGXYViewXYWorldTransformation
- the transformation between world and view coordinatesaGraphics
- the Graphics onto which the polygon is drawn- Throws:
TLcdOutOfBoundsException
- Some implementations may throw an exception in case one of the points of the polygon is outside the valid area of the transformation but this could be avoided by more advanced implementations.
-
fillPolygon
public void fillPolygon(ILcdPointList aPointList, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation, Graphics aGraphics) throws TLcdOutOfBoundsException Description copied from interface:ILcdGXYPen
Draws a filled polygon onto the givenGraphics
. The polygon is given as anILcdPointList
of which the points are specified in model coordinates. These model coordinates are transformed to AWT coordinates by means of the givenILcdModelXYWorldTransformation
andILcdGXYViewXYWorldTransformation
.- Specified by:
fillPolygon
in interfaceILcdGXYPen
- Parameters:
aPointList
- the point list (specified in model coordinates)aModelXYWorldTransformation
- the transformation between model and world coordinatesaGXYViewXYWorldTransformation
- the transformation between world and view coordinatesaGraphics
- the Graphics onto which the polygon is drawn- Throws:
TLcdOutOfBoundsException
- Some implementations may throw an exception in case one of the points of the polygon is outside the valid area of the transformation but this could be avoided by more advanced implementations.
-
drawArc
public void drawArc(ILcdPoint aCenter, double aA, double aB, double aRotAngle, double aStartAngle, double aArcAngle, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation, Graphics aGraphics) throws TLcdOutOfBoundsException Description copied from interface:ILcdGXYPen
Draws an arc onto the givenGraphics
. The arc is specified as a segment of the circumference of an ellipse. The givenILcdModelXYWorldTransformation
andILcdGXYViewXYWorldTransformation
are used to transform model coordinates to AWT coordinates.- Specified by:
drawArc
in interfaceILcdGXYPen
- Parameters:
aCenter
- the center of the ellipse (specified in model coordinates)aA
- the semi-major axis of the ellipseaB
- the semi-minor axis of the ellipseaRotAngle
- 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 angleaModelXYWorldTransformation
- the transformation between model and world coordinatesaGXYViewXYWorldTransformation
- the transformation between world and view coordinatesaGraphics
- the Graphics onto which the arc is drawn- Throws:
TLcdOutOfBoundsException
- Some implementations may throw an exception in case the center of the ellipse 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.- See Also:
-
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 givenILcdModelXYWorldTransformation
andILcdGXYViewXYWorldTransformation
.- Specified by:
lineBoundsSFCT
in interfaceILcdGXYPen
- 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 coordinatesaGXYViewXYWorldTransformation
- the transformation between world and view coordinatesaBoundsSFCT
- 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 givenILcdModelXYWorldTransformation
.
-
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 anILcdPointList
of which the points are specified in model coordinates. These model coordinates are transformed to AWT coordinates by means of the givenILcdModelXYWorldTransformation
andILcdGXYViewXYWorldTransformation
.- Specified by:
polylineBoundsSFCT
in interfaceILcdGXYPen
- Parameters:
aPointList
- the point list (specified in model coordinates)aModelXYWorldTransformation
- the transformation between model and world coordinatesaGXYViewXYWorldTransformation
- the transformation between world and view coordinatesaBoundsSFCT
- 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 givenILcdModelXYWorldTransformation
.
-
arcBoundsSFCT
public void arcBoundsSFCT(ILcdPoint aCenter, double aA, double aB, double aRotAngle, double aStartAngle, double aArcAngle, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation, ILcd2DEditableBounds aBoundsSFCT) throws TLcdNoBoundsException Description copied from interface:ILcdGXYPen
Calculates the bounding box in AWT coordinates of the given arc. The arc is specified as a segment of the circumference of an ellipse. The givenILcdModelXYWorldTransformation
andILcdGXYViewXYWorldTransformation
are used to transform model coordinates to AWT coordinates.- Specified by:
arcBoundsSFCT
in interfaceILcdGXYPen
- Parameters:
aCenter
- the center of the ellipse (specified in model coordinates)aA
- the semi-major axis of the ellipseaB
- the semi-minor axis of the ellipseaRotAngle
- 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 angleaModelXYWorldTransformation
- the transformation between model and world coordinatesaGXYViewXYWorldTransformation
- the transformation between world and view coordinatesaBoundsSFCT
- the bounding box in AWT coordinates of the given arc on completion of the method- Throws:
TLcdNoBoundsException
- If the given arc is outside the valid area of the givenILcdModelXYWorldTransformation
- See Also:
-
isTouched
public boolean isTouched(ILcdPoint aPoint, double aX, double aY, int aSensitivity, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation) Description copied from interface:ILcdGXYPen
Tests if the given model point is touched by clicking at the given AWT point. This is the case when the given AWT point is within a square of sizeaSensitivity
centered on the AWT coordinates of the given model point. These AWT coordinates are obtained from the given model coordinates by means of the givenILcdModelXYWorldTransformation
andILcdGXYViewXYWorldTransformation
.- Specified by:
isTouched
in interfaceILcdGXYPen
- Parameters:
aPoint
- the model pointaX
- the x-coordinate of the AWT pointaY
- the y-coordinate of the AWT pointaSensitivity
- the allowed tolerance (expressed in pixels)aModelXYWorldTransformation
- the transformation between model and world coordinatesaGXYViewXYWorldTransformation
- the transformation between world and view coordinates- Returns:
- a boolean indicating whether the given model point is touched by the given AWT point
-
isTouched
public boolean isTouched(double aTargetX, double aTargetY, double aX, double aY, int aSensitivity) Tests if the given target AWT point is touched by clicking at the given AWT point. This is the case when the given AWT point is within a square with sides of length twice theaSensitivity
and which is centered on the target AWT point.- Parameters:
aTargetX
- the x-coordinate of the target AWT pointaTargetY
- the y-coordinate of the target AWT pointaX
- the x-coordinate of the AWT pointaY
- the y-coordinate of the AWT pointaSensitivity
- the allowed tolerance (expressed in pixels)- Returns:
- If the given target AWT point is touched by clicking at the given AWT point.
-
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 givenILcdModelXYWorldTransformation
andILcdGXYViewXYWorldTransformation
. The user can specify the allowed tolerance (aSensitivity
) and whether the test should include the hot points (aIncludeHotPoint
).- Specified by:
isLineTouched
in interfaceILcdGXYPen
- 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 pointaY
- the y-coordinate of the AWT pointaIncludeHotPoint
- boolean indicating whether to include the hot pointsaSensitivity
- the allowed tolerance (expressed in pixels)aModelXYWorldTransformation
- the transformation between model and world coordinatesaGXYViewXYWorldTransformation
- the transformation between world and view coordinates- Returns:
- a boolean indicating whether the given line is touched by the given AWT point
-
isHorizontalLineTouched
public boolean isHorizontalLineTouched(ILcdPoint aPoint, double aDeltaX, double aX, double aY, boolean aIncludeHotPoint, int aSensitivity, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation) Description copied from interface:ILcdGXYPen
Tests if a given horizontal line is touched by clicking at the given AWT point. The horizontal line is specified by means of a start point (specified in model coordinates) and the amount by which the x coordinate of this point should be translated to obtain the end point. Model coordinates are transformed to AWT coordinates by means of the givenILcdModelXYWorldTransformation
andILcdGXYViewXYWorldTransformation
. The user can specify the allowed tolerance (aSensitivity
) and whether the test should include the hot points (aIncludeHotPoint
).- Specified by:
isHorizontalLineTouched
in interfaceILcdGXYPen
- Parameters:
aPoint
- the start point of the line (specified in model coordinates)aDeltaX
- the amount by which the x coordinate of the start point is translatedaX
- the x-coordinate of the AWT pointaY
- the y-coordinate of the AWT pointaIncludeHotPoint
- boolean indicating whether to include the hot pointsaSensitivity
- the allowed tolerance (expressed in pixels)aModelXYWorldTransformation
- the transformation between model and world coordinatesaGXYViewXYWorldTransformation
- the transformation between world and view coordinates- Returns:
- a boolean indicating whether the given line is touched by the given AWT point
-
isVerticalLineTouched
public boolean isVerticalLineTouched(ILcdPoint aPoint, double aDeltaY, double aX, double aY, boolean aIncludeHotPoint, int aSensitivity, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation) Description copied from interface:ILcdGXYPen
Tests if a given vertical line is touched by clicking at the given AWT point. The vertical line is specified by means of a start point (specified in model coordinates) and the amount by which the y coordinate of this point should be translated to obtain the end point. Model coordinates are transformed to AWT coordinates by means of the givenILcdModelXYWorldTransformation
andILcdGXYViewXYWorldTransformation
. The user can specify the allowed tolerance (aSensitivity
) and whether the test should include the hot points (aIncludeHotPoint
).- Specified by:
isVerticalLineTouched
in interfaceILcdGXYPen
- Parameters:
aPoint
- the start point of the line (specified in model coordinates)aDeltaY
- the amount by which the y coordinate of the start point is translatedaX
- the x-coordinate of the AWT pointaY
- the y-coordinate of the AWT pointaIncludeHotPoint
- boolean indicating whether to include the hot pointsaSensitivity
- the allowed tolerance (expressed in pixels)aModelXYWorldTransformation
- the transformation between model and world coordinatesaGXYViewXYWorldTransformation
- the transformation between world and view coordinates- Returns:
- a boolean indicating whether the given line is touched by the given AWT point
-
getTouchedSegment
public int getTouchedSegment(ILcdPointList aPointList, boolean aAsPolygon, double aX, double aY, boolean aIncludeHotPoints, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation) Description copied from interface:ILcdGXYPen
Gets the index of the line segment of the givenILcdPointList
which is touched by the given AWT point. IfaAsPolygon
equals true, the segment from the last point to the first point (the index of which equals one less than the number of points in theILcdPointList
) is taken into account as well.- Specified by:
getTouchedSegment
in interfaceILcdGXYPen
- Parameters:
aPointList
- the point list defining the line segmentsaAsPolygon
- boolean indicating whether the given point list should be considered as a polygon or not (in which case it is considered as a polyline)aX
- the x-coordinate of the AWT pointaY
- the y-coordinate of the AWT pointaIncludeHotPoints
- boolean indicating whether to include the hot pointsaModelXYWorldTransformation
- the transformation between model and world coordinatesaGXYViewXYWorldTransformation
- the transformation between world and view coordinates- Returns:
- the index of the touched line segment or -1 if no segment is touched
-
isArcTouched
public boolean isArcTouched(ILcdPoint aCenter, double aA, double aB, double aRotAngle, double aStartAngle, double aArcAngle, double aX, double aY, int aSensitivity, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation) Description copied from interface:ILcdGXYPen
Tests if the given arc is touched by clicking at the given AWT point taking into account the given tolerance. The arc is specified as a segment of the circumference of an ellipse. The givenILcdModelXYWorldTransformation
andILcdGXYViewXYWorldTransformation
are used to transform model coordinates to AWT coordinates.- Specified by:
isArcTouched
in interfaceILcdGXYPen
- Parameters:
aCenter
- the center of the ellipse (specified in model coordinates)aA
- the semi-major axis of the ellipseaB
- the semi-minor axis of the ellipseaRotAngle
- 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 angleaX
- the x-coordinate of the AWT pointaY
- the y-coordinate of the AWT pointaSensitivity
- the allowed tolerance (expressed in pixels)aModelXYWorldTransformation
- the transformation between model and world coordinatesaGXYViewXYWorldTransformation
- the transformation between world and view coordinates- Returns:
- a boolean indicating whether the given arc is touched by the given AWT point
- See Also:
-
contains
public boolean contains(ILcdPointList aPointList, double aX, double aY, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation) Description copied from interface:ILcdGXYPen
Checks whether the given polygon encloses the given AWT point. The polygon is given as anILcdPointList
containing points specified in model coordinates. Model coordinates are transformed to AWT coordinates by means of the givenILcdModelXYWorldTransformation
andILcdGXYViewXYWorldTransformation
.- Specified by:
contains
in interfaceILcdGXYPen
- Parameters:
aPointList
- the point list defining a polygonaX
- the x-coordinate of the AWT pointaY
- the y-coordinate of the AWT pointaModelXYWorldTransformation
- the transformation between model and world coordinatesaGXYViewXYWorldTransformation
- the transformation between world and view coordinates- Returns:
- a boolean indicating whether the given polygon encloses the given AWT point
-
AWTPathContains
Checks whether the polygon, specified as anILcdAWTPath
, encloses the given AWT point.- Parameters:
aAWTPath
- the AWT path defining a polygonaX
- the x-coordinate of the AWT pointaY
- the y-coordinate of the AWT point- Returns:
- a boolean indicating whether the polygon encloses the given AWT point.
-
getHotPointColor
Gets the hot point color currently used by thisILcdGXYPen
.- Returns:
- the hot point color currently used by this
ILcdGXYPen
. - See Also:
-
setHotPointColor
Sets the hot point color. Note that this value is not taken into account when a hot point icon is set.- Parameters:
aHotPointColor
- the hot point color to be set- See Also:
-
setHotPointShape
public void setHotPointShape(int aHotPointShape) Sets the hot point shape. Note that this value is not taken into account when a hot point icon is set.- Specified by:
setHotPointShape
in interfaceILcdGXYPen
- Parameters:
aHotPointShape
- the hot point shape to be set (ILcdGXYPen#FILLED_SQUARE, ILcdGXYPen#VERTICAL_CROSS, ILcdGXYPen#HORIZONTAL_CROSS, ILcdGXYPen#CIRCLE, ILcdGXYPen#FILLED_CIRCLE)- See Also:
-
getHotPointShape
public int getHotPointShape()Description copied from interface:ILcdGXYPen
Gets the hot point shape currently used by thisILcdGXYPen
.- Specified by:
getHotPointShape
in interfaceILcdGXYPen
- Returns:
- the hot point shape currently used by this
ILcdGXYPen
- See Also:
-
setHotPointSize
public void setHotPointSize(int aHotPointSize) Sets the hot point size. This size is half the width of the square representing a hot point. Note that this value is not taken into account when a hot point icon is set.- Specified by:
setHotPointSize
in interfaceILcdGXYPen
- Parameters:
aHotPointSize
- the hot point size (expressed in pixels)- See Also:
-
getHotPointSize
public int getHotPointSize()Gets the size of the shape currently representing a hot point. This size equals half the width of the square representing a hot point unless a hot point icon has been set, in which case it equals half of the maximum of the icon's width and height.- Specified by:
getHotPointSize
in interfaceILcdGXYPen
- Returns:
- the size of the shape currently representing a hot point
- See Also:
-
setHotPointIcon
Sets the hot point icon. If equal to null, an icon according to the values ingetHotPointShape()
,getHotPointSize()
andgetHotPointColor()
is rendered. The default value is null.- Parameters:
aIcon
- the icon to be used to render hot points- See Also:
-
getHotPointIcon
Gets the hot point icon currently used by thisILcdGXYPen
. If equal to null, an icon according to the values ingetHotPointShape()
,getHotPointSize()
andgetHotPointColor()
is rendered.- Returns:
- the hot point icon
- See Also:
-
drawHotPoint
public void drawHotPoint(ILcdPoint aPoint, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation, Graphics aGraphics) throws TLcdOutOfBoundsException Description copied from interface:ILcdGXYPen
Draws a hot point at the given model point. The model coordinates are transformed to AWT coordinates by means of the givenILcdModelXYWorldTransformation
andILcdGXYViewXYWorldTransformation
.- Specified by:
drawHotPoint
in interfaceILcdGXYPen
- Parameters:
aPoint
- the position at which the hot point is drawn (specified in model coordinates)aModelXYWorldTransformation
- the transformation between model and world coordinatesaGXYViewXYWorldTransformation
- the transformation between world and view coordinatesaGraphics
- the Graphics onto which the hot point is drawn- Throws:
TLcdOutOfBoundsException
- If the given model point is outside the valid area of the givenILcdModelXYWorldTransformation
.
-
drawHotPoint
public void drawHotPoint(ILcdPoint aPoint, String aReference, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation, Graphics aGraphics) throws TLcdOutOfBoundsException Draws a hot point at the given model point and a string next to this point. The model coordinates are transformed to AWT coordinates by means of the givenILcdModelXYWorldTransformation
andILcdGXYViewXYWorldTransformation
.- Parameters:
aPoint
- the position at which the hot point is drawn (expressed in model coordinates)aReference
- the string which has to be drawn next to the given model pointaModelXYWorldTransformation
- the transformation between model and world coordinatesaGXYViewXYWorldTransformation
- the transformation between world and view coordinatesaGraphics
- the Graphics onto which the hot point and the string are drawn- Throws:
TLcdOutOfBoundsException
- If the given model point is outside the valid area of the givenILcdModelXYWorldTransformation
.
-
drawHotPoint
Deprecated.This method is deprecated to support HiDPI displays, which requires additional coordinate precision to accurately apply dpi scaling. The recommendation is to usedrawHotPoint(double, double, Graphics)
, which uses double-precision coordinates.Draws a hot point at the given AWT point. This implementation checks whether a hot point icon has been set. If so, it renders the icon. Otherwise, an icon according to the values ingetHotPointShape()
,getHotPointSize()
andgetHotPointColor()
is rendered.- Parameters:
aPoint
- the position at which the hot point is drawn (expressed in AWT coordinates)aGraphics
- the Graphics onto which the hot point is drawn
-
drawHotPoint
Draws a hot point at the given AWT point. This implementation checks whether a hot point icon has been set. If so, it renders the icon. Otherwise, an icon according to the values ingetHotPointShape()
,getHotPointSize()
andgetHotPointColor()
is rendered.- Specified by:
drawHotPoint
in interfaceILcdGXYPen
- Parameters:
aX
- the AWT x coordinate of the position at which the hot point is drawnaY
- the AWT y coordinate of the position at which the hot point is drawnaGraphics
- the Graphics onto which the hot point is drawn
-
drawHotPoint
Draws a hot point at the given AWT point and a string next to it. This implementation checks whether a hot point icon has been set. If so, it renders the icon. Otherwise, an icon according to the values ingetHotPointShape()
,getHotPointSize()
andgetHotPointColor()
is rendered.- Parameters:
aX
- the AWT x coordinate of the position at which the hot point is drawnaY
- the AWT y coordinate of the position at which the hot point is drawnaReference
- the string which has to be drawn next to the hot pointaGraphics
- the Graphics onto which the hot point and the string are drawn
-
clone
Description copied from interface:ILcdCloneable
Makes
When for example extending fromObject.clone()
public.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 interfaceILcdCloneable
- Specified by:
clone
in interfaceILcdGXYPen
- Overrides:
clone
in classObject
- See Also:
-
appendCartesianLineTo
protected void appendCartesianLineTo(ILcdPoint aPoint, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation, ILcdAWTPath aAWTPathSFCT) Appends a straight line between the AWT coordinates of the current position and the given model point to the givenILcdAWTPath
. The given model coordinates of the end point of the line are transformed to AWT coordinates by means of the givenILcdModelXYWorldTransformation
andILcdGXYViewXYWorldTransformation
. If this model point is outside the valid area of the givenILcdModelXYWorldTransformation
or if the line crosses a border of the projection area, a line break is appended to the givenILcdAWTPath
.- Parameters:
aPoint
- the end point (expressed in model coordinates) of the lineaModelXYWorldTransformation
- the transformation between model and world coordinatesaGXYViewXYWorldTransformation
- the transformation between world and view coordinatesaAWTPathSFCT
- the AWT path to which the line is appended on return of the method
-
appendCartesianPolyline
protected void appendCartesianPolyline(ILcdPointList aPointList, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation, ILcdAWTPath aAWTPathSFCT) Appends a polyline to the givenILcdAWTPath
. A straight line is appended between the AWT coordinates of the points of the polyline. The polyline is given as anILcdPointList
of which the points are expressed in model coordinates. These model coordinates are transformed to AWT coordinates by means of the givenILcdModelXYWorldTransformation
andILcdGXYViewXYWorldTransformation
. If a model point is outside the valid area of the givenILcdModelXYWorldTransformation
or a line segment crosses the border of the projection area, a line break is appended to the givenILcdAWTPath
so that the polyline is split.- Parameters:
aPointList
- the point list, expressed in model coordinatesaModelXYWorldTransformation
- the transformation between model and world coordinatesaGXYViewXYWorldTransformation
- the transformation between world and view coordinatesaAWTPathSFCT
- the AWT path to which the given point list is appended on return of the method
-
appendCartesianArc
protected void appendCartesianArc(ILcdPoint aCenter, double aA, double aB, double aRotAngle, double aStartAngle, double aArcAngle, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation, ILcdAWTPath aAWTPathSFCT) Appends a polyline approximation of the given arc to the givenILcdAWTPath
. The arc is specified as a segment of the circumference of an ellipse. The givenILcdModelXYWorldTransformation
andILcdGXYViewXYWorldTransformation
are used to transform model coordinates to AWT coordinates. If a point is outside the valid area of the givenILcdModelXYWorldTransformation
, a line break is appended to the givenILcdAWTPath
so that the polyline is split.- Parameters:
aCenter
- the center of the ellipse, expressed in model coordinatesaA
- the semi-major axis of the ellipseaB
- the semi-minor axis of the ellipseaRotAngle
- 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 angleaModelXYWorldTransformation
- the transformation between model and world coordinatesaGXYViewXYWorldTransformation
- the transformation between world and view coordinatesaAWTPathSFCT
- the AWT path to which the polyline approximation of the given arc is appended- See Also:
-
appendCartesianLineTo
protected void appendCartesianLineTo(ILcdPoint aPoint, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGeneralPath aGeneralPathSFCT) Appends a straight line between the world coordinates of the current position and the given model point to the givenILcdGeneralPath
. The given model coordinates of the end point of the line are transformed to world coordinates by means of the givenILcdModelXYWorldTransformation
. If this point is outside the valid area of the transformation or if the line crosses a border of the projection area, a line break is appended to the givenILcdGeneralPath
.- Parameters:
aPoint
- the end point of the line, expressed in model coordinatesaModelXYWorldTransformation
- the transformation between model and world coordinatesaGeneralPathSFCT
- the general path to which the line is appended
-
appendCartesianPolyline
protected void appendCartesianPolyline(ILcdPointList aPointList, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGeneralPath aGeneralPathSFCT) Appends a polyline to the givenILcdGeneralPath
. A straight line is appended between the world coordinates of the points of the polyline. The polyline is given as anILcdPointList
of which the points are expressed in model coordinates. These model coordinates are transformed to world coordinates by means of the givenILcdModelXYWorldTransformation
. If a model point is outside the valid area of this transformation or a line segment crosses the border of the projection area, a line break is appended to the givenILcdGeneralPath
so that the polyline is split.- Parameters:
aPointList
- the point list, expressed in model coordinatesaModelXYWorldTransformation
- the transformation between model and world coordinatesaGeneralPathSFCT
- the general path to which the given point list is appended
-
appendCartesianArc
protected void appendCartesianArc(ILcdPoint aCenter, double aA, double aB, double aRotAngle, double aStartAngle, double aArcAngle, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGeneralPath aGeneralPathSFCT) Appends a polyline approximation of the given arc to the givenILcdGeneralPath
. The arc is specified as a segment of the circumference of an ellipse. The givenILcdModelXYWorldTransformation
is used to transform model coordinates to world coordinates. If a point is outside the valid area of this transformation, a line break is appended to the givenILcdGeneralPath
so that the polyline is split.- Parameters:
aCenter
- the center of the ellipse, expressed in model coordinatesaA
- the semi-major axis of the ellipseaB
- the semi-minor axis of the ellipseaRotAngle
- 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 angleaModelXYWorldTransformation
- the transformation between model and world coordinatesaGeneralPathSFCT
- the general path to which the polyline approximation of the given arc is appended- See Also:
-
drawCartesianArc
protected void drawCartesianArc(double aCenterX, double aCenterY, double aStartX, double aStartY, double aArcAngle, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation, Graphics aGraphics) throws TLcdOutOfBoundsException Draws a circular arc onto the givenGraphics
. 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 givenILcdModelXYWorldTransformation
andILcdGXYViewXYWorldTransformation
are used to transform between model coordinates and AWT coordinates.- Parameters:
aCenterX
- the AWT x coordinate of the center of the circleaCenterY
- the AWT y coordinate of the center of the circleaStartX
- the AWT x coordinate of the start point of the arcaStartY
- the AWT y coordinate of the start point of the arcaArcAngle
- the span of the arc (expressed in degrees), increasing counterclockwise from the start angleaModelXYWorldTransformation
- the transformation between model and world coordinatesaGXYViewXYWorldTransformation
- the transformation between world and view coordinatesaGraphics
- the Graphics onto which the arc is drawn- Throws:
TLcdOutOfBoundsException
- The current implementation does not throw a TLcdOutOfBoundsException if one of the defining points of the circular arc or one of the points of the arc is outside the valid area of the transformation.
-
cartesianModelDistance
protected double cartesianModelDistance(double aX1, double aY1, double aX2, double aY2, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation) throws TLcdOutOfBoundsException Calculates an approximation of the model distance between the two given points expressed in AWT coordinates. The distance is calculated after transforming the AWT coordinates to world coordinates assuming that this is a good approximation of the model distance.- Parameters:
aX1
- the x-coordinate of the first AWT pointaY1
- the y-coordinate of the first AWT pointaX2
- the x-coordinate of the second AWT pointaY2
- the y-coordinate of the second AWT pointaModelXYWorldTransformation
- the transformation between model and world coordinatesaGXYViewXYWorldTransformation
- the transformation between world and view coordinates- Returns:
- an approximation of the distance between the two given points within the model coordinate system
- Throws:
TLcdOutOfBoundsException
- The current implementation does not throw aTLcdOutOfBoundsException
.
-
isCartesianLineTouched
protected boolean isCartesianLineTouched(ILcdPoint aPoint1, ILcdPoint aPoint2, double aXView, double aYView, boolean aIncludeHotPoint, int aSensitivity, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation) 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 givenILcdModelXYWorldTransformation
andILcdGXYViewXYWorldTransformation
. The user can specify the allowed tolerance (aSensitivity
) and whether the test should include the hot points (aIncludeHotPoint
).- Parameters:
aPoint1
- the start point of the line, expressed in model coordinatesaPoint2
- the end point of the line, expressed in model coordinatesaXView
- the x-coordinate of the AWT pointaYView
- the y-coordinate of the AWT pointaIncludeHotPoint
- boolean indicating whether to include the hot pointsaSensitivity
- the allowed tolerance (expressed in pixels)aModelXYWorldTransformation
- the transformation between model and world coordinatesaGXYViewXYWorldTransformation
- the transformation between world and view coordinates- Returns:
- a boolean indicating whether the given line is touched by the given AWT point
-
isViewLineTouched
public boolean isViewLineTouched(Point aPoint1, Point aPoint2, double aX, double aY, boolean aIncludeHotPoints, int aSensitivity) Tests if a given straight line is touched by clicking at the given AWT point. The straight line is defined by means of two points expressed in AWT coordinates. The user can specify the allowed tolerance (aSensitivity
) and whether the test should include the hot points (aIncludeHotPoint
).- Parameters:
aPoint1
- the start point of the line, expressed in AWT coordinatesaPoint2
- the end point of the line, expressed in AWT coordinatesaX
- the x-coordinate of the AWT pointaY
- the y-coordinate of the AWT pointaIncludeHotPoints
- boolean indicating whether to include the hot pointsaSensitivity
- the allowed tolerance (expressed in pixels)- Returns:
- a boolean indicating whether the given line is touched by the given AWT point
-
isCartesianArcTouched
protected boolean isCartesianArcTouched(ILcdPoint aCenter, double aA, double aB, double aRotAngle, double aStartAngle, double aArcAngle, int aViewX, int aViewY, int aSensitivity, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation) Tests if the given arc is touched by clicking at the given AWT point taking into account the given tolerance. The arc is specified as a segment of the circumference of an ellipse. The givenILcdModelXYWorldTransformation
andILcdGXYViewXYWorldTransformation
are used to transform model coordinates to AWT coordinates.- Parameters:
aCenter
- the center of the ellipse, expressed in model coordinatesaA
- the semi-major axis of the ellipseaB
- the semi-minor axis of the ellipseaRotAngle
- 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 angleaViewX
- the x-coordinate of the AWT pointaViewY
- the y-coordinate of the AWT pointaSensitivity
- the allowed tolerance (expressed in pixels)aModelXYWorldTransformation
- the transformation between model and world coordinatesaGXYViewXYWorldTransformation
- the transformation between world and view coordinates- Returns:
- a boolean indicating whether the given arc is touched by the given AWT point
- See Also:
-
appendCurve
public void appendCurve(ILcdCurve aCurve, boolean aIncludingStartPoint, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation, ILcdAWTPath aAWTPathSFCT) Appends a polyline approximation of a curve to the givenILcdAWTPath
. The pen assumes C1 continuity of the curve (first derivatives are continuous).- Parameters:
aCurve
- the curve which has to be approximated.aIncludingStartPoint
- A boolean indicating whether the start point of the curve should be included.aModelXYWorldTransformation
- the transformation between model and world coordinatesaGXYViewXYWorldTransformation
- the transformation between world and view coordinatesaAWTPathSFCT
- an ILcdAWTPath to which the polyline approximation of the curve is added
-
appendCurve
public void appendCurve(ILcdCurve aCurve, boolean aIncludingStartPoint, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGeneralPath aGeneralPathSFCT) Appends a polyline approximation of a curve to the givenILcdGeneralPath
. The pen assumes C1 continuity of the curve (first derivatives are continuous).- Parameters:
aCurve
- the curve which has to be approximated.aIncludingStartPoint
- A boolean indicating whether the start point of the curve should be included.aModelXYWorldTransformation
- the transformation between model and world coordinatesaGeneralPathSFCT
- an ILcdGeneralPath to which the polyline approximation of the curve is added
-
appendParameterizedPath
public void appendParameterizedPath(ILcdParameterizedPath aParameterizedPath, boolean aIncludingStartPoint, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation, ILcdAWTPath aAWTPathSFCT) Appends a polyline approximation of a curve to the givenILcdAWTPath
.- Parameters:
aParameterizedPath
- An ILcdParameterizedPath describing the curve which has to be approximated.aIncludingStartPoint
- A boolean indicating whether the start point of the curve should be included.aModelXYWorldTransformation
- the transformation between model and world coordinatesaGXYViewXYWorldTransformation
- the transformation between world and view coordinatesaAWTPathSFCT
- an ILcdAWTPath to which the polyline approximation of the curve is added
-
appendParameterizedPath
public void appendParameterizedPath(ILcdParameterizedPath aParameterizedPath, boolean aIncludingStartPoint, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGeneralPath aGeneralPathSFCT) Appends a polyline approximation of a curve to the givenILcdGeneralPath
.- Parameters:
aParameterizedPath
- An ILcdParameterizedPath describing the curve which has to be approximated.aIncludingStartPoint
- A boolean indicating whether the start point of the curve should be included.aModelXYWorldTransformation
- the transformation between model and world coordinatesaGeneralPathSFCT
- an ILcdGeneralPath to which the polyline approximation of the curve is added
-