public class AWTInputHandler extends WWObjectImpl implements KeyListener, MouseListener, MouseMotionListener, MouseWheelListener, FocusListener, InputHandler, Disposable
Modifier and Type | Field and Description |
---|---|
protected EventListenerList |
eventListeners |
protected boolean |
forceRedrawOnMousePressed |
protected PickedObjectList |
hoverObjects |
protected Timer |
hoverTimer |
protected boolean |
isDragging |
protected boolean |
isHovering |
protected Point |
mousePoint |
protected PickedObjectList |
objectsAtButtonPress |
protected SelectListener |
selectListener |
protected WorldWindow |
wwd |
Constructor and Description |
---|
AWTInputHandler() |
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 EventListenerList eventListeners
protected boolean forceRedrawOnMousePressed
protected PickedObjectList hoverObjects
protected Timer hoverTimer
protected boolean isDragging
protected boolean isHovering
protected Point mousePoint
protected PickedObjectList objectsAtButtonPress
protected SelectListener selectListener
protected WorldWindow wwd
public void addKeyListener(KeyListener listener)
addKeyListener
in interface InputHandler
public void addMouseListener(MouseListener listener)
addMouseListener
in interface InputHandler
public void addMouseMotionListener(MouseMotionListener listener)
addMouseMotionListener
in interface InputHandler
public void addMouseWheelListener(MouseWheelListener listener)
addMouseWheelListener
in interface InputHandler
public void addSelectListener(SelectListener listener)
addSelectListener
in interface InputHandler
protected void callKeyPressedListeners(KeyEvent event)
protected void callKeyReleasedListeners(KeyEvent event)
protected void callKeyTypedListeners(KeyEvent event)
protected void callMouseClickedListeners(MouseEvent event)
protected void callMouseDraggedListeners(MouseEvent event)
protected void callMouseEnteredListeners(MouseEvent event)
protected void callMouseExitedListeners(MouseEvent event)
protected void callMouseMovedListeners(MouseEvent event)
protected void callMousePressedListeners(MouseEvent event)
protected void callMouseReleasedListeners(MouseEvent event)
protected void callMouseWheelMovedListeners(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(FocusEvent focusEvent)
focusGained
in interface FocusListener
public void focusLost(FocusEvent focusEvent)
focusLost
in interface FocusListener
public WorldWindow getEventSource()
getEventSource
in interface InputHandler
public int getHoverDelay()
getHoverDelay
in interface InputHandler
protected PickedObjectList getHoverObjects()
protected 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(KeyEvent keyEvent)
keyPressed
in interface KeyListener
public void keyReleased(KeyEvent keyEvent)
keyReleased
in interface KeyListener
public void keyTyped(KeyEvent keyEvent)
keyTyped
in interface KeyListener
public void mouseClicked(MouseEvent mouseEvent)
mouseClicked
in interface MouseListener
public void mouseDragged(MouseEvent mouseEvent)
mouseDragged
in interface MouseMotionListener
public void mouseEntered(MouseEvent mouseEvent)
mouseEntered
in interface MouseListener
public void mouseExited(MouseEvent mouseEvent)
mouseExited
in interface MouseListener
public void mouseMoved(MouseEvent mouseEvent)
mouseMoved
in interface MouseMotionListener
public void mousePressed(MouseEvent mouseEvent)
mousePressed
in interface MouseListener
public void mouseReleased(MouseEvent mouseEvent)
mouseReleased
in interface MouseListener
public void mouseWheelMoved(MouseWheelEvent mouseWheelEvent)
mouseWheelMoved
in interface MouseWheelListener
protected boolean pickMatches(PickedObjectList pickedObjects)
public void propertyChange(PropertyChangeEvent event)
WWObjectImpl
propertyChange
in interface PropertyChangeListener
propertyChange
in class WWObjectImpl
event
- the eventpublic void removeHoverSelectListener()
public void removeKeyListener(KeyListener listener)
removeKeyListener
in interface InputHandler
public void removeMouseListener(MouseListener listener)
removeMouseListener
in interface InputHandler
public void removeMouseMotionListener(MouseMotionListener listener)
removeMouseMotionListener
in interface InputHandler
public void removeMouseWheelListener(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(Point mousePoint)
protected void setObjectsAtButtonPress(PickedObjectList objectsAtButtonPress)
public void setSmoothViewChanges(boolean smoothViewChanges)
public void setStopViewOnFocusLost(boolean stopView)