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 Link icon

    • TLcdMapGridRulerController Link icon

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

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

      public TLcdMapGridRulerController(ILcdModelReference aGridReference)
      Deprecated.
    • TLcdMapGridRulerController Link icon

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

    • startInteraction Link icon

      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 Link icon

      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 Link icon

      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 Link icon

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

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

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

      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 Link icon

      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 Link icon

      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 Link icon

      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 Link icon

      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 Link icon

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

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

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

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

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

      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 Link icon

      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 Link icon

      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 Link icon

      public void undo()
      Deprecated.
      Performs no action.
    • setGhostColor Link icon

      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 Link icon

      public Color getGhostColor()
      Deprecated.
      ghostColor is the property that holds the color of the lines and circle that are drawn. Returns the ghostColor.
    • setGhostLineWidth Link icon

      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 Link icon

      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 Link icon

      public boolean isDrawEqualDistanceCurve()
      Deprecated.
      The property drawEqualDistanceCurve determines whether to draw the circle.
      Returns:
      true if drawEqualDistanceCurve is true, else false is returned.
    • setDrawEqualDistanceCurve Link icon

      public void setDrawEqualDistanceCurve(boolean aDrawEqualDistanceCurve)
      Deprecated.
      The property drawEqualDistanceCurve determines whether to draw the circle. Sets drawEqualDistanceCurve to aDrawEqualDistanceCurve.
    • isPopupDialog Link icon

      public boolean isPopupDialog()
      Deprecated.
      See Also:
    • setPopupDialog Link icon

      public void setPopupDialog(boolean aPopupDialog)
      Deprecated.
      See Also:
    • setDrawGeodesicLine Link icon

      public void setDrawGeodesicLine(boolean newDrawGeodesicLine)
      Deprecated.
      The property drawGeodesicLine determines whether to draw the lines. Sets drawGeodesicLine to newDrawGeodesicLine.
    • isDrawGeodesicLine Link icon

      public boolean isDrawGeodesicLine()
      Deprecated.
      The property drawGeodesicLine determines whether to draw the lines.
      Returns:
      true if drawGeodesicLine is true, else false is returned.
    • setActionListenerOnDoubleClick Link icon

      public void setActionListenerOnDoubleClick(ActionListener aActionListener)
      Deprecated.
    • getActionListenerOnDoubleClick Link icon

      public ActionListener getActionListenerOnDoubleClick()
      Deprecated.