Class BalloonResizeController

  • All Implemented Interfaces:
    AVList, SelectListener, HotSpot, java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.MouseWheelListener, java.util.EventListener

    public class BalloonResizeController
    extends AbstractResizeHotSpot
    Create a controller to resize a Balloon by dragging the mouse. This class should usually not be instantiated directly. Instead, BalloonController will instantiate it when a balloon needs to be resized.
    See Also:
    BalloonController
    • Field Detail

      • bounds

        protected java.awt.Rectangle bounds
      • balloon

        protected Balloon balloon
      • DEFAULT_MIN_SIZE

        protected static final java.awt.Dimension DEFAULT_MIN_SIZE
    • Constructor Detail

      • BalloonResizeController

        public BalloonResizeController​(WorldWindow wwd,
                                       Balloon balloon)
        Create a resize controller.
        Parameters:
        wwd - WorldWindow to interact with.
        balloon - Balloon to resize.
    • Method Detail

      • detach

        public void detach()
        Remove this controller as an event listener. The controller will not receive input events after this method is called.
      • mouseMoved

        public void mouseMoved​(java.awt.event.MouseEvent e)
        Description copied from class: AbstractResizeHotSpot
        Update the resize cursor when the mouse moves.
        Specified by:
        mouseMoved in interface HotSpot
        Specified by:
        mouseMoved in interface java.awt.event.MouseMotionListener
        Overrides:
        mouseMoved in class AbstractResizeHotSpot
        Parameters:
        e - Mouse event.
      • isResizing

        public boolean isResizing()
        Is the controller currently resizing a balloon?
        Returns:
        True if the controller is currently resizing the balloon.
      • getSize

        protected java.awt.Dimension getSize()
        Get the size of the frame.
        Specified by:
        getSize in class AbstractResizeHotSpot
        Returns:
        Frame size in pixels.
      • getBounds

        public java.awt.Rectangle getBounds()
        Gets the bounds of the Balloon being sized.
        Returns:
        Balloon bounds in AWT coordinates, or null if no bounds have been set.
      • setBounds

        public void setBounds​(java.awt.Rectangle bounds)
        Specifies the bounds of the Balloon to be sized.
        Parameters:
        bounds - Balloon bounds, in AWT coordinates.
      • updateCursor

        protected void updateCursor()
        Update the WorldWindow's cursor to the current resize cursor.
      • setSize

        protected void setSize​(java.awt.Dimension newSize)
        Set the size of the frame.
        Specified by:
        setSize in class AbstractResizeHotSpot
        Parameters:
        newSize - New frame size in pixels.
      • getBounds

        protected java.awt.Rectangle getBounds​(PickedObject pickedObject)
        Get the balloon bounds from a SelectEvent.
        Parameters:
        pickedObject - Top picked object. The bounds are expected to be attached to the to PickedObject under AVKey.BOUNDS.
        Returns:
        Bounds or null if no bounds are found in the top PickedObject.
      • getScreenPoint

        protected java.awt.Point getScreenPoint()
        Get the screen point of the upper left corner of the frame.
        Specified by:
        getScreenPoint in class AbstractResizeHotSpot
        Returns:
        Screen point measured from upper left corner of the screen (AWT coordinates).
      • setScreenPoint

        protected void setScreenPoint​(java.awt.Point newPoint)
        Set the screen point of the upper left corner of the frame.
        Specified by:
        setScreenPoint in class AbstractResizeHotSpot
        Parameters:
        newPoint - New screen point measured from upper left corner of the screen (AWT coordinates).