org.scijava.input
Class DefaultInputService

java.lang.Object
  extended by org.scijava.AbstractContextual
      extended by org.scijava.plugin.AbstractRichPlugin
          extended by org.scijava.service.AbstractService
              extended by 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

Constructor Summary
DefaultInputService()
           
 
Method Summary
 Display<?> getDisplay()
          Gets the display associated with the last observed mouse cursor.
 EventService getEventService()
           
 InputModifiers getModifiers()
           
 int getX()
          Gets the last observed X coordinate of the mouse cursor, relative to a specific display.
 int getY()
          Gets the last observed Y coordinate of the mouse cursor, relative to a specific display.
 boolean isAltDown()
           
 boolean isAltGrDown()
           
 boolean isButtonDown(int button)
          Gets whether the given mouse button is currently pressed.
 boolean isCtrlDown()
           
 boolean isKeyDown(KeyCode code)
           
 boolean isMetaDown()
           
 boolean isShiftDown()
           
protected  void onEvent(DisplayDeletedEvent evt)
           
 void onEvent(KyPressedEvent evt)
           
 void onEvent(KyReleasedEvent evt)
           
protected  void onEvent(MsExitedEvent evt)
           
protected  void onEvent(MsMovedEvent evt)
           
protected  void onEvent(MsPressedEvent evt)
           
protected  void onEvent(MsReleasedEvent evt)
           
 
Methods inherited from class org.scijava.service.AbstractService
dispose, getContext, initialize, registerEventHandlers, setContext, toString
 
Methods inherited from class org.scijava.plugin.AbstractRichPlugin
compareTo, getInfo, getPriority, setInfo, setPriority
 
Methods inherited from class org.scijava.AbstractContextual
context
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.scijava.service.Service
initialize, registerEventHandlers
 
Methods inherited from interface org.scijava.Contextual
context, getContext, setContext
 
Methods inherited from interface org.scijava.Prioritized
getPriority, setPriority
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface org.scijava.plugin.HasPluginInfo
getInfo, setInfo
 
Methods inherited from interface org.scijava.Disposable
dispose
 

Constructor Detail

DefaultInputService

public DefaultInputService()
Method Detail

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.