|
||||||||||
| 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.jmrit.symbolicprog.tabbedframe.PaneProgPane
public class PaneProgPane
Provides the individual panes for the TabbedPaneProgrammer. Note that this is not only the panes carrying variables, but also the special purpose panes for the CV table, etc.
This class implements PropertyChangeListener so that it can be notified when a variable changes its busy status at the end of a programming read/write operation There are four read and write operation types, all of which have to be handled carefully:
The definition of "changed" is operationally in the
VariableValue.isChanged() member function.
VariableValue.isChanged(),
Serialized Form| 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 |
|---|
| 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 | |
|---|---|
PaneProgPane()
Create a null object. |
|
PaneProgPane(PaneContainer parent,
String name,
Element pane,
CvTableModel cvModel,
IndexedCvTableModel icvModel,
VariableTableModel varModel,
Element modelElem)
Construct the Pane from the XML definition element. |
|
| Method Summary | |
|---|---|
boolean |
confirmPaneAll()
Invoked by "Compare Full Sheet" button, this sets in motion a continuing sequence of "confirm" operations on the variables & CVs in the Pane. |
boolean |
confirmPaneChanges()
Invoked by "Compare changes on sheet" button, this sets in motion a continuing sequence of "confirm" operations on the variables & CVs in the Pane. |
int |
countOpsNeeded(boolean read,
boolean changes)
Estimate the number of CVs that will be accessed when reading or writing the contents of this pane. |
void |
dispose()
|
String |
getName()
|
JComponent |
getRepresentation(String name,
Element var)
Get a GUI representation of a particular variable for display. |
boolean |
includeInPrint()
|
void |
includeInPrint(boolean inc)
|
boolean |
isBusy()
|
Set<Integer> |
makeOpsNeededSet(boolean read,
boolean changes,
Set<Integer> set)
Produce a set of CVs that will be accessed when reading or writing the contents of this pane. |
JPanel |
newColumn(Element element,
boolean showStdName,
Element modelElem)
Create a single column from the JDOM column Element |
JPanel |
newRow(Element element,
boolean showStdName,
Element modelElem)
Create a single row from the JDOM column Element |
void |
newVariable(Element var,
JComponent col,
GridBagLayout g,
GridBagConstraints cs,
boolean showStdName)
Add the representation of a single variable. |
void |
prepConfirmPane(boolean onlyChanges)
Prepare this pane for a compare operation. |
void |
prepReadPane(boolean onlyChanges)
Prepare this pane for a read operation. |
void |
prepWritePane(boolean onlyChanges)
Prepare a "write full sheet" operation. |
void |
printPane(HardcopyWriter w)
|
void |
propertyChange(PropertyChangeEvent e)
Get notification of a variable property change, specifically "busy" going to false at the end of a programming operation. |
boolean |
readPaneAll()
Invoked by "Read Full Sheet" button, this sets in motion a continuing sequence of "read" operations on the variables & CVs in the Pane. |
boolean |
readPaneChanges()
Invoked by "Read changes on sheet" button, this sets in motion a continuing sequence of "read" operations on the variables & CVs in the Pane. |
void |
replyWhileProgrammingCV()
|
void |
replyWhileProgrammingIndxCV()
|
void |
replyWhileProgrammingVar()
|
protected void |
setBusy(boolean busy)
|
String |
toString()
|
boolean |
writePaneAll()
Invoked by "Write full sheet" button to write all CVs. |
boolean |
writePaneChanges()
Invoked by "Write changes on sheet" button, this sets in motion a continuing sequence of "write" operations on the variables in the Pane. |
| 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 |
| Constructor Detail |
|---|
public PaneProgPane()
public PaneProgPane(PaneContainer parent,
String name,
Element pane,
CvTableModel cvModel,
IndexedCvTableModel icvModel,
VariableTableModel varModel,
Element modelElem)
name - Name to appear on tab of panepane - The JDOM Element for the pane definitioncvModel - Already existing TableModel containing the CV definitionsicvModel - Already existing TableModel containing the Indexed CV definitionsvarModel - Already existing TableModel containing the variable definitionsmodelElem - "model" element from the Decoder Index, used to check what decoder options are present.| Method Detail |
|---|
public String getName()
getName in class Componentpublic String toString()
toString in class Component
public int countOpsNeeded(boolean read,
boolean changes)
read - true if counting for read, false for writechanges - true if counting for a *Changes operation;
false, if counting for a *All operation
public Set<Integer> makeOpsNeededSet(boolean read,
boolean changes,
Set<Integer> set)
read - true if counting for read, false for writechanges - true if counting for a *Changes operation;
false, if counting for a *All operationset - The set to fill. Any CVs already in here will
not be duplicated, which provides a way to aggregate
a set of CVs across multiple panes.
public boolean readPaneChanges()
public void prepReadPane(boolean onlyChanges)
The read mechanism only reads variables in certain states (and needs to do that to handle error processing right now), so this is implemented by first setting all variables and CVs on this pane to TOREAD via this method
public boolean readPaneAll()
public boolean writePaneChanges()
Returns true if a write has been started, false if the pane is complete.
public boolean writePaneAll()
Returns true if a write has been started, false if the pane is complete.
public void prepWritePane(boolean onlyChanges)
public void prepConfirmPane(boolean onlyChanges)
The read mechanism only reads variables in certain states (and needs to do that to handle error processing right now), so this is implemented by first setting all variables and CVs on this pane to TOREAD via this method
public boolean confirmPaneChanges()
public boolean confirmPaneAll()
public boolean isBusy()
protected void setBusy(boolean busy)
public void propertyChange(PropertyChangeEvent e)
propertyChange in interface PropertyChangeListenerpublic void replyWhileProgrammingVar()
public void replyWhileProgrammingCV()
public void replyWhileProgrammingIndxCV()
public JPanel newColumn(Element element,
boolean showStdName,
Element modelElem)
public JPanel newRow(Element element,
boolean showStdName,
Element modelElem)
public void newVariable(Element var,
JComponent col,
GridBagLayout g,
GridBagConstraints cs,
boolean showStdName)
public JComponent getRepresentation(String name,
Element var)
name - Name used to look up the Variable objectvar - XML Element which might contain a "format" attribute to be used in the VariableValue.getNewRep(java.lang.String) call
from the Variable object; "tooltip" elements are also processed here.
public void dispose()
public boolean includeInPrint()
public void includeInPrint(boolean inc)
public void printPane(HardcopyWriter w)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||