Class LnDplxGrpInfoImpl
- All Implemented Interfaces:
ImageObserver,MenuContainer,Serializable,EventListener,LocoNetListener
Implements the following "Property Change" events, which are defined as
static strings in LnDplxGrpInfoImplConstants:
- DPLX_PC_STAT_LN_UPDATE - Indicates that a GUI status line could be updated using provided string.
- DPLX_PC_STAT_LN_UPDATE_IF_NOT_CURRENTLY_ERROR - Indicates that a GUI status line could be updated using the provided string UNLESS the status line is currently showing an error.
- NumberOfUr92sUpdate - Indicates that the class has counted the number of UR92 devices
- DPLX_PC_NAME_UPDATE - Indicates that a LocoNet message has reported the Duplex Group Name
- DPLX_PC_CHANNEL_UPDATE - Indicates that a LocoNet message has reported the Duplex Group Channel
- DPLX_PC_PASSWORD_UPDATE - Indicates that a LocoNet message has reported the Duplex Group Password
- DPLX_PC_ID_UPDATE - Indicates that a LocoNet message has reported the Duplex Group Id
- DPLX_PC_NAME_VALIDITY - Indicates that the validity of GUI field showing the Duplex Group Name should be changed. NewValue() is true if a valid Duplex Group Name is available; is false if the Duplex Group Name should be considered invalid.
- DPLX_PC_CHANNEL_VALIDITY - Indicates that the validity of GUI field showing the Duplex Group Channel should be changed. NewValue() is true if a valid Duplex Group Channel is available; is false if the Duplex Group Channel should be considered invalid.
- DPLX_PC_PASSWORD_VALIDITY - Indicates that the validity of GUI field showing the Duplex Group Password should be changed. NewValue() is true if a valid Duplex Group Password is available; is false if the Duplex Group Password should be considered invalid.
- DPLX_PC_ID_VALIDITY - Indicates that the validity of GUI field showing the Duplex Group Id should be changed. NewValue() is true if a valid Duplex Group Id is available; is false if the Duplex Group Id should be considered invalid.
- DPLX_PC_RCD_DPLX_IDENTITY_QUERY - Indicates that a LocoNet message which queries the Duplex Group identity has been received.
- DPLX_PC_RCD_DPLX_IDENTITY_REPORT - Indicates that a LocoNet message which reports the Duplex Group identity has been received.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classprotected static classNested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponentNested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainerNested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final String(package private) static boolean(package private) LnDplxGrpInfoImplFields inherited from class javax.swing.JComponent
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWFields inherited from class java.awt.Component
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidConnect this instance's LocoNetListener to the LocoNet Traffic ControllervoidBegins a sequence which includes counting available UR92s and similar and, if at least one UR92/UR93/LNWI is present, reads the Duplex Group Identity Info.static final LocoNetMessagecreateSetUr92GroupChannelPacket(Integer iChannelNumber) Create a LocoNet packet to set the Duplex group channel number.static final LocoNetMessageCreate a LocoNet packet to set the Duplex group ID number.static final LocoNetMessagecreateSetUr92GroupNamePacket(String sGroupName) Create a LocoNet packet to set the Duplex group name.static final LocoNetMessagecreateSetUr92GroupPasswordPacket(String sGroupPassword) Create a LocoNet packet to set the Duplex group password.static final LocoNetMessagecreateUr92GroupChannelReportPacket(int dupChan) static final LocoNetMessageCreate a LocoNet packet which queries UR92(s) for Duplex group identification information.static final LocoNetMessagecreateUr92GroupIdReportPacket(int dupId) static final LocoNetMessagecreateUr92GroupNameReportPacket(String dupName, String dupPass, int dupChan, int dupId) static final LocoNetMessagevoiddispose()Break connection with the LnTrafficController and stop timers.static intChecks that m is a message with a Duplex Group Channel encoded inside, then extracts and returns the Duplex Group Channel.static intChecks that m is a message with a Duplex Group ID encoded inside, then extracts and returns the Duplex Group ID.static StringChecks that m is a message with a Duplex Group Name encoded inside, then extracts the Duplex Group Name.static StringChecks that m is a message with a Duplex Group Password encoded inside, then extracts and returns the Duplex Group Password.static final DuplexGroupMessageTypeClassifies a LocoNet Message to see if it is a Duplex Group Identity messageintReports the number of LocoNet messages handled since object construction.intReports the number of UR92 devices which responded to the most-recent LocoNet IPL query of UR92 devices.booleanReports whether this object is currently waiting for Duplex Group Name, etc.static final booleanChecks message m to determine if it contains a Duplex Group Identity message, including queries, reports, and writes, for Name, Channel, Password, and ID.booleanReports whether the Duplex Group Info query timer is running.booleanReports whether the IPL query timer is running.static final booleanReport whether Duplex Group Password must only be numeric, or if Password is allowed to include characters 'A', 'B', and/or 'C'.booleanReports whether this class is currently waiting for the first UR92 LocoNet IPL Device Report messages in response to a LocoNet IPL Device Query for UR92s sent by this class.voidProcess all incoming LocoNet messages to look for Duplex Group information operations.voidSends a LocoNet Message to query the Duplex Group Identity.voidCreates and sends a LocoNet message which sets the Duplex Group Channel.voidsetDuplexGroupId(String dgi) Creates and sends a LocoNet message which sets the Duplex Group Id.voidsetDuplexGroupName(String dgn) Creates and sends a LocoNet message which sets the Duplex Group Name.voidCreates and sends a LocoNet message which sets the Duplex Group Password.static final booleanvalidateGroupChannel(Integer iGroupChannel) Validate a Duplex Group Channel Number.static final booleanvalidateGroupID(Integer iGroupId) Validate the parameter as a Duplex Group ID number.static final booleanvalidateGroupName(String sGroupName) Validate a Duplex Group Name.static final booleanvalidateGroupPassword(String sGroupPassword) Validate a Duplex Group Password.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, getUI, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, 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, updateUIMethods 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, validateTreeMethods 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, getAccessibleContext, 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, imageUpdate, 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
-
Field Details
-
limitPasswordToNumericCharacters
-
thisone
-
DPLX_PC_STAT_LN_UPDATE
- See Also:
-
DPLX_PC_STAT_LN_UPDATE_IF_NOT_CURRENTLY_ERROR
- See Also:
-
DPLX_PC_NAME_VALIDITY
- See Also:
-
DPLX_PC_CHANNEL_VALIDITY
- See Also:
-
DPLX_PC_PASSWORD_VALIDITY
- See Also:
-
DPLX_PC_ID_VALIDITY
- See Also:
-
DPLX_PC_NAME_UPDATE
- See Also:
-
DPLX_PC_CHANNEL_UPDATE
- See Also:
-
DPLX_PC_PASSWORD_UPDATE
- See Also:
-
DPLX_PC_ID_UPDATE
- See Also:
-
DPLX_PC_RCD_DPLX_IDENTITY_QUERY
- See Also:
-
DPLX_PC_RCD_DPLX_IDENTITY_REPORT
- See Also:
-
DPLX_IPL_DEVICE_DETAILS
- See Also:
-
DPLX_IPL_DEVICE_RESPONSE_DETAILS
- See Also:
-
-
Constructor Details
-
LnDplxGrpInfoImpl
-
-
Method Details
-
isPasswordLimitedToNumbers
Report whether Duplex Group Password must only be numeric, or if Password is allowed to include characters 'A', 'B', and/or 'C'.- Returns:
- true if Password may only include digits.
-
validateGroupName
Validate a Duplex Group Name.A valid Duplex Group Name is an 8 character string. The calling method should append spaces or truncate to give correct length if necessary.
- Parameters:
sGroupName- string containing group name to be validated- Returns:
- true if and only if groupName is a valid Duplex Group Name
-
validateGroupPassword
Validate a Duplex Group Password.Note that the password must be four digits if only numeric values are allowed, or must be four characters, each of pattern [0-9A-C] if alphanumeric values are allowed. (See private field limitPasswordToNumericCharacters.)
- Parameters:
sGroupPassword- Duplex Group Password to be validated- Returns:
- true if and only if sGroupPassword is a valid Duplex Group Password.
-
validateGroupChannel
Validate a Duplex Group Channel Number.- Parameters:
iGroupChannel- Duplex Group Channel number to be validated- Returns:
- true if and only if iGroupChannel is a valid Duplex Group Channel.
-
validateGroupID
Validate the parameter as a Duplex Group ID number.- Parameters:
iGroupId- Duplex Group ID number to be validated- Returns:
- true if and only if iGroupId is a valid Duplex Group ID.
-
createUr92GroupIdentityQueryPacket
Create a LocoNet packet which queries UR92(s) for Duplex group identification information. The invoking method is responsible for sending the message to LocoNet.- Returns:
- LocoNetMessage containing IPL query of UR92s
-
createSetUr92GroupNamePacket
public static final LocoNetMessage createSetUr92GroupNamePacket(String sGroupName) throws LocoNetException Create a LocoNet packet to set the Duplex group name.Throws an exception if s provides a 0-length group name string. If s is too short, it is padded with spaces at the end of the string.
- Parameters:
sGroupName- is the desired group name value as a string- Returns:
- The LocoNet packet which writes the Group Name to the UR92 device(s)
- Throws:
LocoNetException- if sGroupName is not a valid Duplex Group Name
-
createSetUr92GroupChannelPacket
public static final LocoNetMessage createSetUr92GroupChannelPacket(Integer iChannelNumber) throws LocoNetException Create a LocoNet packet to set the Duplex group channel number.If s provides a 0-length group name, a bogus LocoNet message is returned. If s does not define an integer is too short, it is padded with spaces at the end of the string.
- Parameters:
iChannelNumber- The desired group channel number value as an integer- Returns:
- The packet which writes the Group Channel Number to the UR92 device(s)
- Throws:
LocoNetException- if sGroupName is not a valid Duplex Group Name
-
createSetUr92GroupPasswordPacket
public static final LocoNetMessage createSetUr92GroupPasswordPacket(String sGroupPassword) throws LocoNetException Create a LocoNet packet to set the Duplex group password.If s provides anything other than a 4 character length group password which uses only valid group ID characters (0-9, A-C), a bogus LocoNet message is returned.
- Parameters:
sGroupPassword- The desired group password as a string- Returns:
- The packet which writes the Group Password to the UR92 device(s)
- Throws:
LocoNetException- in case of invalid sGrooupPassword
-
createSetUr92GroupIDPacket
Create a LocoNet packet to set the Duplex group ID number.If s provides anything other than a numeric value between 0 and 127, a LocoNetException is thrown.
- Parameters:
s- The desired group ID number as a string- Returns:
- The packet which writes the Group ID Number to the UR92 device(s)
- Throws:
LocoNetException- when an invalid id is provided
-
isDuplexGroupMessage
Checks message m to determine if it contains a Duplex Group Identity message, including queries, reports, and writes, for Name, Channel, Password, and ID.- Parameters:
m- LocoNet message to check- Returns:
- true if message is query, report, or write of Duplex Group Name, Channel, Password or ID
-
getDuplexGroupIdentityMessageType
Classifies a LocoNet Message to see if it is a Duplex Group Identity message- Parameters:
m- a LocoNetMessage- Returns:
- DuplexGroupMessageType, encoded as one of the following NOT_A_DUPLEX_GROUP_MESSAGE DUPLEX_GROUP_CHANNEL_QUERY_MESSAGE DUPLEX_GROUP_CHANNEL_REPORT_MESSAGE DUPLEX_GROUP_CHANNEL_WRITE_MESSAGE DUPLEX_GROUP_NAME_QUERY_MESSAGE DUPLEX_GROUP_NAME_ETC_REPORT_MESSAGE DUPLEX_GROUP_NAME_WRITE_MESSAGE DUPLEX_GROUP_PASSWORD_QUERY_MESSAGE DUPLEX_GROUP_PASSWORD_REPORT_MESSAGE DUPLEX_GROUP_PASSWORD_WRITE_MESSAGE DUPLEX_GROUP_ID_QUERY_MESSAGE DUPLEX_GROUP_ID_REPORT_MESSAGE DUPLEX_GROUP_ID_WRITE_MESSAGE
-
extractDuplexGroupName
Checks that m is a message with a Duplex Group Name encoded inside, then extracts the Duplex Group Name. Note that the returned string is always 8 characters long.If m does not contain a Duplex Group Name, returns null.
- Parameters:
m- LocoNet message from which a Duplex Group Name is to be extracted.- Returns:
- String containing Duplex Group Name as extracted from m
-
extractDuplexGroupChannel
Checks that m is a message with a Duplex Group Channel encoded inside, then extracts and returns the Duplex Group Channel.Returns -1 if the m does not contain a Duplex Group Channel.
- Parameters:
m- LocoNet message from which a Duplex Group Channel number will be extracted- Returns:
- Integer containing Duplex Group Name as extracted from m
-
extractDuplexGroupID
Checks that m is a message with a Duplex Group ID encoded inside, then extracts and returns the Duplex Group ID.Returns -1 if the m does not contain a Duplex Group ID.
- Parameters:
m- LocoNet message from which a Duplex Group ID will be extracted- Returns:
- Integer containing Duplex Group Name as extracted from m
-
extractDuplexGroupPassword
Checks that m is a message with a Duplex Group Password encoded inside, then extracts and returns the Duplex Group Password.Returns null if the m does not contain a Duplex Group Password.
- Parameters:
m- LocoNet message to be checked for a duplex group password message- Returns:
- String containing the Duplex Group Password as extracted from m
-
message
Process all incoming LocoNet messages to look for Duplex Group information operations. Only pays attention to LocoNet report of Duplex Group Name/password/channel/groupID, and ignores all other LocoNet messages.If tool has sent a query for Duplex group information and has not yet received a Duplex group report, the method updates the GUI with the received information.
If the tool is not currently waiting for a response to a query, then the method compares the received information against the information currently displayed in the GUI. If the received information does not match, a message is displayed on the status line in the GUI, else nothing is displayed in the GUI status line.
- Specified by:
messagein interfaceLocoNetListener- Parameters:
m- The received LocoNet message. Note that this same object may be presented to multiple users. It should not be modified here.
-
getFetchedDuplexGroupName
- Returns:
- String containing reported Duplex Group Name
-
getFetchedDuplexGroupChannel
- Returns:
- String containing reported Duplex Group Name
-
getFetchedDuplexGroupPassword
- Returns:
- String containing reported Duplex Group Name
-
getFetchedDuplexGroupId
- Returns:
- String containing reported Duplex Group Name
-
queryDuplexGroupIdentity
Sends a LocoNet Message to query the Duplex Group Identity. Starts a timer to monitor completion. -
setDuplexGroupName
Creates and sends a LocoNet message which sets the Duplex Group Name.- Parameters:
dgn- String containing the new Duplex Group Name- Throws:
LocoNetException- if dgn is not a valid Duplex Group Name.
-
setDuplexGroupChannel
Creates and sends a LocoNet message which sets the Duplex Group Channel.- Parameters:
dgc- Integer containing the new Duplex Group Channel- Throws:
LocoNetException- if dgc is not a valid Duplex Group Channel number.
-
setDuplexGroupPassword
Creates and sends a LocoNet message which sets the Duplex Group Password.- Parameters:
dgp- String containing the new Duplex Group Password- Throws:
LocoNetException- if dgp is not a valid Duplex Group Password.
-
setDuplexGroupId
Creates and sends a LocoNet message which sets the Duplex Group Id.- Parameters:
dgi- String containing the new Duplex Group Id- Throws:
LocoNetException- if dgi is not a valid Duplex Group Id.
-
countUr92sAndQueryDuplexIdentityInfo
Begins a sequence which includes counting available UR92s and similar and, if at least one UR92/UR93/LNWI is present, reads the Duplex Group Identity Info. -
createUr92GroupNameReportPacket
public static final LocoNetMessage createUr92GroupNameReportPacket(String dupName, String dupPass, int dupChan, int dupId) -
createUr92GroupChannelReportPacket
-
createUr92GroupPasswordReportPacket
-
createUr92GroupIdReportPacket
-
getNumUr92s
Reports the number of UR92 devices which responded to the most-recent LocoNet IPL query of UR92 devices.Note that code should ignore the value returned by this method if isWaitingForUr92DeviceReports() is true;
- Returns:
- the number of UR92 devices which reported in response to the LocoNet IPL device query which is sent by this class.
-
isWaitingForFirstUr92IPLReport
Reports whether this class is currently waiting for the first UR92 LocoNet IPL Device Report messages in response to a LocoNet IPL Device Query for UR92s sent by this class.- Returns:
- true if the class is waiting for LocoNet IPL reply messages, else false.
-
getMessagesHandled
Reports the number of LocoNet messages handled since object construction.- Returns:
- the number of LocoNet messages since this object was constructed.
-
isIplQueryTimerRunning
Reports whether the IPL query timer is running.- Returns:
- true if the timer is running, else false.
-
isDuplexGroupQueryRunning
Reports whether the Duplex Group Info query timer is running.- Returns:
- true if the timer is running, else false.
-
isAwaitingDuplexGroupReportMessage
Reports whether this object is currently waiting for Duplex Group Name, etc. Report message.- Returns:
- true if currently waiting, else false
-
connect
Connect this instance's LocoNetListener to the LocoNet Traffic Controller- Parameters:
t- LocoNet traffic controller
-
dispose
Break connection with the LnTrafficController and stop timers.
-