Class TLcdMapGridRulerController

java.lang.Object
com.luciad.view.gxy.controller.ALcdGXYController
com.luciad.view.map.TLcdMapGridRulerController
All Implemented Interfaces:
ILcdStatusSource, ILcdGXYController, MouseListener, MouseMotionListener, Serializable, EventListener

public class TLcdMapGridRulerController extends ALcdGXYController implements MouseListener, MouseMotionListener
This 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 Details

    • TLcdMapGridRulerController

      public TLcdMapGridRulerController()
      Deprecated.
      Default constructor for a MapRulerController .
    • TLcdMapGridRulerController

      public TLcdMapGridRulerController(boolean aRegisterFlag)
      Deprecated.
      use the constructor without parameters.
    • TLcdMapGridRulerController

      public TLcdMapGridRulerController(ILcdModelReference aGridReference)
      Deprecated.
    • TLcdMapGridRulerController

      public TLcdMapGridRulerController(ILcdModelReference aGridReference, boolean aRegisterFlag)
      Deprecated.
  • Method Details

    • startInteraction

      public void startInteraction(ILcdGXYView aGXYView)
      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 interface ILcdGXYController
      Overrides:
      startInteraction in class ALcdGXYController
      Parameters:
      aGXYView - the ILcdGXYView this ILcdGXYController will interact with.
      See Also:
    • terminateInteraction

      public void terminateInteraction(ILcdGXYView aGXYView)
      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 interface ILcdGXYController
      Overrides:
      terminateInteraction in class ALcdGXYController
      Parameters:
      aGXYView - the ILcdGXYView this ILcdGXYController interacted with.
      See Also:
    • mouseMoved

      public 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.
      Specified by:
      mouseMoved in interface MouseMotionListener
    • displayLastSegmentDistance

      protected void displayLastSegmentDistance(double aDistance, MouseEvent me)
      Deprecated.
      See Also:
    • displayLastSegmentAngle

      protected void displayLastSegmentAngle(double aAngle, MouseEvent me)
      Deprecated.
      See Also:
    • displayTotalDistance

      protected void displayTotalDistance(double aDistance, MouseEvent me)
      Deprecated.
      See Also:
    • mouseReleased

      public 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. A repetitive mouse release resets the list of points.
      Specified by:
      mouseReleased in interface MouseListener
    • 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 this ILcdGXYController interacts with has a ILcdProjectionReference as a ILcdXYWorldReference.

      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 this ILcdGXYController interacts with has a ILcdProjectionReference as a ILcdXYWorldReference.

    • formatDistance

      protected String formatDistance(double aDistance, MouseEvent me)
      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" if aDistance < 100000, in Km otherwise
    • formatAngle

      protected String formatAngle(double aAngle, MouseEvent me)
      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

      public void mouseDragged(MouseEvent me)
      Deprecated.
      MouseEvent me is ignored.
      Specified by:
      mouseDragged in interface MouseMotionListener
    • mouseClicked

      public void mouseClicked(MouseEvent me)
      Deprecated.
      MouseEvent me is ignored.
      Specified by:
      mouseClicked in interface MouseListener
    • mouseEntered

      public void mouseEntered(MouseEvent me)
      Deprecated.
      MouseEvent me is ignored.
      Specified by:
      mouseEntered in interface MouseListener
    • mouseExited

      public void mouseExited(MouseEvent me)
      Deprecated.
      MouseEvent me is ignored.
      Specified by:
      mouseExited in interface MouseListener
    • mousePressed

      public void mousePressed(MouseEvent me)
      Deprecated.
      MouseEvent me is ignored.
      Specified by:
      mousePressed in interface MouseListener
    • 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

      public void setGhostColor(Color aGhostColor)
      Deprecated.
      ghostColor is the property that holds the color of the lines and circle that are drawn. Sets the ghostColor to aGhostColor.
    • getGhostColor

      public Color 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 is true, else false 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 is true, else false is returned.
    • setActionListenerOnDoubleClick

      public void setActionListenerOnDoubleClick(ActionListener aActionListener)
      Deprecated.
    • getActionListenerOnDoubleClick

      public ActionListener getActionListenerOnDoubleClick()
      Deprecated.