|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
jmri.util.swing.JmriPanel
jmri.jmrix.loconet.swing.LnPanel
jmri.jmrix.loconet.AbstractBoardProgPanel
public abstract class AbstractBoardProgPanel
Display and modify an Digitrax board configuration.
The read and write require a sequence of operations, which we handle with a state variable.
Programming of the board is done via configuration messages, so the board should not be put into programming mode via the built-in pushbutton while this tool is in use.
Throughout, the terminology is "closed" == true, "thrown" == false. Variables are named for their closed state.
Some of the message formats used in this class are Copyright Digitrax, Inc. and used with permission as part of the JMRI project. That permission does not extend to uses in other software products. If you wish to use this code, algorithm or these message formats outside of JMRI, please contact Digitrax Inc for separate permission.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JPanel |
|---|
JPanel.AccessibleJPanel |
| 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 | |
|---|---|
boolean |
onlyOneOperation
|
protected boolean[] |
opsw
True is "closed", false is "thrown". |
boolean |
read
|
JToggleButton |
readAllButton
|
JToggleButton |
writeAllButton
|
| Fields inherited from class jmri.jmrix.loconet.swing.LnPanel |
|---|
memo |
| Fields inherited from class javax.swing.JComponent |
|---|
accessibleContext, 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 |
|---|
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 |
| Constructor Summary | |
|---|---|
protected |
AbstractBoardProgPanel()
Constructor which assumes the board ID number is 1 |
protected |
AbstractBoardProgPanel(int boardNum)
Constructor which allows the caller to pass in the board ID number |
| Method Summary | |
|---|---|
protected void |
appendLine(JComponent c)
Handle layout details during construction. |
protected abstract void |
copyToOpsw()
Copy from the GUI to the opsw array. |
void |
dispose()
|
void |
initComponents()
2nd stage of initialization, invoked after the constuctor is complete. |
void |
initComponents(LocoNetSystemConnectionMemo memo)
2nd stage of initialization, invoked after the constuctor is complete. |
void |
message(LocoNetMessage m)
Processes incoming LocoNet messages for OpSw read and write operations, and automatically advances to the next OpSw operation as directed by nextState() |
protected abstract int |
nextState(int state)
Specify which opsw (and which sequence) need to be read/written |
protected JPanel |
provideAddressing(String type)
Provide read, write buttons and address |
protected JComponent |
provideStatusLine()
provide the status line for the GUI |
void |
readAll()
|
protected void |
setStatus(String msg)
|
protected void |
setTypeWord(int type)
Configure the type word in the LocoNet messages. |
protected abstract void |
updateDisplay()
|
void |
writeOne(int startIndex)
|
| Methods inherited from class jmri.jmrix.loconet.swing.LnPanel |
|---|
getTitle, initContext |
| Methods inherited from class jmri.util.swing.JmriPanel |
|---|
getHelpTarget, getMenus, getTitle, getWindowInterface, isMultipleInstances, setWindowInterface |
| Methods inherited from class javax.swing.JPanel |
|---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public JToggleButton readAllButton
public JToggleButton writeAllButton
public boolean read
public boolean onlyOneOperation
protected boolean[] opsw
| Constructor Detail |
|---|
protected AbstractBoardProgPanel()
protected AbstractBoardProgPanel(int boardNum)
boardNum - | Method Detail |
|---|
public void initComponents(LocoNetSystemConnectionMemo memo)
LnPanelInterfaceThis needs to be connected to the initContext() method in implementing classes.
initComponents in interface LnPanelInterfaceinitComponents in class LnPanelprotected JPanel provideAddressing(String type)
protected JComponent provideStatusLine()
protected void setStatus(String msg)
protected void appendLine(JComponent c)
c - component to put on a single linepublic void readAll()
protected void setTypeWord(int type)
Known values:
protected abstract void copyToOpsw()
Used before write operations start
protected abstract void updateDisplay()
protected abstract int nextState(int state)
public void writeOne(int startIndex)
public void message(LocoNetMessage m)
message in interface LocoNetListenerm - public void initComponents()
JmriPanel
initComponents in class JmriPanelpublic void dispose()
dispose in class JmriPanel
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||