Class TableFrames
- All Implemented Interfaces:
EventListener,InternalFrameListener,Disposable
Core code can be used with two interfaces:
- original "desktop" InternalFrames (displays as InternalJFrames inside a JmriJFrame)
- JMRI standard Tabbed tables (displays as Js inside a ListedTableFrame)
This file is part of JMRI.
JMRI is free software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation. See the "COPYING" file for a copy of this license.
JMRI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classstatic classprotected static class********************* Path-Turnout Frame ***********************************protected static class********************* Path-Turnout JPanel class for _tabbed ***************** -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) voidaddCloseListener(JmriJFrame desktop) protected voidaddTurnoutPane(OPath path, PathTurnoutTableModel pathTurnoutModel) Add new Turnout pane, called from makePathTurnoutPanel on _tabbed interface.protected JInternalFramebuildFrame(AbstractTableModel tableModel, String title, String prompt) Wrapper for shared code around each Table in a JInternal window on _desktop interface.voiddispose()Called when disposing of a disposable.protected voiddisposeBlockPathFrame(OBlock block) getBlockPathTableModel(OBlock block) protected JmriJFrameGet the JFrame containig all UI windows.getPrintMenuItems(JTable oBlockTable, JTable portalTable, JTable signalTable, JTable blockPortalTable) protected voidConvert a copy of your current JMRI Blocks to OBlocks and connect them with Portals and Paths.voidvoidvoidvoidvoidvoidvoidvoidprotected booleanprotected TableFrames.BlockPathJPanelmakeBlockPathEditPanel(OBlock block) protected TableFrames.BlockPathFramemakeBlockPathFrame(OBlock block) protected JTableprotected JPanelprotected JTableprotected JTablemakeOBlockTable(OBlockTableModel model) protected TableFrames.PathTurnoutFramemakePathTurnoutFrame(OBlock block, String pathName) protected StringmakePathTurnoutName(String blockSysName, String pathName) Create a coded id for a path turnout.protected TableFrames.PathTurnoutJPanelmakePathTurnoutPanel(OBlock block, String pathName) protected JTableprotected JTablemakePortalTable(PortalTableModel model) protected JTablemakeSignalTable(SignalTableModel model) protected voidopenBlockPathFrame(String blockSystemName) Open a block-specific Block-Path table in _desktop interface.voidopenBlockPathPane(String blockSystemName, String editorTabName) protected booleanopenOBlockEditor(String blockSystemName, String tabname) protected booleanopenPathEditor(String blockName, String pathName, BlockPathTableModel bpmodel) Open the Edit Path panel for _tabbed.protected voidopenPathTurnoutEditor(String pathTurnoutName) Open a block-specific PathTurnouts edit pane as a JmriJFrame for _tabbed from menu.voidopenPathTurnoutEditPane(String pathTurnoutName) protected voidopenPathTurnoutFrame(String pathTurnoutName) Open a block-specific PathTurnouts table as a JInternalFrame for _desktop from BlockPathTableModelprotected voidsetPathEdit(boolean edit) protected voidsetShowWarnings(String cmd) protected voidFill in the Open/Hide Tables menu on tablesMenu.protected intverifyWarning(String message)
-
Field Details
-
ROW_HEIGHT
-
STRUT_SIZE
- See Also:
-
SET_CLOSED
-
SET_THROWN
-
-
Constructor Details
-
TableFrames
public TableFrames() -
TableFrames
-
-
Method Details
-
getOblockTableModel
-
getPortalTableModel
-
getPortalXRefTableModel
-
getBlockPathTableModel
-
getSignalTableModel
-
initComponents
-
addMenus
-
getPrintMenuItems
-
getOptionMenu
-
getTablesMenu
-
getDesktopFrame
Get the JFrame containig all UI windows.- Returns:
- the contentframe
-
importBlocks
Convert a copy of your current JMRI Blocks to OBlocks and connect them with Portals and Paths. Accessed from the Options menu.- Throws:
IllegalArgumentException- exception
-
setShowWarnings
-
addCloseListener
-
updateOBlockTablesMenu
Fill in the Open/Hide Tables menu on tablesMenu. -
openPathTurnoutEditPane
-
buildFrame
Wrapper for shared code around each Table in a JInternal window on _desktop interface.- Parameters:
tableModel- underlying model for the tabletitle- text displayed as title of frameprompt- text below bottom line- Returns:
- iframe to put on _desktop interface
-
makeOBlockTable
-
openOBlockEditor
-
openPathEditor
protected boolean openPathEditor(@Nonnull String blockName, @CheckForNull String pathName, BlockPathTableModel bpmodel) Open the Edit Path panel for _tabbed. Compare with openOBlockEditor(block, selectedtabname) and OBlockTableAction.- Parameters:
blockName- system or user name of the owning oblockpathName- name of the path under edit, or null to create a new pathbpmodel- blockpathtablemodel that should be informed about changes- Returns:
- true if successful
-
makePortalTable
-
makeBlockPortalTable
-
makeSignalTable
-
openBlockPathPane
-
openBlockPathFrame
Open a block-specific Block-Path table in _desktop interface.- Parameters:
blockSystemName- of the OBlock
-
disposeBlockPathFrame
-
makeBlockPathFrame
-
makeBlockPathEditPanel
-
setPathEdit
-
isPathEdit
-
dispose
Description copied from interface:DisposableCalled when disposing of a disposable.Note there are no assurances this method will not be called multiple times against a single instance of this Disposable. It is the responsibility of this Disposable to protect itself and the application from ensuring that calling this method multiple times has no unwanted side effects.
- Specified by:
disposein interfaceDisposable
-
makeBlockPathTablePanel
-
makeBlockPathTable
-
makePathTurnoutFrame
-
makePathTurnoutPanel
protected TableFrames.PathTurnoutJPanel makePathTurnoutPanel(@Nonnull OBlock block, @CheckForNull String pathName) -
makePathTurnoutTable
-
makePathTurnoutName
Create a coded id for a path turnout.- Parameters:
blockSysName- oblock system namepathName- the path through the oblock for which to display turnouts set- Returns:
- name of the pathTurnout, example "%path 1-3&block-1"
-
openPathTurnoutFrame
Open a block-specific PathTurnouts table as a JInternalFrame for _desktop from BlockPathTableModel- Parameters:
pathTurnoutName- name of turnout configured on Path
-
openPathTurnoutEditor
Open a block-specific PathTurnouts edit pane as a JmriJFrame for _tabbed from menu. TODO fix menu access to pathturnouts on _tabbed in ListedTableView, single table menus OK- Parameters:
pathTurnoutName- name of turnout configured on Path
-
addTurnoutPane
Add new Turnout pane, called from makePathTurnoutPanel on _tabbed interface.- Parameters:
path- to link this turnout setting topathTurnoutModel- displayed table of turnouts currently set on this path
-
verifyWarning
-
internalFrameClosing
- Specified by:
internalFrameClosingin interfaceInternalFrameListener
-
internalFrameClosed
- Specified by:
internalFrameClosedin interfaceInternalFrameListener
-
internalFrameOpened
- Specified by:
internalFrameOpenedin interfaceInternalFrameListener
-
internalFrameIconified
- Specified by:
internalFrameIconifiedin interfaceInternalFrameListener
-
internalFrameDeiconified
- Specified by:
internalFrameDeiconifiedin interfaceInternalFrameListener
-
internalFrameActivated
- Specified by:
internalFrameActivatedin interfaceInternalFrameListener
-
internalFrameDeactivated
- Specified by:
internalFrameDeactivatedin interfaceInternalFrameListener
-