Class TLcdGridPen
- All Implemented Interfaces:
ILcdCloneable
,ILcdGXYPen
,Serializable
,Cloneable
ILcdGXYPen
suited for painting and editing elementary shapes defined in a
cartesian grid coordinate system.
Typically this will be shapes of models with an ILcdGridReference
.
The given model coordinates are assumed to be cartesian grid coordinates (the height is not used).
Straight lines in a grid coordinate system are generally curved in the view coordinate system
due to the projections applied when transforming from model to view coordinates.
The straightLineMode
property allows to control the level of accuracy versus the
time efficiency of the line drawing.
If true, only a coarse approximation of the curved line is computed as straight lines
between the end points of the line in the view reference system. This is the default mode.
If false, a much better approximation of the curved line is computed by adaptively calculating
intermediate points. Furthermore, lines, polylines and polygons are correctly broken if they cross a
border of the projection area. Polygons are automatically broken into subpolygons if they cross
one side and continue on the other side of the projection area.
TLcdGeodeticPen
for a pen implementation more suited for shapes defined in a geodetic reference system.- 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
ConstructorDescriptionDeprecated.TLcdGridPen
(boolean aStraightLineMode) Constructor that sets the line drawing mode toaStraightLineMode
.TLcdGridPen
(TLcdGridPen aGridPen) Copy constructor. -
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
.boolean
double
gridModelDistance
(double aX1, double aY1, double aX2, double aY2, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation) Calculates the model distance between the AWT view points defined by(aX1, aY1)
and(aX2, aY2)
, applying the givenILcdModelXYWorldTransformation
andILcdGXYViewXYWorldTransformation
.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
Returns the current line drawing mode.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
setStraightLineMode
(boolean aStraightLineMode) Sets the line drawing mode.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, drawHorizontalLineTo, drawHotPoint, drawHotPoint, drawHotPoint, drawHotPoint, drawHotPoint, drawLine, drawLine, drawLineTo, drawLineTo, drawLineTo, drawLineWithArrow, drawPolygon, drawPolyline, drawVerticalLineTo, 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, lineBoundsSFCT, moveTo, moveTo, moveTo, polylineBoundsSFCT, 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, drawHorizontalLineTo, drawHotPoint, drawHotPoint, drawLine, drawLineTo, drawLineTo, drawPolygon, drawPolyline, drawVerticalLineTo, emptyAccumulated, fillAccumulatedPolygon, fillPolygon, getHotPointShape, getHotPointSize, getTouchedSegment, getX, getXAsDouble, getY, getYAsDouble, isArcTouched, isHorizontalLineTouched, isTouched, isVerticalLineTouched, lineBoundsSFCT, moveTo, moveTo, moveTo, polylineBoundsSFCT, resetPosition, setHotPointShape, setHotPointSize, translateOf
-
Constructor Details
-
TLcdGridPen
public TLcdGridPen()Deprecated.useALcdGXYPen.create(com.luciad.model.ILcdModelReference)
to make sure you instantiate the correct pen for your modelDefault constructor. -
TLcdGridPen
public TLcdGridPen(boolean aStraightLineMode) Constructor that sets the line drawing mode toaStraightLineMode
.- Parameters:
aStraightLineMode
- boolean indicating whether straight lines in the view coordinate system are sufficient to approximate the curved lines which usually result from transforming a straight line from model to view coordinates
-
TLcdGridPen
Copy constructor.- Parameters:
aGridPen
- the grid pen which has to be cloned
-
-
Method Details
-
setStraightLineMode
public void setStraightLineMode(boolean aStraightLineMode) Sets the line drawing mode. If set totrue
, only straight lines are drawn between the end points of the line in the view coordinate system. If set tofalse
, a better approximation of the curved line is computed adaptively.- Parameters:
aStraightLineMode
- a boolean indicating whether straight lines in the view coordinate system are sufficient to approximate the curved lines which usually result from transforming a straight line from model to view coordinates- See Also:
-
isStraightLineMode
public boolean isStraightLineMode()Returns the current line drawing mode.- Returns:
- a boolean indicating whether to approximate the curved lines (which usually result from transforming straight lines from model to view coordinates) with straight lines or not.
- See Also:
-
appendLineTo
public void appendLineTo(ILcdPoint aPoint, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation, ILcdAWTPath aAWTPathSFCT) Description copied from interface:ILcdGXYPen
Appends a line from the current position to the given model point to the 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
.
-
gridModelDistance
public double gridModelDistance(double aX1, double aY1, double aX2, double aY2, ILcdModelXYWorldTransformation aModelXYWorldTransformation, ILcdGXYViewXYWorldTransformation aGXYViewXYWorldTransformation) throws TLcdOutOfBoundsException Calculates the model distance between the AWT view points defined by(aX1, aY1)
and(aX2, aY2)
, applying the givenILcdModelXYWorldTransformation
andILcdGXYViewXYWorldTransformation
.- Parameters:
aX1
- the x-value of the first screen coordinate.aY1
- the y-value of the first screen coordinate.aX2
- the x-value of the second screen coordinate.aY2
- the y-value of the second screen coordinate.aModelXYWorldTransformation
- the transformation between model and world coordinates.aGXYViewXYWorldTransformation
- the transformation between world and view coordinates.- Returns:
- the distance within the grid reference.
- Throws:
TLcdOutOfBoundsException
- if one of the points is outside the valid area of the transformation.
-
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
- 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)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
-
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