Class PaneProgFrame
- All Implemented Interfaces:
ComponentListener,WindowListener,ImageObserver,MenuContainer,PropertyChangeListener,Serializable,EventListener,Accessible,RootPaneContainer,WindowConstants,BeanInterface,PaneContainer,ModifiedFlag,WindowInterface
- Direct Known Subclasses:
PaneOpsProgFrame,PaneServiceProgFrame
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class jmri.util.JmriJFrame
JmriJFrame.ScreenDimensionsNested classes/interfaces inherited from class javax.swing.JFrame
JFrame.AccessibleJFrameNested classes/interfaces inherited from class java.awt.Frame
Frame.AccessibleAWTFrameNested classes/interfaces inherited from class java.awt.Window
Window.AccessibleAWTWindow, Window.TypeNested 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.FlipBufferStrategyNested classes/interfaces inherited from interface jmri.util.swing.WindowInterface
WindowInterface.Hint -
Field Summary
FieldsModifier and TypeFieldDescription(package private) FunctionLabelPane(package private) String(package private) boolean(package private) PaneProgPane(package private) boolean(package private) RosterMediaPane(package private) RosterEntry(package private) RosterEntryPane(package private) List<JComponent>(package private) EnumVariableValue(package private) CvTableModel(package private) String(package private) ShutDownTask(package private) List<org.jdom2.Element>(package private) org.jdom2.Element(package private) String(package private) String[](package private) int[](package private) VariableValue(package private) ArrayList<ExtraMenuTableModel>(package private) ShutDownTask(package private) String(package private) BusyGlassPane(package private) boolean(package private) ItemListener(package private) ItemListener(package private) ItemListener(package private) ItemListener(package private) boolean(package private) boolean(package private) String(package private) String(package private) JMenuBar(package private) org.jdom2.ElementData element holding the 'model' element representing the decoder type.(package private) Programmer(package private) String(package private) int(package private) boolean(package private) int(package private) VariableValue(package private) org.jdom2.Element(package private) String(package private) JLabel(package private) JToggleButton(package private) JToggleButton(package private) JMenu(package private) ResetTableModel(package private) SearchBar(package private) ArrayList<PaneProgFrame.SearchPair>(package private) String(package private) String(package private) JTabbedPane(package private) JPanel(package private) VariableTableModel(package private) JToggleButton(package private) JToggleButtonFields inherited from class jmri.util.JmriJFrame
allowInFrameServlet, properties, reuseFrameSavedPosition, reuseFrameSavedSized, windowInterfaceFields inherited from class javax.swing.JFrame
accessibleContext, rootPane, rootPaneCheckingEnabledFields inherited from class java.awt.Frame
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSORFields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTFields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTHFields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE -
Constructor Summary
ConstructorsConstructorDescriptionPaneProgFrame(DecoderFile pDecoderFile, RosterEntry pRosterEntry, String pFrameEntryId, String pProgrammerFile, Programmer pProg, boolean opsMode) Initialization sequence: Ask the RosterEntry to read its contents If the decoder file is specified, open and load it, otherwise get the decoder filename from the RosterEntry and load that. -
Method Summary
Modifier and TypeMethodDescription(package private) voidaddHelp()protected booleanprotected boolean(package private) void(package private) voidvoiddispose()Local dispose, which also invokes parent.(package private) booleandoRead()(package private) booleandoWrite()voidenableButtons(boolean stat) Enable the read/write buttons.(package private) voidEnable the [Read all] and [Read changes] buttons if possible.static booleanstatic booleanstatic booleanstatic booleanProvide a maximum frame size that is limited to what can fit on the screen after toolbars, etc are deducted.protected abstract JPanelAbstract method to provide a JPanel setting the programming mode, if appropriate.The preferred size must fit on the physical screen, so calculate the lesser of either the preferred size from the layout or the screen size.static booleanstatic booleanGet value of Preference option to show empty panes.protected voidprotected voidbooleanisBusy()static booleanisIncludedFE(org.jdom2.Element e, org.jdom2.Element aModelElement, RosterEntry aRosterEntry, String extraIncludes, String extraExcludes) Front end to DecoderFile.isIncluded() Retrieves "productID" and "model attributes from the "model" element and "family" attribute from the roster entry.protected voidloadDecoderFile(DecoderFile df, RosterEntry re) protected voidprotected voidloadJPanel(Component c, JPanel tab) protected voidprotected voidprotected JPanelprotected JPanelprotected JPanelprotected ComponentMake temporary contents for a pane while loadingvoidnewPane(String name, org.jdom2.Element pane, org.jdom2.Element modelElem, boolean enableEmpty, boolean programmerPane) voidprotected voidpickProgrammerMode(org.jdom2.Element programming) voidprepGlassPane(AbstractButton activeButton) Create a BusyGlassPane transparent layer over the panel blocking any other interaction, excluding a supplied button.voidprintPanes(boolean preview) Prepare a roster entry to be printed, and display a selection list.protected voidprocessModifierElements(org.jdom2.Element e, PaneProgPane pane, VariableTableModel model, JTabbedPane tabPane, String name) If there are any modifier elements, process them.voidGet notification of a variable property change in the pane, specifically "busy" going to false at the end of a programming operation.booleanreadAll()Invoked by the "Read All" button, this sets in motion a continuing sequence of "read all" operations on the panes.booleanInvoked by "Read Changes" button, this sets in motion a continuing sequence of "read changes" operations on the panes.(package private) voidreadConfig(org.jdom2.Element root, RosterEntry r) protected voidReset all CV values to defaults stored earlier.protected voidSave all CV values.protected voidprotected voidsearchGoesTo(PaneProgFrame.SearchPair result) static voidsetCanCacheDefault(boolean yes) static voidsetDisableProgrammingOnMain(boolean yes) static voidsetDisableProgrammingTrack(boolean yes) static voidsetDoConfirmRead(boolean yes) (package private) voidsetProgrammingGui(JPanel bottom) (package private) voidsetSearchGui(JPanel bottom) static voidsetShowCvNumbers(boolean yes) Option to control appearance of CV numbers in tool tips.static voidsetShowEmptyPanes(boolean yes) Set value of Preference option to show empty panes.booleanStore the locomotives information in the roster (and a RosterEntry file).(package private) voidvoidClose box has been clicked; handle check for dirty with respect to decoder or file, then close.booleanwriteAll()Invoked by "Write All" button, this sets in motion a continuing sequence of "write all" operations on each pane.booleanInvoked by "Write Changes" button, this sets in motion a continuing sequence of "write changes" operations on each pane.Methods inherited from class jmri.util.JmriJFrame
addHelpMenu, componentHidden, componentMoved, componentResized, componentShown, generateWindowRef, getAllowInFrameServlet, getEscapeKeyAction, getEscapeKeyClosesWindow, getFrame, getFrame, getFrameList, getFrameList, getIndexedProperty, getModifiedFlag, getProperty, getPropertyNames, getSavePosition, getSaveSize, getScreenDimensions, getWindowFrameRef, getWindowInterface, handleModified, hasIndexedProperty, hasProperty, initComponents, makePrivateWindow, makePublicWindow, markWindowModified, multipleInstances, pack, setAllowInFrameServlet, setEscapeKeyAction, setEscapeKeyClosesWindow, setFrameLocation, setIndexedProperty, setModifiedFlag, setProperty, setSavePosition, setSaveSize, setShutDownTask, setWindowInterface, show, show, storeValues, undecorate, windowActivated, windowClosed, windowDeactivated, windowDeiconified, windowIconified, windowOpenedMethods inherited from class javax.swing.JFrame
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, updateMethods inherited from class java.awt.Frame
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecoratedMethods inherited from class java.awt.Window
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, paint, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, setVisible, show, toBack, toFrontMethods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMinimumSize, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, 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, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setMixingCutoutShape, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycleMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface java.awt.MenuContainer
getFont, postEvent
-
Field Details
-
progStatus
-
cvModel
-
variableModel
-
resetModel
-
resetMenu
-
extraMenuModelList
-
extraMenuList
-
mProgrammer
-
noDecoder
boolean noDecoder -
tempPane
-
_opsMode
boolean _opsMode -
maxFnNumDirty
boolean maxFnNumDirty -
maxFnNumOld
-
maxFnNumNew
-
_rosterEntry
-
_rPane
-
_flPane
-
_rMPane
-
_frameEntryId
-
paneList
-
paneListIndex
int paneListIndex -
decoderPaneList
List<org.jdom2.Element> decoderPaneList -
glassPane
-
activeComponents
-
filename
-
programmerShowEmptyPanes
-
decoderShowEmptyPanes
-
decoderAllowResetDefaults
-
suppressFunctionLabels
-
suppressRosterMedia
-
tabPane
-
readChangesButton
-
writeChangesButton
-
readAllButton
-
writeAllButton
-
l1
-
l2
-
l3
-
l4
-
decoderDirtyTask
-
fileDirtyTask
-
threadCount
-
searchBar
-
searchTargetList
-
nextSearchTarget
int nextSearchTarget -
modelElem
org.jdom2.Element modelElemData element holding the 'model' element representing the decoder type. -
decoderRoot
org.jdom2.Element decoderRoot -
programmerRoot
org.jdom2.Element programmerRoot -
defaultCvValues
int[] defaultCvValues -
defaultCvNumbers
-
-
extendAddr
-
addMode
-
longMode
boolean longMode -
newAddr
-
justChanges
boolean justChanges -
_read
boolean _read -
_programmingPane
-
-
Constructor Details
-
PaneProgFrame
public PaneProgFrame(DecoderFile pDecoderFile, @Nonnull RosterEntry pRosterEntry, String pFrameEntryId, String pProgrammerFile, Programmer pProg, boolean opsMode) Initialization sequence:- Ask the RosterEntry to read its contents
- If the decoder file is specified, open and load it, otherwise get the decoder filename from the RosterEntry and load that. Note that we're assuming the roster entry has the right decoder, at least w.r.t. the loco file.
- Fill CV values from the roster entry
- Create the programmer panes
- Parameters:
pDecoderFile- XML file defining the decoder contents; if null, the decoder definition is found from the RosterEntrypRosterEntry- RosterEntry for information on this locomotivepFrameEntryId- Roster ID (entry) loaded into the framepProgrammerFile- Name of the programmer file to usepProg- Programmer object to be used to access CVsopsMode- true for opsMode, else false.
-
-
Method Details
-
getRosterPane
-
getFnLabelPane
-
getModePane
Abstract method to provide a JPanel setting the programming mode, if appropriate.A null value is ignored (?)
- Returns:
- new mode panel for inclusion in the GUI
-
installComponents
-
configureButtons
-
setProgrammingGui
-
setSearchGui
-
loadSearchTargets
-
loadJPanel
-
searchDidNotFind
-
searchGoesTo
-
getPaneList
-
addHelp
void addHelp() -
getPreferredSize
Description copied from class:JmriJFrameThe preferred size must fit on the physical screen, so calculate the lesser of either the preferred size from the layout or the screen size.- Overrides:
getPreferredSizein classJmriJFrame- Returns:
- the preferred size or the maximum size, whichever is smaller
-
getMaximumSize
Description copied from class:JmriJFrameProvide a maximum frame size that is limited to what can fit on the screen after toolbars, etc are deducted.Some of the methods used here return null pointers on some Java implementations, however, so this will return the superclasses's maximum size if the algorithm used here fails.
- Overrides:
getMaximumSizein classJmriJFrame- Returns:
- the maximum window size
-
enableReadButtons
void enableReadButtons()Enable the [Read all] and [Read changes] buttons if possible. This checks to make sure this is appropriate, given the attached programmer's capability. -
ctorPhase2
-
isIncludedFE
public static boolean isIncludedFE(org.jdom2.Element e, org.jdom2.Element aModelElement, RosterEntry aRosterEntry, String extraIncludes, String extraExcludes) Front end to DecoderFile.isIncluded()- Retrieves "productID" and "model attributes from the "model" element and "family" attribute from the roster entry.
- Then invokes DecoderFile.isIncluded() with the retrieved values.
- Deals gracefully with null or missing elements and attributes.
- Parameters:
e- XML element with possible "include" and "exclude" attributes to be checkedaModelElement- "model" element from the Decoder Index, used to get "model" and "productID".aRosterEntry- The current roster entry, used to get "family".extraIncludes- additional "include" termsextraExcludes- additional "exclude" terms.- Returns:
- true if front ended included, else false.
-
pickProgrammerMode
-
loadDecoderFromLoco
-
loadDecoderFile
-
loadProgrammerFile
-
checkDirtyDecoder
- Returns:
- true if decoder needs to be written
-
checkDirtyFile
- Returns:
- true if file needs to be written
-
handleDirtyFile
-
windowClosing
Close box has been clicked; handle check for dirty with respect to decoder or file, then close.- Specified by:
windowClosingin interfaceWindowListener- Overrides:
windowClosingin classJmriJFrame- Parameters:
e- Not used
-
readConfig
-
makeStandinComponent
Make temporary contents for a pane while loading -
resetToDefaults
Reset all CV values to defaults stored earlier.This will in turn update the variables.
-
saveDefaults
Save all CV values.These stored values are used by {link #resetToDefaults()}
-
makeInfoPane
-
makeFunctionLabelPane
-
makeMediaPane
-
updateDccAddress
void updateDccAddress() -
newPane
-
processModifierElements
protected void processModifierElements(org.jdom2.Element e, PaneProgPane pane, VariableTableModel model, JTabbedPane tabPane, String name) If there are any modifier elements, process them.- Parameters:
e- Process the contents of this elementpane- Destination of any visible itemsmodel- Used to locate any needed variablestabPane- For overall GUI navigationname- Which pane in the overall window
-
getBusyGlassPane
- Specified by:
getBusyGlassPanein interfacePaneContainer
-
prepGlassPane
Create a BusyGlassPane transparent layer over the panel blocking any other interaction, excluding a supplied button.- Specified by:
prepGlassPanein interfacePaneContainer- Parameters:
activeButton- a button to put on top of the pane
-
paneFinished
- Specified by:
paneFinishedin interfacePaneContainer
-
enableButtons
Enable the read/write buttons.In addition, if a programming mode pane is present, its "set" button is enabled.
- Specified by:
enableButtonsin interfacePaneContainer- Parameters:
stat- Are reads possible? If false, so not enable the read buttons.
-
isBusy
- Specified by:
isBusyin interfacePaneContainer
-
readChanges
Invoked by "Read Changes" button, this sets in motion a continuing sequence of "read changes" operations on the panes.Each invocation of this method reads one pane; completion of that request will cause it to happen again, reading the next pane, until there's nothing left to read.
- Returns:
- true if a read has been started, false if the operation is complete.
-
readAll
Invoked by the "Read All" button, this sets in motion a continuing sequence of "read all" operations on the panes.Each invocation of this method reads one pane; completion of that request will cause it to happen again, reading the next pane, until there's nothing left to read.
- Returns:
- true if a read has been started, false if the operation is complete.
-
doRead
boolean doRead() -
writeAll
Invoked by "Write All" button, this sets in motion a continuing sequence of "write all" operations on each pane. Each invocation of this method writes one pane; completion of that request will cause it to happen again, writing the next pane, until there's nothing left to write.- Returns:
- true if a write has been started, false if the operation is complete.
-
writeChanges
Invoked by "Write Changes" button, this sets in motion a continuing sequence of "write changes" operations on each pane.Each invocation of this method writes one pane; completion of that request will cause it to happen again, writing the next pane, until there's nothing left to write.
- Returns:
- true if a write has been started, false if the operation is complete
-
doWrite
boolean doWrite() -
printPanes
Prepare a roster entry to be printed, and display a selection list.- Parameters:
preview- true if output should go to a Preview pane on screen, false to output to a printer (dialog)- See Also:
-
propertyChange
Get notification of a variable property change in the pane, specifically "busy" going to false at the end of a programming operation.- Specified by:
propertyChangein interfacePropertyChangeListener- Parameters:
e- Event, used to find source
-
storeFile
Store the locomotives information in the roster (and a RosterEntry file).- Returns:
- false if store failed
-
dispose
Local dispose, which also invokes parent. Note that we remove the components (removeAll) before taking those apart.- Specified by:
disposein interfaceWindowInterface- Overrides:
disposein classJmriJFrame
-
setShowEmptyPanes
Set value of Preference option to show empty panes.- Parameters:
yes- true if empty panes should be shown
-
getShowEmptyPanes
Get value of Preference option to show empty panes.- Returns:
- value from programmer config. manager, else true.
-
setShowCvNumbers
Option to control appearance of CV numbers in tool tips.- Parameters:
yes- true is CV numbers should be shown
-
getShowCvNumbers
-
setCanCacheDefault
-
getCanCacheDefault
-
setDoConfirmRead
-
getDoConfirmRead
-
setDisableProgrammingTrack
-
getDisableProgrammingTrack
-
setDisableProgrammingOnMain
-
getDisableProgrammingOnMain
-
getRosterEntry
-