public class TLcdMapGridRulerController extends ALcdGXYController implements MouseListener, MouseMotionListener
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.
Constructor and Description |
---|
TLcdMapGridRulerController()
Deprecated.
Default constructor for a
MapRulerController . |
TLcdMapGridRulerController(boolean aRegisterFlag)
Deprecated.
use the constructor without parameters.
|
TLcdMapGridRulerController(ILcdModelReference aGridReference)
Deprecated.
|
TLcdMapGridRulerController(ILcdModelReference aGridReference,
boolean aRegisterFlag)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
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].
|
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.
|
ActionListener |
getActionListenerOnDoubleClick()
Deprecated.
|
Color |
getGhostColor()
Deprecated.
ghostColor is the property that holds the color of the lines and circle that
are drawn.
|
int |
getGhostLineWidth()
Deprecated.
GhostLineWidth is the property that holds the width of the lines and circle that
are drawn.
|
double |
getLastSegmentAngle()
Deprecated.
|
double |
getLastSegmentDistance()
Deprecated.
|
double |
getTotalDistance()
Deprecated.
|
boolean |
isDrawEqualDistanceCurve()
Deprecated.
The property drawEqualDistanceCurve determines whether to draw the circle.
|
boolean |
isDrawGeodesicLine()
Deprecated.
The property drawGeodesicLine determines whether to draw the lines.
|
boolean |
isPopupDialog()
Deprecated.
|
void |
mouseClicked(MouseEvent me)
Deprecated.
MouseEvent me is ignored.
|
void |
mouseDragged(MouseEvent me)
Deprecated.
MouseEvent me is ignored.
|
void |
mouseEntered(MouseEvent me)
Deprecated.
MouseEvent me is ignored.
|
void |
mouseExited(MouseEvent me)
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 |
mousePressed(MouseEvent me)
Deprecated.
MouseEvent me is ignored.
|
void |
mouseReleased(MouseEvent me)
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.
|
addStatusListener, asGXYController, fireStatusEvent, getCursor, getGXYView, getIcon, getName, getShortDescription, isTraceOn, paint, registerInstance, removeStatusListener, retrieveGXYViewXYWorldTransformation, setClassTraceOn, setCursor, setGXYView, setIcon, setName, setShortDescription, setTraceOn, viewRepaint
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getLayered
public TLcdMapGridRulerController()
MapRulerController
.public TLcdMapGridRulerController(boolean aRegisterFlag)
public TLcdMapGridRulerController(ILcdModelReference aGridReference)
public TLcdMapGridRulerController(ILcdModelReference aGridReference, boolean aRegisterFlag)
public void startInteraction(ILcdGXYView aGXYView)
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.
startInteraction
in interface ILcdGXYController
startInteraction
in class ALcdGXYController
aGXYView
- the ILcdGXYView
this ILcdGXYController
will interact with.ILcdGXYView.setGXYController(com.luciad.view.gxy.ILcdGXYController)
,
ILcdGXYController.terminateInteraction(com.luciad.view.gxy.ILcdGXYView)
public void terminateInteraction(ILcdGXYView aGXYView)
ALcdGXYController
terminateInteraction
in interface ILcdGXYController
terminateInteraction
in class ALcdGXYController
aGXYView
- the ILcdGXYView
this ILcdGXYController
interacted with.ILcdGXYView.setGXYController(com.luciad.view.gxy.ILcdGXYController)
,
ILcdGXYController.startInteraction(com.luciad.view.gxy.ILcdGXYView)
public void mouseMoved(MouseEvent me)
mouseMoved
in interface MouseMotionListener
protected void displayLastSegmentDistance(double aDistance, MouseEvent me)
protected void displayLastSegmentAngle(double aAngle, MouseEvent me)
protected void displayTotalDistance(double aDistance, MouseEvent me)
public void mouseReleased(MouseEvent me)
mouseReleased
in interface MouseListener
protected double calculateDistance(int aFromX, int aFromY, int aToX, int aToY)
Using this method only makes sense when the ILcdGXYView
this
ILcdGXYController
interacts with has a
ILcdProjectionReference
as a ILcdXYWorldReference
.
protected double calculateAngle(int aFromX, int aFromY, int aToX, int aToY)
Using this method makes sense only when the ILcdGXYView
this
ILcdGXYController
interacts with has a
ILcdProjectionReference
as a ILcdXYWorldReference
.
protected String formatDistance(double aDistance, MouseEvent me)
protected String formatAngle(double aAngle, MouseEvent me)
public void mouseDragged(MouseEvent me)
mouseDragged
in interface MouseMotionListener
public void mouseClicked(MouseEvent me)
mouseClicked
in interface MouseListener
public void mouseEntered(MouseEvent me)
mouseEntered
in interface MouseListener
public void mouseExited(MouseEvent me)
mouseExited
in interface MouseListener
public void mousePressed(MouseEvent me)
mousePressed
in interface MouseListener
public double getLastSegmentDistance()
public double getLastSegmentAngle()
public double getTotalDistance()
public void undo()
public void setGhostColor(Color aGhostColor)
public Color getGhostColor()
public void setGhostLineWidth(int aGhostLineWidth)
aGhostLineWidth
- the line width to set.public int getGhostLineWidth()
public boolean isDrawEqualDistanceCurve()
true
if drawEqualDistanceCurve is true
, else false
is returned.public void setDrawEqualDistanceCurve(boolean aDrawEqualDistanceCurve)
public boolean isPopupDialog()
public void setPopupDialog(boolean aPopupDialog)
public void setDrawGeodesicLine(boolean newDrawGeodesicLine)
public boolean isDrawGeodesicLine()
true
if drawGeodesicLine is true
, else false
is returned.public void setActionListenerOnDoubleClick(ActionListener aActionListener)
public ActionListener getActionListenerOnDoubleClick()