Class TLcdMapGridRulerController
- All Implemented Interfaces:
ILcdStatusSource
,ILcdGXYController
,MouseListener
,MouseMotionListener
,Serializable
,EventListener
ILcdGXYController
interprets mouse events for displaying a
distance between points on the screen.
Another, more advanced, ruler controller is available as well. Please refer to
TLcdAdvancedMapRulerController
.
Using this ILcdGXYController
method makes sense only when the
ILcdGXYView
it interacts with has a ILcdXYWorldReference
that is an instance of ILcdGridReference
.
This is useful when the model reference is the same as the world reference. In that case no transformations are necessary and the expensive geodesic calculations can be avoided by using cartesian methods. It is useful only within a limited region.
If the property popupDialog is true, it pops up a Dialog in which the distance and angle of the last segment drawn, as well as the total distance of all segments are displayed.
- See Also:
-
Constructor Summary
ConstructorDescriptionDeprecated.Default constructor for aMapRulerController
.TLcdMapGridRulerController
(boolean aRegisterFlag) Deprecated.use the constructor without parameters.TLcdMapGridRulerController
(ILcdModelReference aGridReference) Deprecated.TLcdMapGridRulerController
(ILcdModelReference aGridReference, boolean aRegisterFlag) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionprotected double
calculateAngle
(int aFromX, int aFromY, int aToX, int aToY) Deprecated.Calculates the azimuth between the model locations that are on screen at[aFromX,aFromY] and [aTox,aToY].protected double
calculateDistance
(int aFromX, int aFromY, int aToX, int aToY) Deprecated.Calculates the model distance in meters between the model locations that are on screen at[aFromX,aFromY] and [aTox,aToY].protected void
displayLastSegmentAngle
(double aAngle, MouseEvent me) Deprecated.protected void
displayLastSegmentDistance
(double aDistance, MouseEvent me) Deprecated.protected void
displayTotalDistance
(double aDistance, MouseEvent me) Deprecated.protected String
formatAngle
(double aAngle, MouseEvent me) Deprecated.Format the model azimuth aAngle in radians as a String.protected String
formatDistance
(double aDistance, MouseEvent me) Deprecated.Format the model distance aDistance in meters as a String.Deprecated.Deprecated.ghostColor is the property that holds the color of the lines and circle that are drawn.int
Deprecated.GhostLineWidth is the property that holds the width of the lines and circle that are drawn.double
Deprecated.double
Deprecated.double
Deprecated.boolean
Deprecated.The property drawEqualDistanceCurve determines whether to draw the circle.boolean
Deprecated.The property drawGeodesicLine determines whether to draw the lines.boolean
Deprecated.void
Deprecated.MouseEvent me is ignored.void
Deprecated.MouseEvent me is ignored.void
Deprecated.MouseEvent me is ignored.void
Deprecated.MouseEvent me is ignored.void
mouseMoved
(MouseEvent me) Deprecated.The mouse movement causes the drawing of a line between the mouse click points on the screen and the drawing of the circle spanning the distance between the last mouse clicking point and the current position.void
Deprecated.MouseEvent me is ignored.void
Deprecated.A mouse release causes the last location to be added to the list of points that are going to be linked.void
setActionListenerOnDoubleClick
(ActionListener aActionListener) Deprecated.void
setDrawEqualDistanceCurve
(boolean aDrawEqualDistanceCurve) Deprecated.The property drawEqualDistanceCurve determines whether to draw the circle.void
setDrawGeodesicLine
(boolean newDrawGeodesicLine) Deprecated.The property drawGeodesicLine determines whether to draw the lines.void
setGhostColor
(Color aGhostColor) Deprecated.ghostColor is the property that holds the color of the lines and circle that are drawn.void
setGhostLineWidth
(int aGhostLineWidth) Deprecated.GhostLineWidth is the property that holds the width of the lines and circle that are drawn.void
setPopupDialog
(boolean aPopupDialog) Deprecated.void
startInteraction
(ILcdGXYView aGXYView) Deprecated.This method calls super.startInteraction( aGXYView ).void
terminateInteraction
(ILcdGXYView aGXYView) Deprecated.Releases a few items.void
undo()
Deprecated.Performs no action.Methods inherited from class com.luciad.view.gxy.controller.ALcdGXYController
addStatusListener, asGXYController, fireStatusEvent, getCursor, getGXYView, getIcon, getName, getShortDescription, isTraceOn, paint, registerInstance, removeStatusListener, retrieveGXYViewXYWorldTransformation, setClassTraceOn, setCursor, setGXYView, setIcon, setName, setShortDescription, setTraceOn, viewRepaint
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.luciad.view.gxy.ILcdGXYController
getLayered
-
Constructor Details
-
TLcdMapGridRulerController
public TLcdMapGridRulerController()Deprecated.Default constructor for aMapRulerController
. -
TLcdMapGridRulerController
public TLcdMapGridRulerController(boolean aRegisterFlag) Deprecated.use the constructor without parameters. -
TLcdMapGridRulerController
Deprecated. -
TLcdMapGridRulerController
Deprecated.
-
-
Method Details
-
startInteraction
Deprecated.This method calls super.startInteraction( aGXYView ). Then, if the property popupDialog is true, it pops up a Dialog in which the distance and angle of the last segment drawn, as well as the total distance of all segments are displayed.Redefines formatDistance and formatAngle if you need to display these values with a specific unit of measure.
Redefine displayLastSegmentDistance, displayLastSegmentAngle and displayTotalDistance if you need to display all or some of these values differently.
- Specified by:
startInteraction
in interfaceILcdGXYController
- Overrides:
startInteraction
in classALcdGXYController
- Parameters:
aGXYView
- theILcdGXYView
thisILcdGXYController
will interact with.- See Also:
-
terminateInteraction
Deprecated.Description copied from class:ALcdGXYController
Releases a few items. Can be redefined but this 'super' method should be called too.- Specified by:
terminateInteraction
in interfaceILcdGXYController
- Overrides:
terminateInteraction
in classALcdGXYController
- Parameters:
aGXYView
- theILcdGXYView
thisILcdGXYController
interacted with.- See Also:
-
mouseMoved
Deprecated.The mouse movement causes the drawing of a line between the mouse click points on the screen and the drawing of the circle spanning the distance between the last mouse clicking point and the current position.- Specified by:
mouseMoved
in interfaceMouseMotionListener
-
displayLastSegmentDistance
Deprecated.- See Also:
-
displayLastSegmentAngle
Deprecated.- See Also:
-
displayTotalDistance
Deprecated.- See Also:
-
mouseReleased
Deprecated.A mouse release causes the last location to be added to the list of points that are going to be linked. A repetitive mouse release resets the list of points.- Specified by:
mouseReleased
in interfaceMouseListener
-
calculateDistance
protected double calculateDistance(int aFromX, int aFromY, int aToX, int aToY) Deprecated.Calculates the model distance in meters between the model locations that are on screen at[aFromX,aFromY] and [aTox,aToY].Using this method only makes sense when the
ILcdGXYView
thisILcdGXYController
interacts with has aILcdProjectionReference
as aILcdXYWorldReference
.- Returns:
- a distance in meters or -1.
-
calculateAngle
protected double calculateAngle(int aFromX, int aFromY, int aToX, int aToY) Deprecated.Calculates the azimuth between the model locations that are on screen at[aFromX,aFromY] and [aTox,aToY].Using this method makes sense only when the
ILcdGXYView
thisILcdGXYController
interacts with has aILcdProjectionReference
as aILcdXYWorldReference
. -
formatDistance
Deprecated.Format the model distance aDistance in meters as a String. Redefine this method to have the distances displayed with another unit of measure.- Returns:
"<aDistance>m"
ifaDistance < 100000
, in Km otherwise
-
formatAngle
Deprecated.Format the model azimuth aAngle in radians as a String. Redefine this method to have the distances displayed with another unit of measure.- Returns:
- aAngle expressed in degrees as a String
-
mouseDragged
Deprecated.MouseEvent me is ignored.- Specified by:
mouseDragged
in interfaceMouseMotionListener
-
mouseClicked
Deprecated.MouseEvent me is ignored.- Specified by:
mouseClicked
in interfaceMouseListener
-
mouseEntered
Deprecated.MouseEvent me is ignored.- Specified by:
mouseEntered
in interfaceMouseListener
-
mouseExited
Deprecated.MouseEvent me is ignored.- Specified by:
mouseExited
in interfaceMouseListener
-
mousePressed
Deprecated.MouseEvent me is ignored.- Specified by:
mousePressed
in interfaceMouseListener
-
getLastSegmentDistance
public double getLastSegmentDistance()Deprecated.- Returns:
- the distance of the last geodesic lines drawn. Calling that method can be useful when redefining the mouseMoved method for instance.
-
getLastSegmentAngle
public double getLastSegmentAngle()Deprecated.- Returns:
- the azimuth of the last geodesic lines drawn. Calling that method can be useful when redefining the mouseMoved method for instance.
-
getTotalDistance
public double getTotalDistance()Deprecated.- Returns:
- the current total distance of all geodesic lines drawn. Calling that method can be useful when redefining the mouseMoved method for instance.
-
undo
public void undo()Deprecated.Performs no action. -
setGhostColor
Deprecated.ghostColor is the property that holds the color of the lines and circle that are drawn. Sets the ghostColor to aGhostColor. -
getGhostColor
Deprecated.ghostColor is the property that holds the color of the lines and circle that are drawn. Returns the ghostColor. -
setGhostLineWidth
public void setGhostLineWidth(int aGhostLineWidth) Deprecated.GhostLineWidth is the property that holds the width of the lines and circle that are drawn. This property has an effect only for JVM versions upper that 1.2. For lower versions, the line width will be always 1.- Parameters:
aGhostLineWidth
- the line width to set.
-
getGhostLineWidth
public int getGhostLineWidth()Deprecated.GhostLineWidth is the property that holds the width of the lines and circle that are drawn. This property has an effect only for JVM versions upper that 1.2 For lower versions, the line width will be always 1.- Returns:
- the current line width.
-
isDrawEqualDistanceCurve
public boolean isDrawEqualDistanceCurve()Deprecated.The property drawEqualDistanceCurve determines whether to draw the circle.- Returns:
true
if drawEqualDistanceCurve istrue
, elsefalse
is returned.
-
setDrawEqualDistanceCurve
public void setDrawEqualDistanceCurve(boolean aDrawEqualDistanceCurve) Deprecated.The property drawEqualDistanceCurve determines whether to draw the circle. Sets drawEqualDistanceCurve to aDrawEqualDistanceCurve. -
isPopupDialog
public boolean isPopupDialog()Deprecated.- See Also:
-
setPopupDialog
public void setPopupDialog(boolean aPopupDialog) Deprecated.- See Also:
-
setDrawGeodesicLine
public void setDrawGeodesicLine(boolean newDrawGeodesicLine) Deprecated.The property drawGeodesicLine determines whether to draw the lines. Sets drawGeodesicLine to newDrawGeodesicLine. -
isDrawGeodesicLine
public boolean isDrawGeodesicLine()Deprecated.The property drawGeodesicLine determines whether to draw the lines.- Returns:
true
if drawGeodesicLine istrue
, elsefalse
is returned.
-
setActionListenerOnDoubleClick
Deprecated. -
getActionListenerOnDoubleClick
Deprecated.
-
TLcdAdvancedMapRulerController