Package com.luciad.view.gxy
Class TLcdGXYPen
java.lang.Object
com.luciad.view.gxy.ALcdGXYPen
com.luciad.view.gxy.TLcdGXYPen
- All Implemented Interfaces:
ILcdCloneable
,ILcdGXYPen
,Serializable
,Cloneable
ILcdGXYPen
for painting and editing elementary shapes defined in a geodetic
model reference or grid reference with very high performance.
The given model coordinates are assumed to be latitude longitude coordinates
or cartesian grid coordinates (the height is not used).
Most of the methods are implemented in an approximate way for the sake of performance
(e.g. lines will be straight lines).
See TLcdGeodeticPen
and
TLcdGridPen
for more accurate pen implementations.- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.luciad.view.gxy.ALcdGXYPen
ALcdGXYPen.Quality
-
Field Summary
Fields inherited from class com.luciad.view.gxy.ALcdGXYPen
BEGIN_ARROW_TYPE, END_AND_BEGIN_ARROW_TYPE, END_ARROW_TYPE, fAccumulatedAWTPath, fHotPointColor, fHotPointShape, fHotPointSize, fLastModelPoint, fLastViewPoint, fLastWorldPoint, fValidMove, MIDDLE_BOTH_ARROW_TYPE, MIDDLE_TO_BEGIN_ARROW_TYPE, MIDDLE_TO_END_ARROW_TYPE
Fields inherited from interface com.luciad.view.gxy.ILcdGXYPen
CIRCLE, FILLED_CIRCLE, FILLED_SQUARE, HORIZONTAL_CROSS, VERTICAL_CROSS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
appendArc
(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
.void
appendArc
(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
.void
appendHorizontalLineTo
(double aDeltaX, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGeneralPath aGeneralPathSFCT) Appends a horizontal line starting from the current position to the givenILcdGeneralPath
.void
appendHorizontalLineTo
(double aDeltaX, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation, ILcdAWTPath aAWTPathSFCT) Appends a horizontal line starting from the current position to the givenILcdAWTPath
.void
appendLineTo
(ILcdPoint aPoint, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGeneralPath aGeneralPathSFCT) Appends a line from the current position to the given model point to the givenILcdGeneralPath
.void
appendLineTo
(ILcdPoint aPoint, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation, ILcdAWTPath aAWTPathSFCT) Appends a line from the current position to the given model point to the givenILcdAWTPath
.void
appendPointList
(ILcdPointList aPointList, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGeneralPath aGeneralPathSFCT) Appends a polyline to the givenILcdGeneralPath
.void
appendPointList
(ILcdPointList aPointList, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation, ILcdAWTPath aAWTPathSFCT) Appends a polyline to the givenILcdAWTPath
.void
appendVerticalLineTo
(double aDeltaY, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGeneralPath aGeneralPathSFCT) Appends a vertical line starting from the current position to the givenILcdGeneralPath
.void
appendVerticalLineTo
(double aDeltaY, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation, ILcdAWTPath aAWTPathSFCT) Appends a vertical line starting from the current position to the givenILcdAWTPath
.clone()
MakesObject.clone()
public.void
drawArc
(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
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
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
.boolean
boolean
isLineTouched
(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.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.double
modelDistance
(double aX1, double aY1, double aX2, double aY2, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation) Calculates the model distance between the two given points expressed in AWT coordinates.void
polylineBoundsSFCT
(ILcdPointList aPointList, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation, ILcd2DEditableBounds aBoundsSFCT) Calculates the bounding box in AWT coordinates of the given polyline.Methods inherited from class com.luciad.view.gxy.ALcdGXYPen
accumulateArc, accumulateAWTPoint, accumulateHorizontalLineTo, accumulateLineTo, accumulatePointList, accumulateSplit, accumulateVerticalLineTo, appendCartesianArc, appendCartesianArc, appendCartesianLineTo, appendCartesianLineTo, appendCartesianPolyline, appendCartesianPolyline, appendCurve, appendCurve, appendGeneralPath, appendParameterizedPath, appendParameterizedPath, arcBoundsSFCT, AWTPathContains, calculateAccumulatedAWTBounds, cartesianModelDistance, contains, create, create, drawAccumulatedPolygon, drawAccumulatedPolyline, drawArc, drawCartesianArc, drawHotPoint, drawHotPoint, drawHotPoint, drawHotPoint, drawHotPoint, drawLine, drawLine, drawLineWithArrow, drawPolygon, drawPolyline, emptyAccumulated, fillAccumulatedPolygon, fillPolygon, getAngleThreshold, getHotPointColor, getHotPointIcon, getHotPointShape, getHotPointSize, getMaxRecursionDepth, getMinRecursionDepth, getTouchedSegment, getViewDistanceThreshold, getWorldDistanceThreshold, getX, getXAsDouble, getY, getYAsDouble, isAccumulatedPolylineTouched, isArcTouched, isCartesianArcTouched, isCartesianLineTouched, isHorizontalLineTouched, isTouched, isTouched, isVerticalLineTouched, isViewLineTouched, moveTo, moveTo, moveTo, resetPosition, setAngleThreshold, setHotPointColor, setHotPointIcon, setHotPointShape, setHotPointSize, setMaxRecursionDepth, setMinRecursionDepth, setViewDistanceThreshold, setWorldDistanceThreshold, translateOf
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.luciad.view.gxy.ILcdGXYPen
accumulateArc, accumulateHorizontalLineTo, accumulateLineTo, accumulatePointList, accumulateVerticalLineTo, appendGeneralPath, arcBoundsSFCT, contains, drawAccumulatedPolygon, drawAccumulatedPolyline, drawArc, drawHotPoint, drawHotPoint, drawLine, drawPolygon, drawPolyline, emptyAccumulated, fillAccumulatedPolygon, fillPolygon, getHotPointShape, getHotPointSize, getTouchedSegment, getX, getXAsDouble, getY, getYAsDouble, isArcTouched, isHorizontalLineTouched, isTouched, isVerticalLineTouched, moveTo, moveTo, moveTo, resetPosition, setHotPointShape, setHotPointSize, translateOf
-
Constructor Details
-
TLcdGXYPen
public TLcdGXYPen()Deprecated.useALcdGXYPen.create(com.luciad.model.ILcdModelReference)
to make sure you instantiate the correct pen for your modelDefault constructor. -
TLcdGXYPen
Copy constructor.- Parameters:
aGXYPen
- theTLcdGXYPen
which has to be cloned
-
-
Method Details
-
drawLineTo
public void drawLineTo(ILcdPoint aPoint, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation, Graphics aGraphics) throws TLcdOutOfBoundsException Description copied from interface:ILcdGXYPen
Draws a line from the current position to the given model point onto the 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
- Overrides:
drawLineTo
in classALcdGXYPen
- 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
- Overrides:
drawHorizontalLineTo
in classALcdGXYPen
- 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
- Overrides:
drawVerticalLineTo
in classALcdGXYPen
- 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
- Overrides:
drawLineTo
in classALcdGXYPen
- 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
.- Overrides:
drawLineTo
in classALcdGXYPen
- Parameters:
aPoint
- the point (specified 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.
-
appendLineTo
public void appendLineTo(ILcdPoint aPoint, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation, ILcdAWTPath aAWTPathSFCT) Description copied from interface:ILcdGXYPen
Appends a line from the current position to the given model point to the 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
, a line break is appended to the givenILcdAWTPath
.- Specified by:
appendLineTo
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 coordinatesaAWTPathSFCT
- the AWT path to which the line is appended
-
appendHorizontalLineTo
public void appendHorizontalLineTo(double aDeltaX, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation, ILcdAWTPath aAWTPathSFCT) Description copied from interface:ILcdGXYPen
Appends a horizontal line starting from the current position to the givenILcdAWTPath
. 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
. If this model point is outside the valid area of the givenILcdModelXYWorldTransformation
, a line break is appended to the givenILcdAWTPath
. In case the current position is undefined, nothing is appended.- Specified by:
appendHorizontalLineTo
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 coordinatesaAWTPathSFCT
- the AWT path to which the line is appended
-
appendVerticalLineTo
public void appendVerticalLineTo(double aDeltaY, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation, ILcdAWTPath aAWTPathSFCT) Description copied from interface:ILcdGXYPen
Appends a vertical line starting from the current position to the givenILcdAWTPath
. 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
. If this model point is outside the valid area of the givenILcdModelXYWorldTransformation
, a line break is appended to the givenILcdAWTPath
. In case the current position is undefined, nothing is appended.- Specified by:
appendVerticalLineTo
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 coordinatesaAWTPathSFCT
- the AWT path to which the line is appended
-
appendPointList
public void appendPointList(ILcdPointList aPointList, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation, ILcdAWTPath aAWTPathSFCT) Description copied from interface:ILcdGXYPen
Appends a polyline to the givenILcdAWTPath
. 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
. If a model point is outside the valid area of the givenILcdModelXYWorldTransformation
, a line break is appended to the givenILcdAWTPath
so that the polyline is split.- Specified by:
appendPointList
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 coordinatesaAWTPathSFCT
- the AWT path to which the given point list is appended
-
appendArc
public void appendArc(ILcdPoint aCenter, double aA, double aB, double aRotAngle, double aStartAngle, double aArcAngle, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation, ILcdAWTPath aAWTPathSFCT) throws TLcdOutOfBoundsException Description copied from interface:ILcdGXYPen
Appends a polyline approximation of the given arc to the 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.- Specified by:
appendArc
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 coordinatesaAWTPathSFCT
- the AWT path to which the polyline approximation of the given arc is appended- Throws:
TLcdOutOfBoundsException
- Some implementations may throw an exception in case the center of the ellipse is outside the valid area of the transformation but this could be avoided by more advanced implementations.- See Also:
-
appendLineTo
public void appendLineTo(ILcdPoint aPoint, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGeneralPath aGeneralPathSFCT) Description copied from interface:ILcdGXYPen
Appends a line from the current position to the given model point to the 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, a line break is appended to the givenILcdGeneralPath
.- Specified by:
appendLineTo
in interfaceILcdGXYPen
- Parameters:
aPoint
- the end point (specified in model coordinates) of the lineaModelXYWorldTransformation
- the transformation between model and world coordinatesaGeneralPathSFCT
- the general path to which the line is appended
-
appendHorizontalLineTo
public void appendHorizontalLineTo(double aDeltaX, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGeneralPath aGeneralPathSFCT) Description copied from interface:ILcdGXYPen
Appends a horizontal line starting from the current position to the givenILcdGeneralPath
. The model coordinates of the end point of this line are obtained by translating the model x coordinate of the current position by the given amount. The model coordinates of the end point of the line are transformed to world coordinates by means of the givenILcdModelXYWorldTransformation
. If this point is outside the valid area of this transformation, a line break is appended to the givenILcdGeneralPath
. In case the current position is undefined, nothing is appended.- Specified by:
appendHorizontalLineTo
in interfaceILcdGXYPen
- Parameters:
aDeltaX
- the amount by which the model x coordinate of the current position is translatedaModelXYWorldTransformation
- the transformation between model and world coordinatesaGeneralPathSFCT
- the general path to which the line is appended
-
appendVerticalLineTo
public void appendVerticalLineTo(double aDeltaY, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGeneralPath aGeneralPathSFCT) Description copied from interface:ILcdGXYPen
Appends a vertical line starting from the current position to the givenILcdGeneralPath
. The model coordinates of the end point of this line are obtained by translating the model y coordinate of the current position by the given amount. The model coordinates of the end point of the line are transformed to world coordinates by means of the givenILcdModelXYWorldTransformation
. If this point is outside the valid area of this transformation, a line break is appended to the givenILcdGeneralPath
. In case the current position is undefined, nothing is appended.- Specified by:
appendVerticalLineTo
in interfaceILcdGXYPen
- Parameters:
aDeltaY
- the amount by which the model y coordinate of the current position is translatedaModelXYWorldTransformation
- the transformation between model and world coordinatesaGeneralPathSFCT
- the general path to which the line is appended
-
appendPointList
public void appendPointList(ILcdPointList aPointList, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGeneralPath aGeneralPathSFCT) Description copied from interface:ILcdGXYPen
Appends a polyline to the givenILcdGeneralPath
. The polyline is given as anILcdPointList
of which the points are specified 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, a line break is appended to the givenILcdGeneralPath
so that the polyline is split.- Specified by:
appendPointList
in interfaceILcdGXYPen
- Parameters:
aPointList
- the point list (specified in model coordinates)aModelXYWorldTransformation
- the transformation between model and world coordinatesaGeneralPathSFCT
- the general path to which the given point list is appended
-
appendArc
public void appendArc(ILcdPoint aCenter, double aA, double aB, double aRotAngle, double aStartAngle, double aArcAngle, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGeneralPath aGeneralPathSFCT) throws TLcdOutOfBoundsException Description copied from interface:ILcdGXYPen
Appends a polyline approximation of the given arc to the 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.- Specified by:
appendArc
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 coordinatesaGeneralPathSFCT
- the general path to which the polyline approximation of the given arc is appended- Throws:
TLcdOutOfBoundsException
- Some implementations may throw an exception in case the center of the ellipse is outside the valid area of the transformation but this could be avoided by more advanced implementations.- See Also:
-
drawArc
public void drawArc(double aCenterX, double aCenterY, double aStartX, double aStartY, double aArcAngle, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation, Graphics aGraphics) throws TLcdOutOfBoundsException Description copied from interface:ILcdGXYPen
Draws a circular arc onto the 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.- Specified by:
drawArc
in interfaceILcdGXYPen
- 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
- Some implementations may throw an exception in case one of the defining points of the circular arc and/or one of the points of the arc is outside the valid area of the transformation but this could be avoided by more advanced implementations.
-
modelDistance
public double modelDistance(double aX1, double aY1, double aX2, double aY2, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation) throws TLcdOutOfBoundsException Description copied from interface:ILcdGXYPen
Calculates the model distance between the two given points expressed in AWT coordinates. These AWT coordinates are transformed to model coordinates by means of the givenILcdModelXYWorldTransformation
andILcdGXYViewXYWorldTransformation
.- Specified by:
modelDistance
in interfaceILcdGXYPen
- 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:
- the distance between the two given points within the model coordinate system
- Throws:
TLcdOutOfBoundsException
- If one of the two given points is outside the valid area of the givenILcdModelXYWorldTransformation
.
-
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
- Overrides:
lineBoundsSFCT
in classALcdGXYPen
- 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
- Overrides:
polylineBoundsSFCT
in classALcdGXYPen
- 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
.
-
isLineTouched
public boolean isLineTouched(ILcdPoint aPoint1, ILcdPoint aPoint2, double aXView, double aYView, boolean aIncludeHotPoint, int aSensitivity, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation) Description copied from interface:ILcdGXYPen
Tests if a given line is touched by clicking at the given AWT point. The line is specified by means of two given model points. Model coordinates are transformed to AWT coordinates by means of the 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
- Overrides:
isLineTouched
in classALcdGXYPen
- Parameters:
aPoint1
- the start point of the line (specified in model coordinates)aPoint2
- the end point of the line (specified in model coordinates)aXView
- the x-coordinate of the AWT 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
-
equals
-
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 classALcdGXYPen
- See Also:
-
ALcdGXYPen.create(com.luciad.model.ILcdModelReference)
to make sure you instantiate the correct pen for your model