RxJava



rx.observables
Enum SwingObservable

java.lang.Object
  extended by java.lang.Enum<SwingObservable>
      extended by rx.observables.SwingObservable
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<SwingObservable>

public enum SwingObservable
extends java.lang.Enum<SwingObservable>

Allows creating observables from various sources specific to Swing.


Method Summary
static rx.Observable<java.awt.event.ActionEvent> fromButtonAction(javax.swing.AbstractButton button)
          Creates an observable corresponding to a Swing button action.
static rx.Observable<java.awt.event.ComponentEvent> fromComponentEvents(java.awt.Component component)
          Creates an observable corresponding to raw component events.
static rx.Observable<java.awt.event.KeyEvent> fromKeyEvents(java.awt.Component component)
          Creates an observable corresponding to raw key events.
static rx.Observable<java.awt.event.KeyEvent> fromKeyEvents(java.awt.Component component, java.util.Set<java.lang.Integer> keyCodes)
          Creates an observable corresponding to raw key events, restricted a set of given key codes.
static rx.Observable<java.awt.event.MouseEvent> fromMouseEvents(java.awt.Component component)
          Creates an observable corresponding to raw mouse events (excluding mouse motion events).
static rx.Observable<java.awt.event.MouseEvent> fromMouseMotionEvents(java.awt.Component component)
          Creates an observable corresponding to raw mouse motion events.
static rx.Observable<java.util.Set<java.lang.Integer>> fromPressedKeys(java.awt.Component component)
          Creates an observable that emits the set of all currently pressed keys each time this set changes.
static rx.Observable<java.awt.Dimension> fromResizing(java.awt.Component component)
          Creates an observable corresponding to component resize events.
static SwingObservable valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static SwingObservable[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

values

public static SwingObservable[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (SwingObservable c : SwingObservable.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static SwingObservable valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

fromButtonAction

public static rx.Observable<java.awt.event.ActionEvent> fromButtonAction(javax.swing.AbstractButton button)
Creates an observable corresponding to a Swing button action.

Parameters:
button - The button to register the observable for.
Returns:
Observable of action events.

fromKeyEvents

public static rx.Observable<java.awt.event.KeyEvent> fromKeyEvents(java.awt.Component component)
Creates an observable corresponding to raw key events.

Parameters:
component - The component to register the observable for.
Returns:
Observable of key events.

fromKeyEvents

public static rx.Observable<java.awt.event.KeyEvent> fromKeyEvents(java.awt.Component component,
                                                                   java.util.Set<java.lang.Integer> keyCodes)
Creates an observable corresponding to raw key events, restricted a set of given key codes.

Parameters:
component - The component to register the observable for.
Returns:
Observable of key events.

fromPressedKeys

public static rx.Observable<java.util.Set<java.lang.Integer>> fromPressedKeys(java.awt.Component component)
Creates an observable that emits the set of all currently pressed keys each time this set changes.

Parameters:
component - The component to register the observable for.
Returns:
Observable of currently pressed keys.

fromMouseEvents

public static rx.Observable<java.awt.event.MouseEvent> fromMouseEvents(java.awt.Component component)
Creates an observable corresponding to raw mouse events (excluding mouse motion events).

Parameters:
component - The component to register the observable for.
Returns:
Observable of mouse events.

fromMouseMotionEvents

public static rx.Observable<java.awt.event.MouseEvent> fromMouseMotionEvents(java.awt.Component component)
Creates an observable corresponding to raw mouse motion events.

Parameters:
component - The component to register the observable for.
Returns:
Observable of mouse motion events.

fromComponentEvents

public static rx.Observable<java.awt.event.ComponentEvent> fromComponentEvents(java.awt.Component component)
Creates an observable corresponding to raw component events.

Parameters:
component - The component to register the observable for.
Returns:
Observable of component events.

fromResizing

public static rx.Observable<java.awt.Dimension> fromResizing(java.awt.Component component)
Creates an observable corresponding to component resize events.

Parameters:
component - The component to register the observable for.
Returns:
Observable emitting the current size of the given component after each resize event.