Package org.ka2ddo.yaac.gui
Class BlinkenLight
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JLabel
org.ka2ddo.yaac.gui.BlinkenLight
- All Implemented Interfaces:
ActionListener
,MouseListener
,ImageObserver
,MenuContainer
,Serializable
,EventListener
,Accessible
,SwingConstants
,PortEventListener
,PortExtendedStatusListener
,PortMgmtListener
,PortStatusListener
public class BlinkenLight
extends JLabel
implements PortEventListener, PortExtendedStatusListener, PortMgmtListener, MouseListener, ActionListener
This class implements a color-changing indicator driven by a PortConnector to
indicate the state of the driver.
- Author:
- Andrew Pavlin, KA2DDO
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.JLabel
JLabel.AccessibleJLabel
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
-
Field Summary
Fields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Fields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Fields inherited from interface javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
-
Constructor Summary
ConstructorDescriptionBlinkenLight
(PortConnector port) Create a control button for an existing PortConnector object to display the realtime status of the port and allow invoking the configuration panel for that port. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Invoked when an action occurs.getPort()
Get the port associated with this BlinkenLight.void
Invoked when the mouse button has been clicked (pressed and released) on a component.void
Invoked when the mouse enters a component.void
Invoked when the mouse exits a component.void
Invoked when a mouse button has been pressed on a component.void
Invoked when a mouse button has been released on a component.void
portClosed
(PortConnector connector) The specified port has been closed.void
portCreated
(PortConnector connector) The specified port has been added to the configuration..void
portDeleted
(PortConnector connector) The specified port has been removed from the configuration..void
portFailed
(PortConnector port) Reports when the port fails for some reason.void
portOpened
(PortConnector connector) The specified port has been successfully opened.void
portReceiving
(PortConnector port, boolean isReceiving) Reports when the specified port starts or stops receiving a message.void
portStatusChanged
(PortConnector connector) The status of the specified port has changed other than opening or closing, or beginning or ending transmit or receive.void
portTransmitting
(PortConnector port, boolean isTransmitting) Reports when the specified port starts or stops transmitting a message.Methods inherited from class javax.swing.JLabel
checkHorizontalKey, checkVerticalKey, getAccessibleContext, getDisabledIcon, getDisplayedMnemonic, getDisplayedMnemonicIndex, getHorizontalAlignment, getHorizontalTextPosition, getIcon, getIconTextGap, getLabelFor, getText, getUI, getUIClassID, getVerticalAlignment, getVerticalTextPosition, imageUpdate, paramString, setDisabledIcon, setDisplayedMnemonic, setDisplayedMnemonic, setDisplayedMnemonicIndex, setHorizontalAlignment, setHorizontalTextPosition, setIcon, setIconTextGap, setLabelFor, setText, setUI, setVerticalAlignment, setVerticalTextPosition, updateUI
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setMixingCutoutShape, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
-
Constructor Details
-
BlinkenLight
Create a control button for an existing PortConnector object to display the realtime status of the port and allow invoking the configuration panel for that port.- Parameters:
port
- PortConnector to monitor
-
-
Method Details
-
portReceiving
Reports when the specified port starts or stops receiving a message.- Specified by:
portReceiving
in interfacePortEventListener
- Parameters:
port
- PortConnector of relevant portisReceiving
- boolean true if receiving is starting, false if receiving is ending
-
portTransmitting
Reports when the specified port starts or stops transmitting a message.- Specified by:
portTransmitting
in interfacePortEventListener
- Parameters:
port
- PortConnector of relevant portisTransmitting
- boolean true if transmitting is starting, false if transmitting is ending
-
portFailed
Reports when the port fails for some reason.- Specified by:
portFailed
in interfacePortEventListener
- Parameters:
port
- PortConnector of relevant port
-
portClosed
The specified port has been closed.- Specified by:
portClosed
in interfacePortStatusListener
- Parameters:
connector
- PortConnector that was closed
-
portOpened
The specified port has been successfully opened.- Specified by:
portOpened
in interfacePortStatusListener
- Parameters:
connector
- PortConnector that was opened
-
portStatusChanged
The status of the specified port has changed other than opening or closing, or beginning or ending transmit or receive.- Specified by:
portStatusChanged
in interfacePortExtendedStatusListener
- Parameters:
connector
- PortConnector whose status has changed
-
portCreated
The specified port has been added to the configuration..- Specified by:
portCreated
in interfacePortMgmtListener
- Parameters:
connector
- PortConnector that was added
-
portDeleted
The specified port has been removed from the configuration..- Specified by:
portDeleted
in interfacePortMgmtListener
- Parameters:
connector
- PortConnector that was removed
-
getPort
Get the port associated with this BlinkenLight.- Returns:
- PortConnector
-
mouseClicked
Invoked when the mouse button has been clicked (pressed and released) on a component.- Specified by:
mouseClicked
in interfaceMouseListener
-
mousePressed
Invoked when a mouse button has been pressed on a component.- Specified by:
mousePressed
in interfaceMouseListener
-
mouseReleased
Invoked when a mouse button has been released on a component.- Specified by:
mouseReleased
in interfaceMouseListener
-
mouseEntered
Invoked when the mouse enters a component.- Specified by:
mouseEntered
in interfaceMouseListener
-
mouseExited
Invoked when the mouse exits a component.- Specified by:
mouseExited
in interfaceMouseListener
-
actionPerformed
Invoked when an action occurs.- Specified by:
actionPerformed
in interfaceActionListener
-