Package gov.nasa.worldwind.util
Class AbstractHotSpot
- java.lang.Object
-
- gov.nasa.worldwind.avlist.AVListImpl
-
- gov.nasa.worldwind.util.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 theHotSpot
interface. The methods in AbstractHotSpot are empty or simply returnnull
. This is a convenience class for that enables a subclass to override only the events its interested in.
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
active
Indicates whether or not this HotSpot is active.
-
Constructor Summary
Constructors Constructor Description AbstractHotSpot()
Creates a new AbstractHotSpot, but otherwise does nothing.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.awt.Cursor
getCursor()
Returns anull
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(java.awt.event.KeyEvent event)
Called when a key is pressed and the HotSpot is active.void
keyReleased(java.awt.event.KeyEvent event)
Called when a key is released and the HotSpot is active.void
keyTyped(java.awt.event.KeyEvent event)
Called when a key is typed and the HotSpot is active.void
mouseClicked(java.awt.event.MouseEvent event)
Called when the mouse is clicked on the HotSpot in the WorldWindow.void
mouseDragged(java.awt.event.MouseEvent event)
Called when the mouse is dragged in the WorldWindow and the HotSpot is active.void
mouseEntered(java.awt.event.MouseEvent event)
Called when the mouse enters the WorldWindow and the HotSpot is active.void
mouseExited(java.awt.event.MouseEvent event)
Called when the mouse exits the WorldWindow and the HotSpot is active.void
mouseMoved(java.awt.event.MouseEvent event)
Called when the cursor moves over the HotSpot in the WorldWindow.void
mousePressed(java.awt.event.MouseEvent event)
Called when the mouse is pressed over the HotSpot in the WorldWindow.void
mouseReleased(java.awt.event.MouseEvent event)
Called when the mouse is released over the HotSpot in the WorldWindow.void
mouseWheelMoved(java.awt.event.MouseWheelEvent event)
Called when the mouse wheel is moved in the WorldWindow and HotSpot is active.void
selected(SelectEvent event)
Called when the HotSpot is selected in the WorldWindow.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
-
-
-
-
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.
-
isActive
public boolean isActive()
Indicates whether or not this HotSpot is active.
-
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 interfaceHotSpot
- Specified by:
selected
in interfaceSelectListener
- 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.
-
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 interfaceHotSpot
- Specified by:
keyPressed
in interfacejava.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 interfaceHotSpot
- Specified by:
keyReleased
in interfacejava.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 interfaceHotSpot
- Specified by:
mouseClicked
in interfacejava.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 interfaceHotSpot
- Specified by:
mousePressed
in interfacejava.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 interfaceHotSpot
- Specified by:
mouseReleased
in interfacejava.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 interfaceHotSpot
- Specified by:
mouseEntered
in interfacejava.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 interfaceHotSpot
- Specified by:
mouseExited
in interfacejava.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 interfaceHotSpot
- Specified by:
mouseDragged
in interfacejava.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 interfaceHotSpot
- Specified by:
mouseMoved
in interfacejava.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 interfaceHotSpot
- Specified by:
mouseWheelMoved
in interfacejava.awt.event.MouseWheelListener
- Parameters:
event
- The event to handle.
-
getCursor
public java.awt.Cursor getCursor()
Returns anull
Cursor, indicating the default cursor should be used when the HotSpot is active.
-
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
ifevent
has been consumed, or ifevent
was triggered by a mouse event, and that mouse event has been consumed.
-
-