Class TLcdAzimuthRangeController

All Implemented Interfaces:
ILcdUndoableSource, ILcdStatusSource, ILcdGXYController, KeyListener, MouseListener, MouseMotionListener, Serializable, EventListener

public class TLcdAzimuthRangeController extends ALcdGXYSmartController implements MouseListener, MouseMotionListener
This ILcdGXYController interprets mouse events for displaying an azimuth direction and an azimuth range.

The azimuth direction is based on the initial azimuth of the geodesic line segment between two points on the screen. The length of the line segment determines the wideness of the azimuth range. The longer the line segment the smaller the azimuth range. Below a certain threshold (in pixels) the range is 360 degrees. Above a certain threshold (in pixels) the range is 0 degrees.

On each mouse release a PropertyChangeEvent occurs. This event object contains null values. One should call the methods getStartAzimuth() and getAzimuthRange() of the controller in order to get the azimuth interval.
An event is thrown on each mouse drag if isEventOnMouseDrag returns true.

Using this ILcdGXYController method makes sense only when the ILcdGXYView it interacts with has a ILcdXYWorldReference that is an instance of ILcdGridReference.

Since:
V2.0
See Also:
  • Constructor Details

    • TLcdAzimuthRangeController

      public TLcdAzimuthRangeController()
      Creates a new TLcdAzimuthRangeController.
  • 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 either true or false as argument automatically turns off tracing for all other class instances for which setTraceOn has not been called. If the argument is false then only the informative, warning and error log messages are recorded.
      Overrides:
      setTraceOn in class ALcdGXYSmartController
      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.
      Returns true if tracing is enabled for this class.
      Overrides:
      isTraceOn in class ALcdGXYSmartController
      Returns:
      true if tracing is enabled for this class, false otherwise.
    • setStartFromCenter

      public void setStartFromCenter(boolean aStartFromCenter)
      Sets the StartFromCenter attribute of the TLcdAzimuthRangeController object.
      Parameters:
      aStartFromCenter - the new StartFromCenter value.
      See Also:
    • setEventOnMouseDrag

      public void setEventOnMouseDrag(boolean aEventOnMouseDrag)
      Sets the EventOnMouseDrag attribute of the TLcdAzimuthRangeController object.
      Parameters:
      aEventOnMouseDrag - the new EventOnMouseDrag value.
      See Also:
    • setPixelLengthForZeroAngle

      public void setPixelLengthForZeroAngle(int aPixelLengthForZeroAngle)
      Sets the PixelLengthForZeroAngle attribute of the TLcdAzimuthRangeController object.
      Parameters:
      aPixelLengthForZeroAngle - the new PixelLengthForZeroAngle value.
      See Also:
    • setPixelLengthForCompleteCircle

      public void setPixelLengthForCompleteCircle(int aPixelLengthCompleteCircle)
      Sets the PixelLengthForCompleteCircle attribute of the TLcdAzimuthRangeController object.
      Parameters:
      aPixelLengthCompleteCircle - the new PixelLengthForCompleteCircle value.
      See Also:
    • setPixelLengthForArcRadius

      public void setPixelLengthForArcRadius(int aPixelLengthForArcRadius)
      Sets the PixelLengthForArcRadius attribute of the TLcdAzimuthRangeController object.
      Parameters:
      aPixelLengthForArcRadius - the new PixelLengthForArcRadius value.
      See Also:
    • setCenterAzimuthLineStyle

      public void setCenterAzimuthLineStyle(ILcdGraphicsSetup aCenterAzimuthLineStyle)
      Sets the CenterAzimuthLineStyle attribute of the TLcdAzimuthRangeController object.
      Parameters:
      aCenterAzimuthLineStyle - the new CenterAzimuthLineStyle value.
      See Also:
    • setOuterAzimuthLineStyle

      public void setOuterAzimuthLineStyle(ILcdGraphicsSetup aOuterAzimuthLineStyle)
      Sets the OuterAzimuthLineStyle attribute of the TLcdAzimuthRangeController object.
      Parameters:
      aOuterAzimuthLineStyle - the new OuterAzimuthLineStyle value.
      See Also:
    • setArcLineStyle

      public void setArcLineStyle(ILcdGraphicsSetup aArcLineStyle)
      Sets the ArcLineStyle attribute of the TLcdAzimuthRangeController object.
      Parameters:
      aArcLineStyle - the new ArcLineStyle value.
      See Also:
    • setFillStyle

      public void setFillStyle(ILcdGraphicsSetup aFillStyle)
      Sets the FillStyle attribute of the TLcdAzimuthRangeController object.
      Parameters:
      aFillStyle - the new FillStyle value.
      See Also:
    • setFilled

      public void setFilled(boolean aFilled)
      Sets the Filled attribute of the TLcdAzimuthRangeController object.
      Parameters:
      aFilled - the new Filled value.
      See Also:
    • setLabeled

      public void setLabeled(boolean aLabeled)
      Sets the Labeled attribute of the TLcdAzimuthRangeController object.
      Parameters:
      aLabeled - the new Labeled value.
      See Also:
    • setLabelFont

      public void setLabelFont(Font aLabelFont)
      Sets the LabelFont attribute of the TLcdAzimuthRangeController object.
      Parameters:
      aLabelFont - the new LabelFont value.
      See Also:
    • setLabelColor

      public void setLabelColor(Color aLabelColor)
      Sets the LabelColor attribute of the TLcdAzimuthRangeController object.
      Parameters:
      aLabelColor - the new LabelColor value.
      See Also:
    • setLabelBackgroundColor

      public void setLabelBackgroundColor(Color aLabelBackgroundColor)
      Sets the LabelBackgroundColor attribute of the TLcdAzimuthRangeController object.
      Parameters:
      aLabelBackgroundColor - the new LabelBackgroundColor value.
      See Also:
    • setLabelFrame

      public void setLabelFrame(boolean aLabelFrame)
      Sets the LabelFrame attribute of the TLcdAzimuthRangeController object.
      Parameters:
      aLabelFrame - the new LabelFrame value.
      See Also:
    • setLabelFilled

      public void setLabelFilled(boolean aLabelFilled)
      Sets the LabelFilled attribute of the TLcdAzimuthRangeController object.
      Parameters:
      aLabelFilled - the new LabelFilled value.
      See Also:
    • getStartAzimuth

      public double getStartAzimuth()
      Gets the StartAzimuth attribute of the TLcdAzimuthRangeController object.
      Returns:
      the StartAzimuth value.
    • getAzimuthRange

      public double getAzimuthRange()
      Gets the AzimuthRange attribute of the TLcdAzimuthRangeController object.
      Returns:
      the AzimuthRange value.
    • isStartFromCenter

      public boolean isStartFromCenter()
      Gets the StartFromCenter attribute of the TLcdAzimuthRangeController object. A single mouse click suffices. The first point is considered to be the center point of the ILcdGXYView.
      Returns:
      the StartFromCenter value.
      See Also:
    • isEventOnMouseDrag

      public boolean isEventOnMouseDrag()
      Gets the EventOnMouseDrag attribute of the TLcdAzimuthRangeController object. If this method returns true a property change event occurs on every mouse drag. If this method returns false a property change event occurs on a mouse release only.
      Returns:
      the EventOnMouseDrag value.
      See Also:
    • getPixelLengthForZeroAngle

      public int getPixelLengthForZeroAngle()
      Gets the PixelLengthForZeroAngle attribute of the TLcdAzimuthRangeController object. If the two view points are more than aPixelLengthForZeroAngle pixels from each other, the azimuth range will be 0 .
      Returns:
      the PixelLengthForZeroAngle value.
      See Also:
    • getPixelLengthForCompleteCircle

      public int getPixelLengthForCompleteCircle()
      Gets the PixelLengthForCompleteCircle attribute of the TLcdAzimuthRangeController object. If the two view points are less than aPixelLengthForCompleteCircle pixels from each other, the azimuth range will be 360 degrees.
      Returns:
      the PixelLengthForCompleteCircle value.
      See Also:
    • getPixelLengthForArcRadius

      public int getPixelLengthForArcRadius()
      Gets the PixelLengthForArcRadius attribute of the TLcdAzimuthRangeController object. The arc segment representing the azimuth range will be drawn with a radius of about aPixelLengthForArcRadius pixels.
      Returns:
      the PixelLengthForArcRadius value.
      See Also:
    • getCenterAzimuthLineStyle

      public ILcdGraphicsSetup getCenterAzimuthLineStyle()
      Gets the CenterAzimuthLineStyle attribute of the TLcdAzimuthRangeController object.
      Returns:
      the CenterAzimuthLineStyle value.
      See Also:
    • getOuterAzimuthLineStyle

      public ILcdGraphicsSetup getOuterAzimuthLineStyle()
      Gets the OuterAzimuthLineStyle attribute of the TLcdAzimuthRangeController object.
      Returns:
      the OuterAzimuthLineStyle value.
      See Also:
    • getArcLineStyle

      public ILcdGraphicsSetup getArcLineStyle()
      Gets the ArcLineStyle attribute of the TLcdAzimuthRangeController object.
      Returns:
      the ArcLineStyle value.
      See Also:
    • getFillStyle

      public ILcdGraphicsSetup getFillStyle()
      Gets the FillStyle attribute of the TLcdAzimuthRangeController object.
      Returns:
      the FillStyle value.
      See Also:
    • isFilled

      public boolean isFilled()
      Gets the Filled attribute of the TLcdAzimuthRangeController object. If true the area occupied by the azimuth range will be filled from the center point to the arc segment representing the azimuth range.
      Returns:
      the Filled value.
      See Also:
    • isLabeled

      public boolean isLabeled()
      Returns whether the current start azimuth and the range should be displayed as a label.
      Returns:
      the Labeled value.
      See Also:
    • getLabelFont

      public Font getLabelFont()
      Gets the LabelFont attribute of the TLcdAzimuthRangeController object.
      Returns:
      the LabelFont value.
      See Also:
    • getLabelColor

      public Color getLabelColor()
      Gets the LabelColor attribute of the TLcdAzimuthRangeController object.
      Returns:
      the LabelColor value.
      See Also:
    • getLabelBackgroundColor

      public Color getLabelBackgroundColor()
      Gets the LabelBackgroundColor attribute of the TLcdAzimuthRangeController object.
      Returns:
      the LabelBackgroundColor value.
      See Also:
    • isLabelFrame

      public boolean isLabelFrame()
      Gets the LabelFrame attribute of the TLcdAzimuthRangeController object.
      Returns:
      the LabelFrame value.
      See Also:
    • isLabelFilled

      public boolean isLabelFilled()
      Gets the LabelFilled attribute of the TLcdAzimuthRangeController object.
      Returns:
      the LabelFilled value.
      See Also:
    • addPropertyChangeListener

      public void addPropertyChangeListener(PropertyChangeListener aPropertyChangeListener)
      Adds a feature to the PropertyChangeListener attribute of the TLcdAzimuthRangeController object.
      Parameters:
      aPropertyChangeListener - The feature to be added to the PropertyChangeListener attribute.
      See Also:
    • removePropertyChangeListener

      public void removePropertyChangeListener(PropertyChangeListener aPropertyChangeListener)
      Removes the given PropertyChangeListener aPropertyChangeListener as listener.
      Parameters:
      aPropertyChangeListener - the PropertyChangeListener to be removed as listener.
      See Also:
    • startInteraction

      public void startInteraction(ILcdGXYView aGXYView)
      Description copied from class: ALcdGXYController
      Sets up the controller to receive input through the view passed.

      All ILcdGXYView implementations that support interaction call this method when the controller has been made active with setGXYController on the view, so this method shouldn't normally be called directly. Note that most view implementations add the controller as listener if appropriate before calling this method.

      Sets the cursor on the view and sets the view for which this controller is now active. Sends out a status event based on the short description.

      Specified by:
      startInteraction in interface ILcdGXYController
      Overrides:
      startInteraction in class ALcdGXYSmartController
      Parameters:
      aGXYView - the ILcdGXYView this ILcdGXYController will interact with.
      See Also:
    • terminateInteraction

      public void terminateInteraction(ILcdGXYView aGXYView)
      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 ALcdGXYSmartController
      Parameters:
      aGXYView - the ILcdGXYView this ILcdGXYController interacted with.
      See Also:
    • paint

      public void paint(Graphics aGraphics)
      Description copied from class: ALcdGXYController
      Enables the controller to give visual feedback on the current user interactions. Note that the controller is responsible for repainting the view.

      Empty implementation. Redefine this method to render on the Graphics on which the view is rendered.

      Specified by:
      paint in interface ILcdGXYController
      Overrides:
      paint in class ALcdGXYController
      Parameters:
      aGraphics - the Graphics on which the view was rendered.
    • mouseClicked

      public void mouseClicked(MouseEvent e)
      Specified by:
      mouseClicked in interface MouseListener
      Overrides:
      mouseClicked in class ALcdGXYSmartController
    • mousePressed

      public void mousePressed(MouseEvent e)
      Specified by:
      mousePressed in interface MouseListener
      Overrides:
      mousePressed in class ALcdGXYSmartController
    • mouseReleased

      public void mouseReleased(MouseEvent e)
      Specified by:
      mouseReleased in interface MouseListener
      Overrides:
      mouseReleased in class ALcdGXYSmartController
    • mouseEntered

      public void mouseEntered(MouseEvent e)
      Specified by:
      mouseEntered in interface MouseListener
      Overrides:
      mouseEntered in class ALcdGXYSmartController
    • mouseExited

      public void mouseExited(MouseEvent e)
      Description copied from class: ALcdGXYSmartController
      Will perform a pan depending on the values of isDragging, isPanOnMouseDragExit and isPanOnMouseMoveExit properties
      Specified by:
      mouseExited in interface MouseListener
      Overrides:
      mouseExited in class ALcdGXYSmartController
    • mouseDragged

      public void mouseDragged(MouseEvent e)
      Specified by:
      mouseDragged in interface MouseMotionListener
      Overrides:
      mouseDragged in class ALcdGXYSmartController
    • mouseMoved

      public void mouseMoved(MouseEvent e)
      Specified by:
      mouseMoved in interface MouseMotionListener
      Overrides:
      mouseMoved in class ALcdGXYSmartController
    • setupGraphicsForFillStyle

      protected void setupGraphicsForFillStyle(Graphics aGraphics)
      Sets the fill style to use for filling the arc segment.
      Parameters:
      aGraphics - the graphics on which to apply the style.
    • setupGraphicsForCenterAzimuthLineStyle

      protected void setupGraphicsForCenterAzimuthLineStyle(Graphics aGraphics)
      Sets the line style to use for drawing the center azimuth lines.
      Parameters:
      aGraphics - the graphics on which to apply the style.
    • setupGraphicsForOuterAzimuthLineStyle

      protected void setupGraphicsForOuterAzimuthLineStyle(Graphics aGraphics)
      Sets the line style to use for drawing the outer azimuth lines.
      Parameters:
      aGraphics - the graphics on which to apply the style.
    • setupGraphicsForArcLineStyle

      protected void setupGraphicsForArcLineStyle(Graphics aGraphics)
      Sets the line style to use for drawing the arc.
      Parameters:
      aGraphics - the graphics on which to apply the style.