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
ConstructorsConstructorDescriptionDeprecated.Default constructor for aTLcdMapRulerController.TLcdMapRulerController(boolean aRegisterFlag) Deprecated.use the constructor without parameters. -
Method Summary
Modifier and TypeMethodDescriptionprotected doublecalculateAzimuth(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 doublecalculateDistance(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 voiddisplayLastSegmentAzimuth(double aAzimuth, MouseEvent me) Deprecated.protected voiddisplayLastSegmentDistance(double aDistance, MouseEvent me) Deprecated.protected voiddisplayTotalDistance(double aDistance, MouseEvent me) Deprecated.protected voiddoPanGXYView(int aDeltaX, int aDeltaY) Deprecated.Performs the pan of thisILcdGXYControllerILcdGXYViewprotected voiddoZoomGXYView(double aDoubleFactor) Deprecated.Performs the zoom of thisILcdGXYControllerILcdGXYViewprotected StringformatAzimuth(double aAzimuth, MouseEvent me) Deprecated.Format the model azimuth aAzimuth in radians as a String.protected StringformatDistance(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.intDeprecated.GhostLineWidth is the property that holds the width of the lines and circle that are drawn.doubleDeprecated.doubleDeprecated.doubleDeprecated.booleanDeprecated.The property drawEqualDistanceCurve determines whether to draw the circle.booleanDeprecated.The property drawGeodesicLine determines whether to draw the lines.booleanDeprecated.Returns whether a dialog should be shown displaying the values available in this controller.booleanDeprecated.This method has been deprecated.voidmouseMoved(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.voidDeprecated.voidDeprecated.A mouse release causes the last location to be added to the list of points that are going to be linked.voidDeprecated.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 ).voidsetActionListenerOnDoubleClick(ActionListener aActionListener) Deprecated.voidsetDrawEqualDistanceCurve(boolean aDrawEqualDistanceCurve) Deprecated.Sets whether to render a curve representing points at an equal distance of the last point.voidsetDrawGeodesicLine(boolean aDrawGeodesicLine) Deprecated.Sets whether to render lines of shortest distance between the points.voidsetGhostColor(Color aGhostColor) Deprecated.Sets the color of the lines and circles that will be rendered to graphically display the distances on the map.voidsetGhostLineWidth(int aGhostLineWidth) Deprecated.GhostLineWidth is the property that holds the width of the lines and circle that are drawn.voidsetPopupDialog(boolean aPopupDialog) Deprecated.Sets whether a dialog should be shown displaying the values available in this controller.voidsetTraceOn(boolean aTraceOn) Deprecated.This method has been deprecated.voidstartInteraction(ILcdGXYView aGXYView) Deprecated.This method calls super.startInteraction( aGXYView ).voidterminateInteraction(ILcdGXYView aGXYView) Deprecated.Releases a few items.voidundo()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, updateViewLocationAfterZoomSFCTMethods 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, viewRepaintMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.luciad.view.gxy.ILcdGXYController
getLayeredMethods inherited from interface java.awt.event.MouseListener
mouseClicked, mouseEntered, mouseExitedMethods 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 eithertrueorfalseas argument automatically turns off tracing for all other class instances for whichsetTraceOnhas not been called. If the argument isfalsethen only the informative, warning and error log messages are recorded.- Overrides:
setTraceOnin 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.Returnstrueif tracing is enabled for this class.- Overrides:
isTraceOnin 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:
startInteractionin interfaceILcdGXYController- Overrides:
startInteractionin classALcdGXYSmartController- Parameters:
aGXYView- theILcdGXYViewthisILcdGXYControllerwill interact with.- See Also:
-
terminateInteraction
Deprecated.Description copied from class:ALcdGXYControllerReleases a few items. Can be redefined but this 'super' method should be called too.- Specified by:
terminateInteractionin interfaceILcdGXYController- Overrides:
terminateInteractionin classALcdGXYSmartController- Parameters:
aGXYView- theILcdGXYViewthisILcdGXYControllerinteracted with.- See Also:
-
mousePressed
Deprecated.- Specified by:
mousePressedin interfaceMouseListener- Overrides:
mousePressedin 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:
mouseMovedin interfaceMouseMotionListener- Overrides:
mouseMovedin 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:
paintin interfaceILcdGXYController- Overrides:
paintin 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:
mouseReleasedin interfaceMouseListener- Overrides:
mouseReleasedin 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
ILcdGXYViewthisILcdGXYControllerinteracts with has aILcdGridReferenceas 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
ILcdGXYViewthisILcdGXYControllerinteracts with has aILcdGridReferenceas 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:ALcdGXYSmartControllerPerforms the pan of thisILcdGXYControllerILcdGXYView- Overrides:
doPanGXYViewin 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:ALcdGXYSmartControllerPerforms the zoom of thisILcdGXYControllerILcdGXYView- Overrides:
doZoomGXYViewin 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:
trueif drawEqualDistanceCurve istrue, elsefalseis 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:
trueif drawGeodesicLine istrue, elsefalseis returned.
-
setActionListenerOnDoubleClick
Deprecated. -
getActionListenerOnDoubleClick
Deprecated.
-
TLcdAdvancedMapRulerController