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 theHotSpotinterface. 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 booleanactiveIndicates 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.CursorgetCursor()Returns anullCursor, indicating the default cursor should be used when the HotSpot is active.booleanisActive()Indicates whether or not this HotSpot is active.protected booleanisConsumed(SelectEvent event)Determine if a select event, or the mouse event that generated the select event, has been consumed.voidkeyPressed(java.awt.event.KeyEvent event)Called when a key is pressed and the HotSpot is active.voidkeyReleased(java.awt.event.KeyEvent event)Called when a key is released and the HotSpot is active.voidkeyTyped(java.awt.event.KeyEvent event)Called when a key is typed and the HotSpot is active.voidmouseClicked(java.awt.event.MouseEvent event)Called when the mouse is clicked on the HotSpot in the WorldWindow.voidmouseDragged(java.awt.event.MouseEvent event)Called when the mouse is dragged in the WorldWindow and the HotSpot is active.voidmouseEntered(java.awt.event.MouseEvent event)Called when the mouse enters the WorldWindow and the HotSpot is active.voidmouseExited(java.awt.event.MouseEvent event)Called when the mouse exits the WorldWindow and the HotSpot is active.voidmouseMoved(java.awt.event.MouseEvent event)Called when the cursor moves over the HotSpot in the WorldWindow.voidmousePressed(java.awt.event.MouseEvent event)Called when the mouse is pressed over the HotSpot in the WorldWindow.voidmouseReleased(java.awt.event.MouseEvent event)Called when the mouse is released over the HotSpot in the WorldWindow.voidmouseWheelMoved(java.awt.event.MouseWheelEvent event)Called when the mouse wheel is moved in the WorldWindow and HotSpot is active.voidselected(SelectEvent event)Called when the HotSpot is selected in the WorldWindow.voidsetActive(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:
selectedin interfaceHotSpot- Specified by:
selectedin 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:
keyPressedin interfaceHotSpot- Specified by:
keyPressedin 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:
keyReleasedin interfaceHotSpot- Specified by:
keyReleasedin 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:
mouseClickedin interfaceHotSpot- Specified by:
mouseClickedin 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:
mousePressedin interfaceHotSpot- Specified by:
mousePressedin 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:
mouseReleasedin interfaceHotSpot- Specified by:
mouseReleasedin 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:
mouseEnteredin interfaceHotSpot- Specified by:
mouseEnteredin 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:
mouseExitedin interfaceHotSpot- Specified by:
mouseExitedin 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:
mouseDraggedin interfaceHotSpot- Specified by:
mouseDraggedin 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:
mouseMovedin interfaceHotSpot- Specified by:
mouseMovedin 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:
mouseWheelMovedin interfaceHotSpot- Specified by:
mouseWheelMovedin interfacejava.awt.event.MouseWheelListener- Parameters:
event- The event to handle.
-
getCursor
public java.awt.Cursor getCursor()
Returns anullCursor, 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:
trueifeventhas been consumed, or ifeventwas triggered by a mouse event, and that mouse event has been consumed.
-
-