NASA World Wind

gov.nasa.worldwind.util
Class AbstractHotSpot

java.lang.Object
  extended by gov.nasa.worldwind.avlist.AVListImpl
      extended by gov.nasa.worldwind.util.AbstractHotSpot
All Implemented Interfaces:
AVList, SelectListener, HotSpot, KeyListener, MouseListener, MouseMotionListener, MouseWheelListener, 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 Summary
protected  boolean active
          Indicates whether or not this HotSpot is active.
 
Constructor Summary
AbstractHotSpot()
          Creates a new AbstractHotSpot, but otherwise does nothing.
 
Method Summary
 Cursor getCursor()
          Returns a null Cursor, indicating the default cursor should be used when the HotSpot is active.
 boolean isActive()
          Indicates whether or not this HotSpot is active.
protected  boolean isConsumed(SelectEvent event)
          Determine if a select event, or the mouse event that generated the select event, has been consumed.
 void keyPressed(KeyEvent event)
          Called when a key is pressed and the HotSpot is active.
 void keyReleased(KeyEvent event)
          Called when a key is released and the HotSpot is active.
 void keyTyped(KeyEvent event)
          Called when a key is typed and the HotSpot is active.
 void mouseClicked(MouseEvent event)
          Called when the mouse is clicked on the HotSpot in the World Window.
 void mouseDragged(MouseEvent event)
          Called when the mouse is dragged in the World Window and the HotSpot is active.
 void mouseEntered(MouseEvent event)
          Called when the mouse enters the World Window and the HotSpot is active.
 void mouseExited(MouseEvent event)
          Called when the mouse exits the World Window and the HotSpot is active.
 void mouseMoved(MouseEvent event)
          Called when the cursor moves over the HotSpot in the World Window.
 void mousePressed(MouseEvent event)
          Called when the mouse is pressed over the HotSpot in the World Window.
 void mouseReleased(MouseEvent event)
          Called when the mouse is released over the HotSpot in the World Window.
 void mouseWheelMoved(MouseWheelEvent event)
          Called when the mouse wheel is moved in the World Window and HotSpot is active.
 void selected(SelectEvent event)
          Called when the HotSpot is selected in the World Window.
 void setActive(boolean active)
          Called when this HotSpot is activated or deactivated.
 
Methods inherited from class gov.nasa.worldwind.avlist.AVListImpl
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getBooleanValue, getBooleanValue, getChangeSupport, getDoubleValue, getDoubleValue, getEntries, getIntegerValue, getIntegerValue, getLongValue, getLongValue, getRestorableStateForAVPair, getStringValue, getStringValue, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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

getCursor

public 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.

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.

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.

keyPressed

public void keyPressed(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 KeyListener
Parameters:
event - The event to handle.

keyReleased

public void keyReleased(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 KeyListener
Parameters:
event - The event to handle.

keyTyped

public void keyTyped(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 KeyListener
Parameters:
event - The event to handle.

mouseClicked

public void mouseClicked(MouseEvent event)
Called when the mouse is clicked on the HotSpot in the World Window. The default implementation does nothing. Override this method to handle mouse click events.

Specified by:
mouseClicked in interface HotSpot
Specified by:
mouseClicked in interface MouseListener
Parameters:
event - The event to handle.

mouseDragged

public void mouseDragged(MouseEvent event)
Called when the mouse is dragged in the World Window 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 MouseMotionListener
Parameters:
event - The event to handle.

mouseEntered

public void mouseEntered(MouseEvent event)
Called when the mouse enters the World Window 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 MouseListener
Parameters:
event - The event to handle.

mouseExited

public void mouseExited(MouseEvent event)
Called when the mouse exits the World Window 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 MouseListener
Parameters:
event - The event to handle.

mouseMoved

public void mouseMoved(MouseEvent event)
Called when the cursor moves over the HotSpot in the World Window. The default implementation does nothing. Override this method to handle mouse move events.

Specified by:
mouseMoved in interface HotSpot
Specified by:
mouseMoved in interface MouseMotionListener
Parameters:
event - The event to handle.

mousePressed

public void mousePressed(MouseEvent event)
Called when the mouse is pressed over the HotSpot in the World Window. The default implementation does nothing. Override this method to handle mouse pressed events.

Specified by:
mousePressed in interface HotSpot
Specified by:
mousePressed in interface MouseListener
Parameters:
event - The event to handle.

mouseReleased

public void mouseReleased(MouseEvent event)
Called when the mouse is released over the HotSpot in the World Window. The default implementation does nothing. Override this method to handle mouse released events.

Specified by:
mouseReleased in interface HotSpot
Specified by:
mouseReleased in interface MouseListener
Parameters:
event - The event to handle.

mouseWheelMoved

public void mouseWheelMoved(MouseWheelEvent event)
Called when the mouse wheel is moved in the World Window 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 MouseWheelListener
Parameters:
event - The event to handle.

selected

public void selected(SelectEvent event)
Called when the HotSpot is selected in the World Window. The default implementation does nothing. Override this method to handle select events.

Specified by:
selected in interface SelectListener
Specified by:
selected in interface HotSpot
Parameters:
event - The event to handle.

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.

NASA World Wind