public final class SwingObservable
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
MOUSE_ALL
|
static int |
MOUSE_CLICK
Flag constant for
mouse(Component, int) indicating only the
MouseListener events should be forwarded. |
static int |
MOUSE_MOVE
Flag constant for
mouse(Component, int) indicating only the
MouseMotionListener events should be forwarded. |
static int |
MOUSE_WHEEL
Flag constant for
mouse(Component, int) indicating only the
MouseWheelListener events should be forwarded. |
static int |
WINDOW_ACTIVE
Flag constant for the
window(Window, int) indicating only
the WindowListener events should be forwarded. |
static int |
WINDOW_ALL
|
static int |
WINDOW_FOCUS
Flag constant for the
window(Window, int) indicating only
the WindowFocusListener events should be forwarded. |
static int |
WINDOW_STATE
Flag constant for the
window(Window, int) indicating only
the WindowStateListener events should be forwarded. |
| Modifier and Type | Method and Description |
|---|---|
static io.reactivex.Observable<java.awt.event.ActionEvent> |
actions(javax.swing.AbstractButton button) |
static io.reactivex.Observable<java.awt.event.ActionEvent> |
actions(javax.swing.JComboBox<?> button) |
static io.reactivex.Observable<javax.swing.event.AncestorEvent> |
ancestor(javax.swing.JComponent component) |
static io.reactivex.Observable<javax.swing.event.CaretEvent> |
caret(javax.swing.text.JTextComponent component) |
static io.reactivex.Observable<javax.swing.event.ChangeEvent> |
change(javax.swing.AbstractButton component) |
static io.reactivex.Observable<javax.swing.event.ChangeEvent> |
change(javax.swing.BoundedRangeModel component) |
static io.reactivex.Observable<javax.swing.event.ChangeEvent> |
change(javax.swing.ButtonModel component) |
static io.reactivex.Observable<javax.swing.event.ChangeEvent> |
change(javax.swing.colorchooser.ColorSelectionModel component) |
static io.reactivex.Observable<javax.swing.event.ChangeEvent> |
change(javax.swing.JProgressBar component) |
static io.reactivex.Observable<javax.swing.event.ChangeEvent> |
change(javax.swing.JSlider component) |
static io.reactivex.Observable<javax.swing.event.ChangeEvent> |
change(javax.swing.JSpinner component) |
static io.reactivex.Observable<javax.swing.event.ChangeEvent> |
change(javax.swing.JTabbedPane component) |
static io.reactivex.Observable<javax.swing.event.ChangeEvent> |
change(javax.swing.JViewport component) |
static io.reactivex.Observable<javax.swing.event.ChangeEvent> |
change(javax.swing.SpinnerModel component) |
static io.reactivex.Observable<java.awt.event.ComponentEvent> |
component(java.awt.Component component) |
static io.reactivex.Observable<java.awt.event.ContainerEvent> |
container(java.awt.Container component) |
static io.reactivex.Observable<javax.swing.event.DocumentEvent> |
document(javax.swing.text.Document component) |
static io.reactivex.Observable<javax.swing.event.DocumentEvent> |
document(javax.swing.text.JTextComponent component) |
static io.reactivex.Observable<java.awt.event.FocusEvent> |
focus(java.awt.Component component) |
static io.reactivex.Observable<java.awt.event.HierarchyEvent> |
hierarchy(java.awt.Component component) |
static io.reactivex.Observable<java.awt.event.HierarchyEvent> |
hierarchyBounds(java.awt.Component component) |
static io.reactivex.Observable<javax.swing.event.HyperlinkEvent> |
hyperlink(javax.swing.JEditorPane component) |
static io.reactivex.Observable<java.awt.event.InputMethodEvent> |
inputMethod(java.awt.Component component) |
static io.reactivex.Observable<javax.swing.event.InternalFrameEvent> |
internalFrame(javax.swing.JInternalFrame component) |
static io.reactivex.Observable<java.awt.event.ItemEvent> |
itemSelection(java.awt.ItemSelectable component) |
static io.reactivex.Observable<java.awt.event.KeyEvent> |
keyboard(java.awt.Component component) |
static io.reactivex.Observable<javax.swing.event.ListDataEvent> |
listChange(javax.swing.JList<?> component) |
static io.reactivex.Observable<javax.swing.event.ListDataEvent> |
listChange(javax.swing.ListModel<?> component) |
static io.reactivex.Observable<javax.swing.event.ListSelectionEvent> |
listSelection(javax.swing.JList<?> component) |
static io.reactivex.Observable<javax.swing.event.ListSelectionEvent> |
listSelection(javax.swing.ListSelectionModel component) |
static io.reactivex.Observable<javax.swing.event.MenuEvent> |
menu(javax.swing.JMenu component) |
static io.reactivex.Observable<javax.swing.event.MenuDragMouseEvent> |
menuDrag(javax.swing.JMenuItem component) |
static io.reactivex.Observable<javax.swing.event.MenuKeyEvent> |
menuKey(javax.swing.JMenuItem component) |
static io.reactivex.Observable<javax.swing.event.MenuKeyEvent> |
menuKey(javax.swing.JPopupMenu component) |
static io.reactivex.Observable<java.awt.event.MouseEvent> |
mouse(java.awt.Component component) |
static io.reactivex.Observable<java.awt.event.MouseEvent> |
mouse(java.awt.Component component,
int flags) |
static io.reactivex.Observable<java.awt.event.MouseWheelEvent> |
mouseWheel(java.awt.Component component) |
static <T> io.reactivex.ObservableTransformer<T,T> |
observeOnEdt()
Sends the observed upstream event directly to the Event Dispatch thread individually
(unlike observeOn which may occupy the EDT longer with a fast emitting source).
|
static io.reactivex.Observable<javax.swing.event.PopupMenuEvent> |
popupMenu(javax.swing.JComboBox<?> component) |
static io.reactivex.Observable<javax.swing.event.PopupMenuEvent> |
popupMenu(javax.swing.JPopupMenu component) |
static io.reactivex.Observable<java.beans.PropertyChangeEvent> |
propertyChange(java.awt.Component component) |
static io.reactivex.Observable<java.beans.PropertyChangeEvent> |
propertyChange(java.awt.Component component,
java.lang.String propertyName) |
static io.reactivex.Observable<javax.swing.event.RowSorterEvent> |
rowSorter(javax.swing.JTable component) |
static io.reactivex.Observable<javax.swing.event.RowSorterEvent> |
rowSorter(javax.swing.RowSorter<?> component) |
static io.reactivex.Observable<javax.swing.event.ChangeEvent> |
tableColumnMarginChange(javax.swing.table.TableColumnModel component) |
static io.reactivex.Observable<javax.swing.event.TableColumnModelEvent> |
tableColumnModel(javax.swing.JTable component) |
static io.reactivex.Observable<javax.swing.event.TableColumnModelEvent> |
tableColumnModel(javax.swing.table.TableColumnModel component) |
static io.reactivex.Observable<javax.swing.event.ListSelectionEvent> |
tableColumnSelectionChange(javax.swing.table.TableColumnModel component) |
static io.reactivex.Observable<javax.swing.event.TableModelEvent> |
tableModel(javax.swing.JTable component) |
static io.reactivex.Observable<javax.swing.event.TableModelEvent> |
tableModel(javax.swing.table.TableModel component) |
static io.reactivex.Observable<javax.swing.event.TreeExpansionEvent> |
treeExpansion(javax.swing.JTree component) |
static io.reactivex.Observable<javax.swing.event.TreeModelEvent> |
treeModel(javax.swing.JTree component) |
static io.reactivex.Observable<javax.swing.event.TreeModelEvent> |
treeModel(javax.swing.tree.TreeModel component) |
static io.reactivex.Observable<javax.swing.event.TreeSelectionEvent> |
treeSelection(javax.swing.JTree component) |
static io.reactivex.Observable<javax.swing.event.TreeSelectionEvent> |
treeSelection(javax.swing.tree.TreeSelectionModel component) |
static io.reactivex.Observable<javax.swing.event.TreeExpansionEvent> |
treeWillExpand(javax.swing.JTree component) |
static io.reactivex.Observable<javax.swing.event.UndoableEditEvent> |
undoableEdit(javax.swing.text.Document component) |
static io.reactivex.Observable<javax.swing.event.UndoableEditEvent> |
undoableEdit(javax.swing.text.JTextComponent component) |
static io.reactivex.Observable<VetoablePropertyChangeEvent> |
vetoableChange(javax.swing.JComponent component) |
static io.reactivex.Observable<java.awt.event.WindowEvent> |
window(java.awt.Window component) |
static io.reactivex.Observable<java.awt.event.WindowEvent> |
window(java.awt.Window component,
int flags) |
public static final int MOUSE_CLICK
mouse(Component, int) indicating only the
MouseListener events should be forwarded.public static final int MOUSE_MOVE
mouse(Component, int) indicating only the
MouseMotionListener events should be forwarded.public static final int MOUSE_WHEEL
mouse(Component, int) indicating only the
MouseWheelListener events should be forwarded.
Note that the MouseWheelEvent extends MouseEvent
and the consumer should check and cast back the stream of
MouseEvent.
public static final int MOUSE_ALL
public static final int WINDOW_ACTIVE
window(Window, int) indicating only
the WindowListener events should be forwarded.public static final int WINDOW_FOCUS
window(Window, int) indicating only
the WindowFocusListener events should be forwarded.public static final int WINDOW_STATE
window(Window, int) indicating only
the WindowStateListener events should be forwarded.public static final int WINDOW_ALL
@CheckReturnValue
@NonNull
@SchedulerSupport(value="none")
public static io.reactivex.Observable<java.awt.event.ActionEvent> actions(@NonNull
javax.swing.AbstractButton button)
@CheckReturnValue
@NonNull
@SchedulerSupport(value="none")
public static io.reactivex.Observable<java.awt.event.ActionEvent> actions(@NonNull
javax.swing.JComboBox<?> button)
@CheckReturnValue
@NonNull
@SchedulerSupport(value="none")
public static io.reactivex.Observable<java.awt.event.MouseEvent> mouse(@NonNull
java.awt.Component component)
@CheckReturnValue
@NonNull
@SchedulerSupport(value="none")
public static io.reactivex.Observable<java.awt.event.MouseEvent> mouse(@NonNull
java.awt.Component component,
int flags)
@CheckReturnValue
@NonNull
@SchedulerSupport(value="none")
public static io.reactivex.Observable<java.awt.event.MouseWheelEvent> mouseWheel(@NonNull
java.awt.Component component)
@CheckReturnValue
@NonNull
@SchedulerSupport(value="none")
public static io.reactivex.Observable<java.awt.event.KeyEvent> keyboard(@NonNull
java.awt.Component component)
@CheckReturnValue
@NonNull
@SchedulerSupport(value="none")
public static io.reactivex.Observable<java.awt.event.ComponentEvent> component(@NonNull
java.awt.Component component)
@CheckReturnValue
@NonNull
@SchedulerSupport(value="none")
public static io.reactivex.Observable<java.awt.event.FocusEvent> focus(@NonNull
java.awt.Component component)
@CheckReturnValue
@NonNull
@SchedulerSupport(value="none")
public static io.reactivex.Observable<java.awt.event.HierarchyEvent> hierarchyBounds(@NonNull
java.awt.Component component)
@CheckReturnValue
@NonNull
@SchedulerSupport(value="none")
public static io.reactivex.Observable<java.awt.event.HierarchyEvent> hierarchy(@NonNull
java.awt.Component component)
@CheckReturnValue
@NonNull
@SchedulerSupport(value="none")
public static io.reactivex.Observable<java.awt.event.InputMethodEvent> inputMethod(@NonNull
java.awt.Component component)
@CheckReturnValue
@NonNull
@SchedulerSupport(value="none")
public static io.reactivex.Observable<java.beans.PropertyChangeEvent> propertyChange(@NonNull
java.awt.Component component)
@CheckReturnValue
@NonNull
@SchedulerSupport(value="none")
public static io.reactivex.Observable<java.beans.PropertyChangeEvent> propertyChange(@NonNull
java.awt.Component component,
java.lang.String propertyName)
@CheckReturnValue
@NonNull
@SchedulerSupport(value="none")
public static io.reactivex.Observable<javax.swing.event.DocumentEvent> document(@NonNull
javax.swing.text.Document component)
@CheckReturnValue
@NonNull
@SchedulerSupport(value="none")
public static io.reactivex.Observable<javax.swing.event.DocumentEvent> document(@NonNull
javax.swing.text.JTextComponent component)
@CheckReturnValue
@NonNull
@SchedulerSupport(value="none")
public static io.reactivex.Observable<javax.swing.event.UndoableEditEvent> undoableEdit(@NonNull
javax.swing.text.Document component)
@CheckReturnValue
@NonNull
@SchedulerSupport(value="none")
public static io.reactivex.Observable<javax.swing.event.UndoableEditEvent> undoableEdit(@NonNull
javax.swing.text.JTextComponent component)
@CheckReturnValue
@NonNull
@SchedulerSupport(value="none")
public static io.reactivex.Observable<javax.swing.event.CaretEvent> caret(@NonNull
javax.swing.text.JTextComponent component)
@CheckReturnValue
@NonNull
@SchedulerSupport(value="none")
public static io.reactivex.Observable<javax.swing.event.AncestorEvent> ancestor(@NonNull
javax.swing.JComponent component)
@CheckReturnValue @NonNull @SchedulerSupport(value="none") public static io.reactivex.Observable<VetoablePropertyChangeEvent> vetoableChange(@NonNull javax.swing.JComponent component)
@CheckReturnValue
@NonNull
@SchedulerSupport(value="none")
public static io.reactivex.Observable<java.awt.event.ContainerEvent> container(@NonNull
java.awt.Container component)
@CheckReturnValue
@NonNull
@SchedulerSupport(value="none")
public static io.reactivex.Observable<javax.swing.event.ListSelectionEvent> listSelection(@NonNull
javax.swing.JList<?> component)
@CheckReturnValue
@NonNull
@SchedulerSupport(value="none")
public static io.reactivex.Observable<javax.swing.event.ListSelectionEvent> listSelection(@NonNull
javax.swing.ListSelectionModel component)
@CheckReturnValue
@NonNull
@SchedulerSupport(value="none")
public static io.reactivex.Observable<javax.swing.event.HyperlinkEvent> hyperlink(@NonNull
javax.swing.JEditorPane component)
@CheckReturnValue
@NonNull
@SchedulerSupport(value="none")
public static io.reactivex.Observable<javax.swing.event.InternalFrameEvent> internalFrame(@NonNull
javax.swing.JInternalFrame component)
@CheckReturnValue
@NonNull
@SchedulerSupport(value="none")
public static io.reactivex.Observable<javax.swing.event.ListDataEvent> listChange(@NonNull
javax.swing.ListModel<?> component)
@CheckReturnValue
@NonNull
@SchedulerSupport(value="none")
public static io.reactivex.Observable<javax.swing.event.ListDataEvent> listChange(@NonNull
javax.swing.JList<?> component)
@CheckReturnValue
@NonNull
@SchedulerSupport(value="none")
public static io.reactivex.Observable<javax.swing.event.MenuDragMouseEvent> menuDrag(@NonNull
javax.swing.JMenuItem component)
@CheckReturnValue
@NonNull
@SchedulerSupport(value="none")
public static io.reactivex.Observable<javax.swing.event.MenuEvent> menu(@NonNull
javax.swing.JMenu component)
@CheckReturnValue
@NonNull
@SchedulerSupport(value="none")
public static io.reactivex.Observable<javax.swing.event.MenuKeyEvent> menuKey(@NonNull
javax.swing.JMenuItem component)
@CheckReturnValue
@NonNull
@SchedulerSupport(value="none")
public static io.reactivex.Observable<javax.swing.event.MenuKeyEvent> menuKey(@NonNull
javax.swing.JPopupMenu component)
@CheckReturnValue
@NonNull
@SchedulerSupport(value="none")
public static io.reactivex.Observable<javax.swing.event.PopupMenuEvent> popupMenu(@NonNull
javax.swing.JComboBox<?> component)
@CheckReturnValue
@NonNull
@SchedulerSupport(value="none")
public static io.reactivex.Observable<javax.swing.event.PopupMenuEvent> popupMenu(@NonNull
javax.swing.JPopupMenu component)
@CheckReturnValue
@NonNull
@SchedulerSupport(value="none")
public static io.reactivex.Observable<javax.swing.event.RowSorterEvent> rowSorter(@NonNull
javax.swing.RowSorter<?> component)
@CheckReturnValue
@NonNull
@SchedulerSupport(value="none")
public static io.reactivex.Observable<javax.swing.event.RowSorterEvent> rowSorter(@NonNull
javax.swing.JTable component)
@CheckReturnValue
@NonNull
@SchedulerSupport(value="none")
public static io.reactivex.Observable<javax.swing.event.TableModelEvent> tableModel(@NonNull
javax.swing.table.TableModel component)
@CheckReturnValue
@NonNull
@SchedulerSupport(value="none")
public static io.reactivex.Observable<javax.swing.event.TableModelEvent> tableModel(@NonNull
javax.swing.JTable component)
@CheckReturnValue
@NonNull
@SchedulerSupport(value="none")
public static io.reactivex.Observable<javax.swing.event.TableColumnModelEvent> tableColumnModel(@NonNull
javax.swing.table.TableColumnModel component)
@CheckReturnValue
@NonNull
@SchedulerSupport(value="none")
public static io.reactivex.Observable<javax.swing.event.ChangeEvent> tableColumnMarginChange(@NonNull
javax.swing.table.TableColumnModel component)
@CheckReturnValue
@NonNull
@SchedulerSupport(value="none")
public static io.reactivex.Observable<javax.swing.event.ListSelectionEvent> tableColumnSelectionChange(@NonNull
javax.swing.table.TableColumnModel component)
@CheckReturnValue
@NonNull
@SchedulerSupport(value="none")
public static io.reactivex.Observable<javax.swing.event.TableColumnModelEvent> tableColumnModel(@NonNull
javax.swing.JTable component)
@CheckReturnValue
@NonNull
@SchedulerSupport(value="none")
public static io.reactivex.Observable<javax.swing.event.TreeExpansionEvent> treeExpansion(@NonNull
javax.swing.JTree component)
@CheckReturnValue
@NonNull
@SchedulerSupport(value="none")
public static io.reactivex.Observable<javax.swing.event.TreeModelEvent> treeModel(@NonNull
javax.swing.tree.TreeModel component)
@CheckReturnValue
@NonNull
@SchedulerSupport(value="none")
public static io.reactivex.Observable<javax.swing.event.TreeModelEvent> treeModel(@NonNull
javax.swing.JTree component)
@CheckReturnValue
@NonNull
@SchedulerSupport(value="none")
public static io.reactivex.Observable<javax.swing.event.TreeSelectionEvent> treeSelection(@NonNull
javax.swing.tree.TreeSelectionModel component)
@CheckReturnValue
@NonNull
@SchedulerSupport(value="none")
public static io.reactivex.Observable<javax.swing.event.TreeSelectionEvent> treeSelection(@NonNull
javax.swing.JTree component)
@CheckReturnValue
@NonNull
@SchedulerSupport(value="none")
public static io.reactivex.Observable<javax.swing.event.TreeExpansionEvent> treeWillExpand(@NonNull
javax.swing.JTree component)
@CheckReturnValue @NonNull public static <T> io.reactivex.ObservableTransformer<T,T> observeOnEdt()
To be used with Observable.compose(ObservableTransformer).
This custom observeOn should allow more interleaving with other EDT-submitted tasks and not occupy the EDT for too long.
Example:
Observable.range(1, 5)
.compose(SwingObservable.observeOnEdt())
.subscribe(System.out::println);
EventQueue.invokeLater().T - the value type@CheckReturnValue
@NonNull
@SchedulerSupport(value="none")
public static io.reactivex.Observable<java.awt.event.ItemEvent> itemSelection(@NonNull
java.awt.ItemSelectable component)
@CheckReturnValue
@NonNull
@SchedulerSupport(value="none")
public static io.reactivex.Observable<javax.swing.event.ChangeEvent> change(@NonNull
javax.swing.JTabbedPane component)
@CheckReturnValue
@NonNull
@SchedulerSupport(value="none")
public static io.reactivex.Observable<javax.swing.event.ChangeEvent> change(@NonNull
javax.swing.JSlider component)
@CheckReturnValue
@NonNull
@SchedulerSupport(value="none")
public static io.reactivex.Observable<javax.swing.event.ChangeEvent> change(@NonNull
javax.swing.JSpinner component)
@CheckReturnValue
@NonNull
@SchedulerSupport(value="none")
public static io.reactivex.Observable<javax.swing.event.ChangeEvent> change(@NonNull
javax.swing.SpinnerModel component)
@CheckReturnValue
@NonNull
@SchedulerSupport(value="none")
public static io.reactivex.Observable<javax.swing.event.ChangeEvent> change(@NonNull
javax.swing.AbstractButton component)
@CheckReturnValue
@NonNull
@SchedulerSupport(value="none")
public static io.reactivex.Observable<javax.swing.event.ChangeEvent> change(@NonNull
javax.swing.ButtonModel component)
@CheckReturnValue
@NonNull
@SchedulerSupport(value="none")
public static io.reactivex.Observable<javax.swing.event.ChangeEvent> change(@NonNull
javax.swing.JViewport component)
@CheckReturnValue
@NonNull
@SchedulerSupport(value="none")
public static io.reactivex.Observable<javax.swing.event.ChangeEvent> change(@NonNull
javax.swing.colorchooser.ColorSelectionModel component)
@CheckReturnValue
@NonNull
@SchedulerSupport(value="none")
public static io.reactivex.Observable<javax.swing.event.ChangeEvent> change(@NonNull
javax.swing.JProgressBar component)
@CheckReturnValue
@NonNull
@SchedulerSupport(value="none")
public static io.reactivex.Observable<javax.swing.event.ChangeEvent> change(@NonNull
javax.swing.BoundedRangeModel component)
@CheckReturnValue
@NonNull
@SchedulerSupport(value="none")
public static io.reactivex.Observable<java.awt.event.WindowEvent> window(@NonNull
java.awt.Window component)
@CheckReturnValue
@NonNull
@SchedulerSupport(value="none")
public static io.reactivex.Observable<java.awt.event.WindowEvent> window(@NonNull
java.awt.Window component,
int flags)