de.javagl.swogl
Class MouseEventConditions

java.lang.Object
  extended by de.javagl.swogl.MouseEventConditions

public class MouseEventConditions
extends java.lang.Object

This class contains utility methods for creating Conditions that may be applied to MouseEvents.


Method Summary
static Condition<java.awt.event.MouseEvent> altDownCondition()
          Returns a new condition that checks whether mouse events have happened while the ALT button was down
static Condition<java.awt.event.MouseEvent> altGraphDownCondition()
          Returns a new condition that checks whether mouse events have happened while the ALT-GR button was down
static Condition<java.awt.event.MouseEvent> buttonCondition(int button)
          Returns a new condition that checks whether the the specified button was pressed when the mouse event occurred.
static Condition<java.awt.event.MouseEvent> controlDownCondition()
          Returns a new condition that checks whether mouse events have happened while the CTRL button was down
static Condition<java.awt.event.MouseEvent> falseCondition()
          Returns a new Condition that is always false
static Condition<java.awt.event.MouseEvent> flagCondition(int flags)
          Returns a new condition that checks whether the the given flags are set in the extended modifiers of a mouse event.
static Condition<java.awt.event.MouseEvent> metaDownCondition()
          Returns a new condition that checks whether mouse events have happened while the META button was down
static Condition<java.awt.event.MouseEvent> popupTriggerCondition()
          Returns a new condition that checks whether mouse events are popup triggers.
static Condition<java.awt.event.MouseEvent> shiftDownCondition()
          Returns a new condition that checks whether mouse events have happened while the SHIFT button was down
static Condition<java.awt.event.MouseEvent> trueCondition()
          Returns a new Condition that is always true
static Condition<java.awt.event.MouseEvent> wheelCondition()
          Returns a new condition that checks whether a MouseEvent is a MouseWheelEvent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

trueCondition

public static Condition<java.awt.event.MouseEvent> trueCondition()
Returns a new Condition that is always true

Returns:
The new condition

falseCondition

public static Condition<java.awt.event.MouseEvent> falseCondition()
Returns a new Condition that is always false

Returns:
The new condition

buttonCondition

public static Condition<java.awt.event.MouseEvent> buttonCondition(int button)
Returns a new condition that checks whether the the specified button was pressed when the mouse event occurred.

Parameters:
button - The button. Must be 1, 2 or 3
Returns:
The new condition
Throws:
java.lang.IllegalArgumentException - if the button is not 1, 2 or 3

flagCondition

public static Condition<java.awt.event.MouseEvent> flagCondition(int flags)
Returns a new condition that checks whether the the given flags are set in the extended modifiers of a mouse event.

Parameters:
flags - The flags
Returns:
The new condition

wheelCondition

public static Condition<java.awt.event.MouseEvent> wheelCondition()
Returns a new condition that checks whether a MouseEvent is a MouseWheelEvent

Returns:
The new condition

controlDownCondition

public static Condition<java.awt.event.MouseEvent> controlDownCondition()
Returns a new condition that checks whether mouse events have happened while the CTRL button was down

Returns:
The new condition

altDownCondition

public static Condition<java.awt.event.MouseEvent> altDownCondition()
Returns a new condition that checks whether mouse events have happened while the ALT button was down

Returns:
The new condition

altGraphDownCondition

public static Condition<java.awt.event.MouseEvent> altGraphDownCondition()
Returns a new condition that checks whether mouse events have happened while the ALT-GR button was down

Returns:
The new condition

shiftDownCondition

public static Condition<java.awt.event.MouseEvent> shiftDownCondition()
Returns a new condition that checks whether mouse events have happened while the SHIFT button was down

Returns:
The new condition

metaDownCondition

public static Condition<java.awt.event.MouseEvent> metaDownCondition()
Returns a new condition that checks whether mouse events have happened while the META button was down

Returns:
The new condition

popupTriggerCondition

public static Condition<java.awt.event.MouseEvent> popupTriggerCondition()
Returns a new condition that checks whether mouse events are popup triggers.

Returns:
The new condition