Class TLcdMapRulerController
- All Implemented Interfaces:
ILcdUndoableSource
,ILcdStatusSource
,ILcdGXYController
,KeyListener
,MouseListener
,MouseMotionListener
,Serializable
,EventListener
ILcdGXYController
interprets mouse events for displaying a
distance between points on the screen and the circle spanning the given distance.
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
.
If the property popupDialog is true, it pops up a Dialog in which the distance and azimuth of the last geodesic segment drawn, as well as the total distance of all segments are displayed.
Redefines formatDistance and formatAzimuth if you need to display these values with a specific unit of measure.
Redefine displayLastSegmentDistance, displayLastSegmentAzimuth and displayTotalDistance if you need to display all or some of these values differently.
- See Also:
-
Constructor Summary
ConstructorDescriptionDeprecated.Default constructor for aTLcdMapRulerController
.TLcdMapRulerController
(boolean aRegisterFlag) Deprecated.use the constructor without parameters. -
Method Summary
Modifier and TypeMethodDescriptionprotected double
calculateAzimuth
(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
displayLastSegmentAzimuth
(double aAzimuth, MouseEvent me) Deprecated.protected void
displayLastSegmentDistance
(double aDistance, MouseEvent me) Deprecated.protected void
displayTotalDistance
(double aDistance, MouseEvent me) Deprecated.protected void
doPanGXYView
(int aDeltaX, int aDeltaY) Deprecated.Performs the pan of thisILcdGXYController
ILcdGXYView
protected void
doZoomGXYView
(double aDoubleFactor) Deprecated.Performs the zoom of thisILcdGXYController
ILcdGXYView
protected String
formatAzimuth
(double aAzimuth, MouseEvent me) Deprecated.Format the model azimuth aAzimuth 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.Returns the color of the lines and circles that will be rendered to graphically display the distances on the map.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.Returns whether a dialog should be shown displaying the values available in this controller.boolean
Deprecated.This method has been deprecated.void
mouseMoved
(MouseEvent me) Deprecated.The mouse movement calculates and displays the new distances and calls a repaint on the view, forcing a paint of this controller.void
Deprecated.void
Deprecated.A mouse release causes the last location to be added to the list of points that are going to be linked.void
Deprecated.Draws 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 ( ifisDrawEqualDistanceCurve()
is true ).void
setActionListenerOnDoubleClick
(ActionListener aActionListener) Deprecated.void
setDrawEqualDistanceCurve
(boolean aDrawEqualDistanceCurve) Deprecated.Sets whether to render a curve representing points at an equal distance of the last point.void
setDrawGeodesicLine
(boolean aDrawGeodesicLine) Deprecated.Sets whether to render lines of shortest distance between the points.void
setGhostColor
(Color aGhostColor) Deprecated.Sets the color of the lines and circles that will be rendered to graphically display the distances on the map.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.Sets whether a dialog should be shown displaying the values available in this controller.void
setTraceOn
(boolean aTraceOn) Deprecated.This method has been 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.ALcdGXYSmartController
addUndoableListener, fireUndoableEvent, getDownPanChars, getDownPanCodes, getLeftPanChars, getLeftPanCodes, getPanAbsDelta, getPanAbsDelta, getRightPanChars, getRightPanCodes, getUndoableListenerCount, getUpPanChars, getUpPanCodes, getZoomInChars, getZoomInCodes, getZoomOutChars, getZoomOutCodes, isDragging, isPanOnMouseDragExit, isPanOnMouseMoveExit, isPanUndoable, isRequestFocusOnMouseEntered, isRequestFocusOnMousePressed, isZoomUndoable, keyPressed, keyReleased, keyTyped, mouseClicked, mouseDragged, mouseEntered, mouseExited, removeUndoableListener, setDownPanChars, setDownPanCodes, setIsDragging, setLeftPanChars, setLeftPanCodes, setPanAbsDelta, setPanOnMouseDragExit, setPanOnMouseMoveExit, setPanUndoable, setRequestFocusOnMouseEntered, setRequestFocusOnMousePressed, setRightPanChars, setRightPanCodes, setUpPanChars, setUpPanCodes, setZoomInChars, setZoomInCodes, setZoomOutChars, setZoomOutCodes, setZoomUndoable, updateViewLocationAfterZoomSFCT
Methods inherited from class com.luciad.view.gxy.controller.ALcdGXYController
addStatusListener, asGXYController, fireStatusEvent, getCursor, getGXYView, getIcon, getName, getShortDescription, registerInstance, removeStatusListener, retrieveGXYViewXYWorldTransformation, setClassTraceOn, setCursor, setGXYView, setIcon, setName, setShortDescription, 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
Methods inherited from interface java.awt.event.MouseListener
mouseClicked, mouseEntered, mouseExited
Methods inherited from interface java.awt.event.MouseMotionListener
mouseDragged
-
Constructor Details
-
TLcdMapRulerController
public TLcdMapRulerController()Deprecated.Default constructor for aTLcdMapRulerController
. -
TLcdMapRulerController
public TLcdMapRulerController(boolean aRegisterFlag) Deprecated.use the constructor without parameters.- Parameters:
aRegisterFlag
- whether to register this class as a bean or not.
-
-
Method Details
-
setTraceOn
public void setTraceOn(boolean aTraceOn) Deprecated.This method has been deprecated. It is recommended to use the standard Java logging framework directly.Enables tracing for this class instance. Calling this method with eithertrue
orfalse
as argument automatically turns off tracing for all other class instances for whichsetTraceOn
has not been called. If the argument isfalse
then only the informative, warning and error log messages are recorded.- Overrides:
setTraceOn
in classALcdGXYSmartController
- Parameters:
aTraceOn
- if true then all log messages are recorded for this instance. If false, then only the informative, warning and error log messages are recorded.
-
isTraceOn
public boolean isTraceOn()Deprecated.This method has been deprecated. It is recommended to use the standard Java logging framework directly.Returnstrue
if tracing is enabled for this class.- Overrides:
isTraceOn
in classALcdGXYSmartController
- Returns:
- true if tracing is enabled for this class, false otherwise.
-
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 azimuth of the last geodesic segment drawn, as well as the total distance of all segments are displayed.Redefines formatDistance and formatAzimuth if you need to display these values with a specific unit of measure.
Redefine displayLastSegmentDistance, displayLastSegmentAzimuth and displayTotalDistance if you need to display all or some of these values differently.
- Specified by:
startInteraction
in interfaceILcdGXYController
- Overrides:
startInteraction
in classALcdGXYSmartController
- 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 classALcdGXYSmartController
- Parameters:
aGXYView
- theILcdGXYView
thisILcdGXYController
interacted with.- See Also:
-
mousePressed
Deprecated.- Specified by:
mousePressed
in interfaceMouseListener
- Overrides:
mousePressed
in classALcdGXYSmartController
-
mouseMoved
Deprecated.The mouse movement calculates and displays the new distances and calls a repaint on the view, forcing a paint of this controller.- Specified by:
mouseMoved
in interfaceMouseMotionListener
- Overrides:
mouseMoved
in classALcdGXYSmartController
-
paint
Deprecated.Draws 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 ( ifisDrawEqualDistanceCurve()
is true ).- Specified by:
paint
in interfaceILcdGXYController
- Overrides:
paint
in classALcdGXYController
- Parameters:
aGraphics
- the Graphics on which the view was rendered.
-
displayLastSegmentDistance
Deprecated.- See Also:
-
displayLastSegmentAzimuth
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
- Overrides:
mouseReleased
in classALcdGXYSmartController
-
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 aILcdGridReference
as aILcdXYWorldReference
.- Parameters:
aFromX
- the first coordinate of the first pointaFromY
- the second coordinate of the first pointaToX
- the first coordinate of the second pointaToY
- the second coordinate of the second point- Returns:
- a distance in meters or -1.
-
calculateAzimuth
protected double calculateAzimuth(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 aILcdGridReference
as aILcdXYWorldReference
.- Parameters:
aFromX
- the first coordinate of the first pointaFromY
- the second coordinate of the first pointaToX
- the first coordinate of the second pointaToY
- the second coordinate of the second point
-
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.- Parameters:
aDistance
- the distance to format, expressed in meters.me
- the mouse event that could have caused the distance to change. Note that this may be null. This argument is not used in this implementation.- Returns:
- the distance in meters if
distance < 100000
, in Km otherwise
-
formatAzimuth
Deprecated.Format the model azimuth aAzimuth in radians as a String. Redefine this method to have the distances displayed with another unit of measure.- Parameters:
aAzimuth
- the azimuth between two points, expressed in radians !me
- the mouse event that could have caused the distance to change. Note that this may be null. This argument is not used in this implementation.- Returns:
- the azimuth expressed in degrees, between 0 and 360 degrees.
-
doPanGXYView
protected void doPanGXYView(int aDeltaX, int aDeltaY) Deprecated.Description copied from class:ALcdGXYSmartController
Performs the pan of thisILcdGXYController
ILcdGXYView
- Overrides:
doPanGXYView
in classALcdGXYSmartController
- Parameters:
aDeltaX
- delta along the X axis, in AWT pixelsaDeltaY
- delta along the Y axis, in AWT pixels
-
doZoomGXYView
protected void doZoomGXYView(double aDoubleFactor) Deprecated.Description copied from class:ALcdGXYSmartController
Performs the zoom of thisILcdGXYController
ILcdGXYView
- Overrides:
doZoomGXYView
in classALcdGXYSmartController
- Parameters:
aDoubleFactor
- zoom factor with which to multiply the view's scale
-
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.
-
getLastSegmentAzimuth
public double getLastSegmentAzimuth()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.Sets the color of the lines and circles that will be rendered to graphically display the distances on the map.- Parameters:
aGhostColor
- the color of the lines and circles that will be rendered- See Also:
-
getGhostColor
Deprecated.Returns the color of the lines and circles that will be rendered to graphically display the distances on the map.- Returns:
- the color of the lines and circles that will be rendered
- See Also:
-
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.Sets whether to render a curve representing points at an equal distance of the last point.- Parameters:
aDrawEqualDistanceCurve
- true to have a curve rendered that shows points at equal distance of the last point.
-
isPopupDialog
public boolean isPopupDialog()Deprecated.Returns whether a dialog should be shown displaying the values available in this controller.- Returns:
- whether a dialog should be shown displaying the values available in this controller.
- See Also:
-
setPopupDialog
public void setPopupDialog(boolean aPopupDialog) Deprecated.Sets whether a dialog should be shown displaying the values available in this controller. Default value is true.- Parameters:
aPopupDialog
- true to have a dialog displaying the values available in this controller.- See Also:
-
setDrawGeodesicLine
public void setDrawGeodesicLine(boolean aDrawGeodesicLine) Deprecated.Sets whether to render lines of shortest distance between the points.- Parameters:
aDrawGeodesicLine
- true to render lines of shortest distance between the points.
-
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