public class AWTInputHandler extends WWObjectImpl implements java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.MouseWheelListener, java.awt.event.FocusListener, InputHandler, Disposable
Modifier and Type | Field and Description |
---|---|
protected javax.swing.event.EventListenerList |
eventListeners |
protected boolean |
forceRedrawOnMousePressed |
protected PickedObjectList |
hoverObjects |
protected javax.swing.Timer |
hoverTimer |
protected boolean |
isDragging |
protected boolean |
isHovering |
protected java.awt.Point |
mousePoint |
protected PickedObjectList |
objectsAtButtonPress |
protected SelectListener |
selectListener |
protected WorldWindow |
wwd |
Constructor and Description |
---|
AWTInputHandler() |
Modifier and Type | Method and Description |
---|---|
void |
addKeyListener(java.awt.event.KeyListener listener) |
void |
addMouseListener(java.awt.event.MouseListener listener) |
void |
addMouseMotionListener(java.awt.event.MouseMotionListener listener) |
void |
addMouseWheelListener(java.awt.event.MouseWheelListener listener) |
void |
addSelectListener(SelectListener listener) |
protected void |
callKeyPressedListeners(java.awt.event.KeyEvent event) |
protected void |
callKeyReleasedListeners(java.awt.event.KeyEvent event) |
protected void |
callKeyTypedListeners(java.awt.event.KeyEvent event) |
protected void |
callMouseClickedListeners(java.awt.event.MouseEvent event) |
protected void |
callMouseDraggedListeners(java.awt.event.MouseEvent event) |
protected void |
callMouseEnteredListeners(java.awt.event.MouseEvent event) |
protected void |
callMouseExitedListeners(java.awt.event.MouseEvent event) |
protected void |
callMouseMovedListeners(java.awt.event.MouseEvent event) |
protected void |
callMousePressedListeners(java.awt.event.MouseEvent event) |
protected void |
callMouseReleasedListeners(java.awt.event.MouseEvent event) |
protected void |
callMouseWheelMovedListeners(java.awt.event.MouseWheelEvent event) |
protected void |
callSelectListeners(SelectEvent event) |
protected void |
cancelDrag() |
protected void |
cancelHover() |
void |
dispose()
Disposes of any internal resources allocated by the object.
|
protected void |
doHover(boolean reset) |
void |
focusGained(java.awt.event.FocusEvent focusEvent) |
void |
focusLost(java.awt.event.FocusEvent focusEvent) |
WorldWindow |
getEventSource() |
int |
getHoverDelay() |
protected PickedObjectList |
getHoverObjects() |
protected java.awt.Point |
getMousePoint() |
protected PickedObjectList |
getObjectsAtButtonPress() |
protected WorldWindow |
getWorldWindow() |
boolean |
isForceRedrawOnMousePressed()
Indicates whether a redraw is forced when the a mouse button is pressed.
|
protected boolean |
isHovering() |
boolean |
isLockViewHeading() |
protected boolean |
isPickListEmpty(PickedObjectList pickList) |
boolean |
isSmoothViewChanges() |
boolean |
isStopViewOnFocusLost() |
void |
keyPressed(java.awt.event.KeyEvent keyEvent) |
void |
keyReleased(java.awt.event.KeyEvent keyEvent) |
void |
keyTyped(java.awt.event.KeyEvent keyEvent) |
void |
mouseClicked(java.awt.event.MouseEvent mouseEvent) |
void |
mouseDragged(java.awt.event.MouseEvent mouseEvent) |
void |
mouseEntered(java.awt.event.MouseEvent mouseEvent) |
void |
mouseExited(java.awt.event.MouseEvent mouseEvent) |
void |
mouseMoved(java.awt.event.MouseEvent mouseEvent) |
void |
mousePressed(java.awt.event.MouseEvent mouseEvent) |
void |
mouseReleased(java.awt.event.MouseEvent mouseEvent) |
void |
mouseWheelMoved(java.awt.event.MouseWheelEvent mouseWheelEvent) |
protected boolean |
pickMatches(PickedObjectList pickedObjects) |
void |
propertyChange(java.beans.PropertyChangeEvent event)
The property change listener for this instance.
|
void |
removeHoverSelectListener() |
void |
removeKeyListener(java.awt.event.KeyListener listener) |
void |
removeMouseListener(java.awt.event.MouseListener listener) |
void |
removeMouseMotionListener(java.awt.event.MouseMotionListener listener) |
void |
removeMouseWheelListener(java.awt.event.MouseWheelListener listener) |
void |
removeSelectListener(SelectListener listener) |
void |
setEventSource(WorldWindow newWorldWindow) |
void |
setForceRedrawOnMousePressed(boolean forceRedrawOnMousePressed)
Specifies whether a redraw is forced when the a mouse button is pressed.
|
void |
setHoverDelay(int delay) |
protected void |
setHovering(boolean hovering) |
protected void |
setHoverObjects(PickedObjectList hoverObjects) |
void |
setLockViewHeading(boolean lockHeading) |
protected void |
setMousePoint(java.awt.Point mousePoint) |
protected void |
setObjectsAtButtonPress(PickedObjectList objectsAtButtonPress) |
void |
setSmoothViewChanges(boolean smoothViewChanges) |
void |
setStopViewOnFocusLost(boolean stopView) |
onMessage
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addPropertyChangeListener, addPropertyChangeListener, clearList, copy, firePropertyChange, firePropertyChange, getEntries, getStringValue, getValue, getValues, hasKey, removeKey, removePropertyChangeListener, removePropertyChangeListener, setValue, setValues
protected javax.swing.event.EventListenerList eventListeners
protected boolean forceRedrawOnMousePressed
protected PickedObjectList hoverObjects
protected javax.swing.Timer hoverTimer
protected boolean isDragging
protected boolean isHovering
protected java.awt.Point mousePoint
protected PickedObjectList objectsAtButtonPress
protected SelectListener selectListener
protected WorldWindow wwd
public void addKeyListener(java.awt.event.KeyListener listener)
addKeyListener
in interface InputHandler
public void addMouseListener(java.awt.event.MouseListener listener)
addMouseListener
in interface InputHandler
public void addMouseMotionListener(java.awt.event.MouseMotionListener listener)
addMouseMotionListener
in interface InputHandler
public void addMouseWheelListener(java.awt.event.MouseWheelListener listener)
addMouseWheelListener
in interface InputHandler
public void addSelectListener(SelectListener listener)
addSelectListener
in interface InputHandler
protected void callKeyPressedListeners(java.awt.event.KeyEvent event)
protected void callKeyReleasedListeners(java.awt.event.KeyEvent event)
protected void callKeyTypedListeners(java.awt.event.KeyEvent event)
protected void callMouseClickedListeners(java.awt.event.MouseEvent event)
protected void callMouseDraggedListeners(java.awt.event.MouseEvent event)
protected void callMouseEnteredListeners(java.awt.event.MouseEvent event)
protected void callMouseExitedListeners(java.awt.event.MouseEvent event)
protected void callMouseMovedListeners(java.awt.event.MouseEvent event)
protected void callMousePressedListeners(java.awt.event.MouseEvent event)
protected void callMouseReleasedListeners(java.awt.event.MouseEvent event)
protected void callMouseWheelMovedListeners(java.awt.event.MouseWheelEvent event)
protected void callSelectListeners(SelectEvent event)
protected void cancelDrag()
protected void cancelHover()
public void dispose()
Disposable
dispose
in interface Disposable
dispose
in interface InputHandler
protected void doHover(boolean reset)
public void focusGained(java.awt.event.FocusEvent focusEvent)
focusGained
in interface java.awt.event.FocusListener
public void focusLost(java.awt.event.FocusEvent focusEvent)
focusLost
in interface java.awt.event.FocusListener
public WorldWindow getEventSource()
getEventSource
in interface InputHandler
public int getHoverDelay()
getHoverDelay
in interface InputHandler
protected PickedObjectList getHoverObjects()
protected java.awt.Point getMousePoint()
protected PickedObjectList getObjectsAtButtonPress()
protected WorldWindow getWorldWindow()
public boolean isForceRedrawOnMousePressed()
InputHandler
isForceRedrawOnMousePressed
in interface InputHandler
protected boolean isHovering()
public boolean isLockViewHeading()
protected boolean isPickListEmpty(PickedObjectList pickList)
public boolean isSmoothViewChanges()
public boolean isStopViewOnFocusLost()
public void keyPressed(java.awt.event.KeyEvent keyEvent)
keyPressed
in interface java.awt.event.KeyListener
public void keyReleased(java.awt.event.KeyEvent keyEvent)
keyReleased
in interface java.awt.event.KeyListener
public void keyTyped(java.awt.event.KeyEvent keyEvent)
keyTyped
in interface java.awt.event.KeyListener
public void mouseClicked(java.awt.event.MouseEvent mouseEvent)
mouseClicked
in interface java.awt.event.MouseListener
public void mouseDragged(java.awt.event.MouseEvent mouseEvent)
mouseDragged
in interface java.awt.event.MouseMotionListener
public void mouseEntered(java.awt.event.MouseEvent mouseEvent)
mouseEntered
in interface java.awt.event.MouseListener
public void mouseExited(java.awt.event.MouseEvent mouseEvent)
mouseExited
in interface java.awt.event.MouseListener
public void mouseMoved(java.awt.event.MouseEvent mouseEvent)
mouseMoved
in interface java.awt.event.MouseMotionListener
public void mousePressed(java.awt.event.MouseEvent mouseEvent)
mousePressed
in interface java.awt.event.MouseListener
public void mouseReleased(java.awt.event.MouseEvent mouseEvent)
mouseReleased
in interface java.awt.event.MouseListener
public void mouseWheelMoved(java.awt.event.MouseWheelEvent mouseWheelEvent)
mouseWheelMoved
in interface java.awt.event.MouseWheelListener
protected boolean pickMatches(PickedObjectList pickedObjects)
public void propertyChange(java.beans.PropertyChangeEvent event)
WWObjectImpl
propertyChange
in interface java.beans.PropertyChangeListener
propertyChange
in class WWObjectImpl
event
- the eventpublic void removeHoverSelectListener()
public void removeKeyListener(java.awt.event.KeyListener listener)
removeKeyListener
in interface InputHandler
public void removeMouseListener(java.awt.event.MouseListener listener)
removeMouseListener
in interface InputHandler
public void removeMouseMotionListener(java.awt.event.MouseMotionListener listener)
removeMouseMotionListener
in interface InputHandler
public void removeMouseWheelListener(java.awt.event.MouseWheelListener listener)
removeMouseWheelListener
in interface InputHandler
public void removeSelectListener(SelectListener listener)
removeSelectListener
in interface InputHandler
public void setEventSource(WorldWindow newWorldWindow)
setEventSource
in interface InputHandler
public void setForceRedrawOnMousePressed(boolean forceRedrawOnMousePressed)
InputHandler
setForceRedrawOnMousePressed
in interface InputHandler
forceRedrawOnMousePressed
- true to force a redraw on button press, otherwise false, the default.public void setHoverDelay(int delay)
setHoverDelay
in interface InputHandler
protected void setHovering(boolean hovering)
protected void setHoverObjects(PickedObjectList hoverObjects)
public void setLockViewHeading(boolean lockHeading)
protected void setMousePoint(java.awt.Point mousePoint)
protected void setObjectsAtButtonPress(PickedObjectList objectsAtButtonPress)
public void setSmoothViewChanges(boolean smoothViewChanges)
public void setStopViewOnFocusLost(boolean stopView)