Class AbstractHotSpot

  • 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
    Direct Known Subclasses:
    AbstractResizeHotSpot, TreeHotSpot

    public abstract class AbstractHotSpot
    extends AVListImpl
    implements HotSpot
    AbstractHotSpot is an abstract base class for the HotSpot interface. The methods in AbstractHotSpot are empty or simply return null. This is a convenience class for that enables a subclass to override only the events its interested in.
    • Field Detail

      • active

        protected boolean active
        Indicates whether or not this HotSpot is active.
    • Constructor Detail

      • AbstractHotSpot

        public AbstractHotSpot()
        Creates a new AbstractHotSpot, but otherwise does nothing.
    • Method Detail

      • setActive

        public void setActive​(boolean active)
        Called when this HotSpot is activated or deactivated. The HotSpot only receives input events when it is active.
        Specified by:
        setActive in interface HotSpot
        Parameters:
        active - true if this HotSpot is being activated. false if this HotSpot is being deactivated.
      • isActive

        public boolean isActive()
        Indicates whether or not this HotSpot is active.
        Specified by:
        isActive in interface HotSpot
        Returns:
        true if this HotSpot is active, false if not.
      • selected

        public void selected​(SelectEvent event)
        Called when the HotSpot is selected in the WorldWindow. The default implementation does nothing. Override this method to handle select events.
        Specified by:
        selected in interface HotSpot
        Specified by:
        selected in interface SelectListener
        Parameters:
        event - The event to handle.
      • keyTyped

        public void keyTyped​(java.awt.event.KeyEvent event)
        Called when a key is typed and the HotSpot is active. The default implementation does nothing. Override this method to handle key typed events.
        Specified by:
        keyTyped in interface HotSpot
        Specified by:
        keyTyped in interface java.awt.event.KeyListener
        Parameters:
        event - The event to handle.
      • keyPressed

        public void keyPressed​(java.awt.event.KeyEvent event)
        Called when a key is pressed and the HotSpot is active. The default implementation does nothing. Override this method to handle key pressed events.
        Specified by:
        keyPressed in interface HotSpot
        Specified by:
        keyPressed in interface java.awt.event.KeyListener
        Parameters:
        event - The event to handle.
      • keyReleased

        public void keyReleased​(java.awt.event.KeyEvent event)
        Called when a key is released and the HotSpot is active. The default implementation does nothing. Override this method to handle key released events.
        Specified by:
        keyReleased in interface HotSpot
        Specified by:
        keyReleased in interface java.awt.event.KeyListener
        Parameters:
        event - The event to handle.
      • mouseClicked

        public void mouseClicked​(java.awt.event.MouseEvent event)
        Called when the mouse is clicked on the HotSpot in the WorldWindow. The default implementation does nothing. Override this method to handle mouse click events.
        Specified by:
        mouseClicked in interface HotSpot
        Specified by:
        mouseClicked in interface java.awt.event.MouseListener
        Parameters:
        event - The event to handle.
      • mousePressed

        public void mousePressed​(java.awt.event.MouseEvent event)
        Called when the mouse is pressed over the HotSpot in the WorldWindow. The default implementation does nothing. Override this method to handle mouse pressed events.
        Specified by:
        mousePressed in interface HotSpot
        Specified by:
        mousePressed in interface java.awt.event.MouseListener
        Parameters:
        event - The event to handle.
      • mouseReleased

        public void mouseReleased​(java.awt.event.MouseEvent event)
        Called when the mouse is released over the HotSpot in the WorldWindow. The default implementation does nothing. Override this method to handle mouse released events.
        Specified by:
        mouseReleased in interface HotSpot
        Specified by:
        mouseReleased in interface java.awt.event.MouseListener
        Parameters:
        event - The event to handle.
      • mouseEntered

        public void mouseEntered​(java.awt.event.MouseEvent event)
        Called when the mouse enters the WorldWindow and the HotSpot is active. The default implementation does nothing. Override this method to handle mouse enter events.
        Specified by:
        mouseEntered in interface HotSpot
        Specified by:
        mouseEntered in interface java.awt.event.MouseListener
        Parameters:
        event - The event to handle.
      • mouseExited

        public void mouseExited​(java.awt.event.MouseEvent event)
        Called when the mouse exits the WorldWindow and the HotSpot is active. The default implementation does nothing. Override this method to handle mouse exit events.
        Specified by:
        mouseExited in interface HotSpot
        Specified by:
        mouseExited in interface java.awt.event.MouseListener
        Parameters:
        event - The event to handle.
      • mouseDragged

        public void mouseDragged​(java.awt.event.MouseEvent event)
        Called when the mouse is dragged in the WorldWindow and the HotSpot is active. The default implementation does nothing. Override this method to handle mouse dragged events.
        Specified by:
        mouseDragged in interface HotSpot
        Specified by:
        mouseDragged in interface java.awt.event.MouseMotionListener
        Parameters:
        event - The event to handle.
      • mouseMoved

        public void mouseMoved​(java.awt.event.MouseEvent event)
        Called when the cursor moves over the HotSpot in the WorldWindow. The default implementation does nothing. Override this method to handle mouse move events.
        Specified by:
        mouseMoved in interface HotSpot
        Specified by:
        mouseMoved in interface java.awt.event.MouseMotionListener
        Parameters:
        event - The event to handle.
      • mouseWheelMoved

        public void mouseWheelMoved​(java.awt.event.MouseWheelEvent event)
        Called when the mouse wheel is moved in the WorldWindow and HotSpot is active. The default implementation does nothing. Override this method to handle mouse wheel events.
        Specified by:
        mouseWheelMoved in interface HotSpot
        Specified by:
        mouseWheelMoved in interface java.awt.event.MouseWheelListener
        Parameters:
        event - The event to handle.
      • getCursor

        public java.awt.Cursor getCursor()
        Returns a null Cursor, indicating the default cursor should be used when the HotSpot is active.
        Specified by:
        getCursor in interface HotSpot
        Returns:
        A null Cursor.
      • isConsumed

        protected boolean isConsumed​(SelectEvent event)
        Determine if a select event, or the mouse event that generated the select event, has been consumed.
        Parameters:
        event - Event to test.
        Returns:
        true if event has been consumed, or if event was triggered by a mouse event, and that mouse event has been consumed.