org.scijava.input
Class DefaultInputService
java.lang.Object
org.scijava.AbstractContextual
org.scijava.plugin.AbstractRichPlugin
org.scijava.service.AbstractService
org.scijava.input.DefaultInputService
- All Implemented Interfaces:
- Comparable<Prioritized>, Contextual, Disposable, InputService, HasPluginInfo, RichPlugin, SciJavaPlugin, Prioritized, SciJavaService, Service
public class DefaultInputService
- extends AbstractService
- implements InputService
Default implementation of InputService
.
- Author:
- Curtis Rueden
DefaultInputService
public DefaultInputService()
getEventService
public EventService getEventService()
- Specified by:
getEventService
in interface InputService
getModifiers
public InputModifiers getModifiers()
- Specified by:
getModifiers
in interface InputService
isAltDown
public boolean isAltDown()
- Specified by:
isAltDown
in interface InputService
isAltGrDown
public boolean isAltGrDown()
- Specified by:
isAltGrDown
in interface InputService
isCtrlDown
public boolean isCtrlDown()
- Specified by:
isCtrlDown
in interface InputService
isMetaDown
public boolean isMetaDown()
- Specified by:
isMetaDown
in interface InputService
isShiftDown
public boolean isShiftDown()
- Specified by:
isShiftDown
in interface InputService
isKeyDown
public boolean isKeyDown(KeyCode code)
- Specified by:
isKeyDown
in interface InputService
getDisplay
public Display<?> getDisplay()
- Description copied from interface:
InputService
- Gets the display associated with the last observed mouse cursor.
- Specified by:
getDisplay
in interface InputService
- Returns:
- The display in question, or null if the display has been deleted,
or the mouse cursor is outside all known displays, or no mouse
events have ever been observed.
getX
public int getX()
- Description copied from interface:
InputService
- Gets the last observed X coordinate of the mouse cursor, relative to a
specific display.
- Specified by:
getX
in interface InputService
- See Also:
InputService.getDisplay()
getY
public int getY()
- Description copied from interface:
InputService
- Gets the last observed Y coordinate of the mouse cursor, relative to a
specific display.
- Specified by:
getY
in interface InputService
- See Also:
InputService.getDisplay()
isButtonDown
public boolean isButtonDown(int button)
- Description copied from interface:
InputService
- Gets whether the given mouse button is currently pressed.
- Specified by:
isButtonDown
in interface InputService
- Parameters:
button
- One of:
onEvent
public void onEvent(KyPressedEvent evt)
onEvent
public void onEvent(KyReleasedEvent evt)
onEvent
protected void onEvent(MsMovedEvent evt)
onEvent
protected void onEvent(MsExitedEvent evt)
onEvent
protected void onEvent(MsPressedEvent evt)
onEvent
protected void onEvent(MsReleasedEvent evt)
onEvent
protected void onEvent(DisplayDeletedEvent evt)
Copyright © 2009–2014 SciJava. All rights reserved.