Package de.team33.sphinx.luna
Interface Channel<C,M>
- Type Parameters:
C- The component type in whose context the event takes place.M- The message type being transferred in the context of the event.
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Identifies predefined notification channels and associates specific
Swing component types, events, and message types with each other.
Each instance is also capable of adding appropriate listeners to a component that can process the corresponding message when a particular event occurs.
Example:
public class ChannelSample {
private final JButton button;
public ChannelSample() {
button = new JButton();
Channel.ACTION_PERFORMED.subscribe(button, this::onActionPerformed);
}
private void onActionPerformed(final ActionEvent message) {
// do something based on [message] and/or [button] ...
}
}
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Channel<AbstractButton,ActionEvent> Represents a channel that handles events that can occur onAbstractButtons.static final Channel<JScrollBar,AdjustmentEvent> Represents a channel that handles events that can occur onJScrollBars.static final Channel<JComponent,AncestorEvent> Represents a channel that handles events that can occur onJComponents.static final Channel<Component,HierarchyEvent> Represents a channel that handles events that can occur onComponents.static final Channel<Component,HierarchyEvent> Represents a channel that handles events that can occur onComponents.static final Channel<JComponent,AncestorEvent> Represents a channel that handles events that can occur onJComponents.static final Channel<JComponent,AncestorEvent> Represents a channel that handles events that can occur onJComponents.static final Channel<Component,InputMethodEvent> Represents a channel that handles events that can occur onComponents.static final Channel<JTextComponent,CaretEvent> Represents a channel that handles events that can occur onJTextComponents.static final Channel<Container,ContainerEvent> Represents a channel that handles events that can occur onContainers.static final Channel<Component,ComponentEvent> Represents a channel that handles events that can occur onComponents.static final Channel<Component,ComponentEvent> Represents a channel that handles events that can occur onComponents.static final Channel<Container,ContainerEvent> Represents a channel that handles events that can occur onContainers.static final Channel<Component,ComponentEvent> Represents a channel that handles events that can occur onComponents.static final Channel<Component,ComponentEvent> Represents a channel that handles events that can occur onComponents.static final Channel<Component,DropTargetDragEvent> Represents a channel that handles events that can occur on aComponent'sDropTarget.static final Channel<Component,DropTargetDragEvent> Represents a channel that handles events that can occur on aComponent'sDropTarget.static final Channel<Component,DropTargetEvent> Represents a channel that handles events that can occur on aComponent'sDropTarget.static final Channel<Component,DropTargetDragEvent> Represents a channel that handles events that can occur on aComponent'sDropTarget.static final Channel<Component,DropTargetDropEvent> Represents a channel that handles events that can occur on aComponent'sDropTarget.static final Channel<Component,FocusEvent> Represents a channel that handles events that can occur onComponents.static final Channel<Component,FocusEvent> Represents a channel that handles events that can occur onComponents.static final Channel<Component,HierarchyEvent> Represents a channel that handles events that can occur onComponents.static final Channel<JEditorPane,HyperlinkEvent> Represents a channel that handles events that can occur onJEditorPanes.static final Channel<Component,InputMethodEvent> Represents a channel that handles events that can occur onComponents.static final Channel<JInternalFrame,InternalFrameEvent> Represents a channel that handles events that can occur onJInternalFrames.static final Channel<JInternalFrame,InternalFrameEvent> Represents a channel that handles events that can occur onJInternalFrames.static final Channel<JInternalFrame,InternalFrameEvent> Represents a channel that handles events that can occur onJInternalFrames.static final Channel<JInternalFrame,InternalFrameEvent> Represents a channel that handles events that can occur onJInternalFrames.static final Channel<JInternalFrame,InternalFrameEvent> Represents a channel that handles events that can occur onJInternalFrames.static final Channel<JInternalFrame,InternalFrameEvent> Represents a channel that handles events that can occur onJInternalFrames.static final Channel<JInternalFrame,InternalFrameEvent> Represents a channel that handles events that can occur onJInternalFrames.static final Channel<AbstractButton,ItemEvent> Represents a channel that handles events that can occur onAbstractButtons.static final Channel<JComboBox<?>,ActionEvent> Represents a channel that handles events that can occur onJComboBoxs.Represents a channel that handles events that can occur onJComboBoxs.static final Channel<JComboBox<?>,PopupMenuEvent> Represents a channel that handles events that can occur onJComboBoxs.static final Channel<JComboBox<?>,PopupMenuEvent> Represents a channel that handles events that can occur onJComboBoxs.static final Channel<JComboBox<?>,PopupMenuEvent> Represents a channel that handles events that can occur onJComboBoxs.static final Channel<JFileChooser,ActionEvent> Represents a channel that handles events that can occur onJFileChoosers.static final Channel<JProgressBar,ChangeEvent> Represents a channel that handles events that can occur onJProgressBars.static final Channel<JSlider,ChangeEvent> Represents a channel that handles events that can occur onJSliders.static final Channel<JSpinner,ChangeEvent> Represents a channel that handles events that can occur onJSpinners.static final Channel<JTextField,ActionEvent> Represents a channel that handles events that can occur onJTextFields.static final Channel<JTabbedPane,ChangeEvent> Represents a channel that handles events that can occur onJTabbedPanes.static final Channel<JViewport,ChangeEvent> Represents a channel that handles events that can occur onJViewports.Represents a channel that handles events that can occur onComponents.Represents a channel that handles events that can occur onComponents.Represents a channel that handles events that can occur onComponents.static final Channel<JList<?>,ListSelectionEvent> Represents a channel that handles events that can occur onJLists.Represents a channel that handles events that can occur onJMenus.Represents a channel that handles events that can occur onJMenus.static final Channel<JMenuItem,MenuDragMouseEvent> Represents a channel that handles events that can occur onJMenuItems.static final Channel<JMenuItem,MenuDragMouseEvent> Represents a channel that handles events that can occur onJMenuItems.static final Channel<JMenuItem,MenuDragMouseEvent> Represents a channel that handles events that can occur onJMenuItems.static final Channel<JMenuItem,MenuDragMouseEvent> Represents a channel that handles events that can occur onJMenuItems.static final Channel<JMenuItem,MenuKeyEvent> Represents a channel that handles events that can occur onJMenuItems.static final Channel<JMenuItem,MenuKeyEvent> Represents a channel that handles events that can occur onJMenuItems.static final Channel<JMenuItem,MenuKeyEvent> Represents a channel that handles events that can occur onJMenuItems.static final Channel<JPopupMenu,MenuKeyEvent> Represents a channel that handles events that can occur onJPopupMenus.static final Channel<JPopupMenu,MenuKeyEvent> Represents a channel that handles events that can occur onJPopupMenus.static final Channel<JPopupMenu,MenuKeyEvent> Represents a channel that handles events that can occur onJPopupMenus.Represents a channel that handles events that can occur onJMenus.static final Channel<Component,MouseEvent> Represents a channel that handles events that can occur onComponents.static final Channel<Component,MouseEvent> Represents a channel that handles events that can occur onComponents.static final Channel<Component,MouseEvent> Represents a channel that handles events that can occur onComponents.static final Channel<Component,MouseEvent> Represents a channel that handles events that can occur onComponents.static final Channel<Component,MouseEvent> Represents a channel that handles events that can occur onComponents.static final Channel<Component,MouseEvent> Represents a channel that handles events that can occur onComponents.static final Channel<Component,MouseEvent> Represents a channel that handles events that can occur onComponents.static final Channel<Component,MouseWheelEvent> Represents a channel that handles events that can occur onComponents.static final Channel<JPopupMenu,PopupMenuEvent> Represents a channel that handles events that can occur onJPopupMenus.static final Channel<JPopupMenu,PopupMenuEvent> Represents a channel that handles events that can occur onJPopupMenus.static final Channel<JPopupMenu,PopupMenuEvent> Represents a channel that handles events that can occur onJPopupMenus.static final Channel<Component,PropertyChangeEvent> Represents a channel that handles events that can occur onComponents.static final Channel<AbstractButton,ChangeEvent> Represents a channel that handles events that can occur onAbstractButtons.static final Channel<JTree,TreeExpansionEvent> Represents a channel that handles events that can occur onJTrees.static final Channel<JTree,TreeExpansionEvent> Represents a channel that handles events that can occur onJTrees.static final Channel<JTree,TreeSelectionEvent> Represents a channel that handles events that can occur onJTrees.static final Channel<JTree,TreeExpansionEvent> Represents a channel that handles events that can occur onJTrees.static final Channel<JTree,TreeExpansionEvent> Represents a channel that handles events that can occur onJTrees.static final Channel<JComponent,PropertyChangeEvent> Represents a channel that handles events that can occur onJComponents.static final Channel<Window,WindowEvent> Represents a channel that handles events that can occur onWindows.static final Channel<Window,WindowEvent> Represents a channel that handles events that can occur onWindows.static final Channel<Window,WindowEvent> Represents a channel that handles events that can occur onWindows.static final Channel<Window,WindowEvent> Represents a channel that handles events that can occur onWindows.static final Channel<Window,WindowEvent> Represents a channel that handles events that can occur onWindows.static final Channel<Window,WindowEvent> Represents a channel that handles events that can occur onWindows.static final Channel<Window,WindowEvent> Represents a channel that handles events that can occur onWindows.static final Channel<Window,WindowEvent> Represents a channel that handles events that can occur onWindows.static final Channel<Window,WindowEvent> Represents a channel that handles events that can occur onWindows.static final Channel<Window,WindowEvent> Represents a channel that handles events that can occur onWindows. -
Method Summary
Modifier and TypeMethodDescriptiondefault LinkDeprecated.static Channel<Component,PropertyChangeEvent> propertyChange(String propertyName) Retrieves a channel that handles events that can occur onComponentsSubscribes to messages of type<M>sent by a given component of type<C>in case of a specific event and provides a suitableConsumeras a listener for message processing.
-
Field Details
-
PROPERTY_CHANGE
Represents a channel that handles events that can occur onComponents. -
COMPONENT_RESIZED
Represents a channel that handles events that can occur onComponents. -
COMPONENT_MOVED
Represents a channel that handles events that can occur onComponents. -
COMPONENT_SHOWN
Represents a channel that handles events that can occur onComponents. -
COMPONENT_HIDDEN
Represents a channel that handles events that can occur onComponents. -
FOCUS_GAINED
Represents a channel that handles events that can occur onComponents. -
FOCUS_LOST
Represents a channel that handles events that can occur onComponents. -
HIERARCHY_CHANGED
Represents a channel that handles events that can occur onComponents. -
ANCESTOR_BOUNDS_MOVED
Represents a channel that handles events that can occur onComponents. -
ANCESTOR_BOUNDS_RESIZED
Represents a channel that handles events that can occur onComponents. -
KEY_TYPED
Represents a channel that handles events that can occur onComponents. -
KEY_PRESSED
Represents a channel that handles events that can occur onComponents. -
KEY_RELEASED
Represents a channel that handles events that can occur onComponents. -
MOUSE_PRESSED
Represents a channel that handles events that can occur onComponents. -
MOUSE_RELEASED
Represents a channel that handles events that can occur onComponents. -
MOUSE_CLICKED
Represents a channel that handles events that can occur onComponents. -
MOUSE_EXITED
Represents a channel that handles events that can occur onComponents. -
MOUSE_ENTERED
Represents a channel that handles events that can occur onComponents. -
MOUSE_MOVED
Represents a channel that handles events that can occur onComponents. -
MOUSE_DRAGGED
Represents a channel that handles events that can occur onComponents. -
MOUSE_WHEEL_MOVED
Represents a channel that handles events that can occur onComponents. -
INPUT_METHOD_TEXT_CHANGED
Represents a channel that handles events that can occur onComponents. -
CARET_POSITION_CHANGED
Represents a channel that handles events that can occur onComponents. -
DROP_TARGET_DRAG_ENTER
Represents a channel that handles events that can occur on aComponent'sDropTarget. -
DROP_TARGET_DRAG_OVER
Represents a channel that handles events that can occur on aComponent'sDropTarget. -
DROP_TARGET_DRAG_ACTION_CHANGED
Represents a channel that handles events that can occur on aComponent'sDropTarget. -
DROP_TARGET_DRAG_EXIT
Represents a channel that handles events that can occur on aComponent'sDropTarget. -
DROP_TARGET_DROP
Represents a channel that handles events that can occur on aComponent'sDropTarget. -
COMPONENT_ADDED
Represents a channel that handles events that can occur onContainers. -
COMPONENT_REMOVED
Represents a channel that handles events that can occur onContainers. -
VETOABLE_CHANGE
Represents a channel that handles events that can occur onJComponents. -
ANCESTOR_ADDED
Represents a channel that handles events that can occur onJComponents. -
ANCESTOR_REMOVED
Represents a channel that handles events that can occur onJComponents. -
ANCESTOR_MOVED
Represents a channel that handles events that can occur onJComponents. -
CARET_UPDATE
Represents a channel that handles events that can occur onJTextComponents. -
JPB_STATE_CHANGED
Represents a channel that handles events that can occur onJProgressBars. -
JTP_STATE_CHANGED
Represents a channel that handles events that can occur onJTabbedPanes. -
JTF_ACTION_PERFORMED
Represents a channel that handles events that can occur onJTextFields. -
POPUP_MENU_WILL_BECOME_VISIBLE
Represents a channel that handles events that can occur onJPopupMenus. -
POPUP_MENU_WILL_BECOME_INVISIBLE
Represents a channel that handles events that can occur onJPopupMenus. -
POPUP_MENU_CANCELED
Represents a channel that handles events that can occur onJPopupMenus. -
MENU_KEY_PRESSED
Represents a channel that handles events that can occur onJPopupMenus. -
MENU_KEY_RELEASED
Represents a channel that handles events that can occur onJPopupMenus. -
MENU_KEY_TYPED
Represents a channel that handles events that can occur onJPopupMenus. -
WINDOW_STATE_CHANGED
Represents a channel that handles events that can occur onWindows. -
WINDOW_OPENED
Represents a channel that handles events that can occur onWindows. -
WINDOW_CLOSING
Represents a channel that handles events that can occur onWindows. -
WINDOW_CLOSED
Represents a channel that handles events that can occur onWindows. -
WINDOW_ICONIFIED
Represents a channel that handles events that can occur onWindows. -
WINDOW_DEICONIFIED
Represents a channel that handles events that can occur onWindows. -
WINDOW_ACTIVATED
Represents a channel that handles events that can occur onWindows. -
WINDOW_DEACTIVATED
Represents a channel that handles events that can occur onWindows. -
WINDOW_GAINED_FOCUS
Represents a channel that handles events that can occur onWindows. -
WINDOW_LOST_FOCUS
Represents a channel that handles events that can occur onWindows. -
ITEM_STATE_CHANGED
Represents a channel that handles events that can occur onAbstractButtons. -
ACTION_PERFORMED
Represents a channel that handles events that can occur onAbstractButtons. -
STATE_CHANGED
Represents a channel that handles events that can occur onAbstractButtons. -
MENU_DRAG_MOUSE_ENTERED
Represents a channel that handles events that can occur onJMenuItems. -
MENU_DRAG_MOUSE_EXITED
Represents a channel that handles events that can occur onJMenuItems. -
MENU_DRAG_MOUSE_DRAGGED
Represents a channel that handles events that can occur onJMenuItems. -
MENU_DRAG_MOUSE_RELEASED
Represents a channel that handles events that can occur onJMenuItems. -
MENU_ITEM_KEY_PRESSED
Represents a channel that handles events that can occur onJMenuItems. -
MENU_ITEM_KEY_RELEASED
Represents a channel that handles events that can occur onJMenuItems. -
MENU_ITEM_KEY_TYPED
Represents a channel that handles events that can occur onJMenuItems. -
JSL_STATE_CHANGED
Represents a channel that handles events that can occur onJSliders. -
JCB_ITEM_STATE_CHANGED
Represents a channel that handles events that can occur onJComboBoxs. -
JCB_ACTION_PERFORMED
Represents a channel that handles events that can occur onJComboBoxs. -
JCB_POPUP_WILL_BECOME_VISIBLE
Represents a channel that handles events that can occur onJComboBoxs. -
JCB_POPUP_WILL_BECOME_INVISIBLE
Represents a channel that handles events that can occur onJComboBoxs. -
JCB_POPUP_CANCELED
Represents a channel that handles events that can occur onJComboBoxs. -
TREE_EXPANDED
Represents a channel that handles events that can occur onJTrees. -
TREE_COLLAPSED
Represents a channel that handles events that can occur onJTrees. -
TREE_WILL_EXPAND
Represents a channel that handles events that can occur onJTrees. -
TREE_WILL_COLLAPSE
Represents a channel that handles events that can occur onJTrees. -
TREE_VALUE_CHANGED
Represents a channel that handles events that can occur onJTrees. -
JSP_STATE_CHANGED
Represents a channel that handles events that can occur onJSpinners. -
ADJUSTMENT_VALUE_CHANGED
Represents a channel that handles events that can occur onJScrollBars. -
LIST_VALUE_CHANGED
Represents a channel that handles events that can occur onJLists. -
INTERNAL_FRAME_OPENED
Represents a channel that handles events that can occur onJInternalFrames. -
INTERNAL_FRAME_CLOSING
Represents a channel that handles events that can occur onJInternalFrames. -
INTERNAL_FRAME_CLOSED
Represents a channel that handles events that can occur onJInternalFrames. -
INTERNAL_FRAME_ICONIFIED
Represents a channel that handles events that can occur onJInternalFrames. -
INTERNAL_FRAME_DEICONIFIED
Represents a channel that handles events that can occur onJInternalFrames. -
INTERNAL_FRAME_ACTIVATED
Represents a channel that handles events that can occur onJInternalFrames. -
INTERNAL_FRAME_DEACTIVATED
Represents a channel that handles events that can occur onJInternalFrames. -
HYPERLINK_UPDATE
Represents a channel that handles events that can occur onJEditorPanes. -
JVP_STATE_CHANGED
Represents a channel that handles events that can occur onJViewports. -
JFC_ACTION_PERFORMED
Represents a channel that handles events that can occur onJFileChoosers. -
MENU_SELECTED
Represents a channel that handles events that can occur onJMenus. -
MENU_DESELECTED
Represents a channel that handles events that can occur onJMenus. -
MENU_CANCELED
Represents a channel that handles events that can occur onJMenus.
-
-
Method Details
-
propertyChange
Retrieves a channel that handles events that can occur onComponents- Parameters:
propertyName- The name of the property in question.- See Also:
-
add
Deprecated.usesubscribe(Object, Consumer)instead! -
subscribe
Subscribes to messages of type<M>sent by a given component of type<C>in case of a specific event and provides a suitableConsumeras a listener for message processing.- Returns:
- A
Subscriptionthat can becanceledlater to stop processing associated messages.Can usually be ignored if processing should not be stopped within the component's lifecycle.
-
subscribe(Object, Consumer)instead!