Package jmri.jmrit.beantable.oblock
Class TableFrames
- java.lang.Object
-
- jmri.jmrit.beantable.oblock.TableFrames
-
- All Implemented Interfaces:
java.util.EventListener
,javax.swing.event.InternalFrameListener
public class TableFrames extends java.lang.Object implements javax.swing.event.InternalFrameListener
GUI to define OBlocks.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 Classes Modifier and Type Class Description protected static class
TableFrames.BlockPathFrame
static class
TableFrames.BlockPathJPanel
protected static class
TableFrames.PathTurnoutFrame
********************* Path-Turnout Frame ***********************************protected static class
TableFrames.PathTurnoutJPanel
********************* Path-Turnout JPanel class for _tabbed *****************
-
Field Summary
Fields Modifier and Type Field Description static int
ROW_HEIGHT
protected static java.lang.String
SET_CLOSED
protected static java.lang.String
SET_THROWN
static int
STRUT_SIZE
-
Constructor Summary
Constructors Constructor Description TableFrames()
TableFrames(java.lang.String actionName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) void
addCloseListener(JmriJFrame desktop)
javax.swing.JMenuBar
addMenus(javax.swing.JMenuBar mBar)
protected void
addTurnoutPane(OPath path, PathTurnoutTableModel pathTurnoutModel)
Add new Turnout pane, called from makePathTurnoutPanel on _tabbed interface.protected javax.swing.JInternalFrame
buildFrame(javax.swing.table.AbstractTableModel tableModel, java.lang.String title, java.lang.String prompt)
Wrapper for shared code around each Table in a JInternal window on _desktop interface.protected void
disposeBlockPathFrame(OBlock block)
BlockPathTableModel
getBlockPathTableModel(OBlock block)
protected JmriJFrame
getDesktopFrame()
Get the JFrame containig all UI windows.OBlockTableModel
getOblockTableModel()
javax.swing.JMenu
getOptionMenu()
PortalTableModel
getPortalTableModel()
BlockPortalTableModel
getPortalXRefTableModel()
javax.swing.JMenu
getPrintMenuItems(javax.swing.JTable oBlockTable, javax.swing.JTable portalTable, javax.swing.JTable signalTable, javax.swing.JTable blockPortalTable)
SignalTableModel
getSignalTableModel()
javax.swing.JMenu
getTablesMenu()
protected void
importBlocks()
Convert a copy of your current JMRI Blocks to OBlocks and connect them with Portals and Paths.void
initComponents()
void
internalFrameActivated(javax.swing.event.InternalFrameEvent e)
void
internalFrameClosed(javax.swing.event.InternalFrameEvent e)
void
internalFrameClosing(javax.swing.event.InternalFrameEvent e)
void
internalFrameDeactivated(javax.swing.event.InternalFrameEvent e)
void
internalFrameDeiconified(javax.swing.event.InternalFrameEvent e)
void
internalFrameIconified(javax.swing.event.InternalFrameEvent e)
void
internalFrameOpened(javax.swing.event.InternalFrameEvent e)
protected boolean
isPathEdit()
protected TableFrames.BlockPathJPanel
makeBlockPathEditPanel(OBlock block)
protected TableFrames.BlockPathFrame
makeBlockPathFrame(OBlock block)
protected javax.swing.JTable
makeBlockPathTable(BlockPathTableModel _model)
protected javax.swing.JPanel
makeBlockPathTablePanel(BlockPathTableModel _model)
protected javax.swing.JTable
makeBlockPortalTable(BlockPortalTableModel model)
protected javax.swing.JTable
makeOBlockTable(OBlockTableModel model)
protected TableFrames.PathTurnoutFrame
makePathTurnoutFrame(OBlock block, java.lang.String pathName)
protected java.lang.String
makePathTurnoutName(java.lang.String blockSysName, java.lang.String pathName)
Create a coded id for a path turnout.protected TableFrames.PathTurnoutJPanel
makePathTurnoutPanel(OBlock block, java.lang.String pathName)
protected javax.swing.JTable
makePathTurnoutTable(PathTurnoutTableModel model)
protected javax.swing.JTable
makePortalTable(PortalTableModel model)
protected javax.swing.JTable
makeSignalTable(SignalTableModel model)
protected void
openBlockPathFrame(java.lang.String blockSystemName)
Open a block-specific Block-Path table in _desktop interface.void
openBlockPathPane(java.lang.String blockSystemName, java.lang.String editorTabName)
protected boolean
openOBlockEditor(java.lang.String blockSystemName, java.lang.String tabname)
protected boolean
openPathEditor(java.lang.String blockName, java.lang.String pathName, BlockPathTableModel bpmodel)
Open the Edit Path panel for _tabbed.protected void
openPathTurnoutEditor(java.lang.String pathTurnoutName)
Open a block-specific PathTurnouts edit pane as a JmriJFrame for _tabbed from menu.void
openPathTurnoutEditPane(java.lang.String pathTurnoutName)
protected void
openPathTurnoutFrame(java.lang.String pathTurnoutName)
Open a block-specific PathTurnouts table as a JInternalFrame for _desktop from BlockPathTableModelprotected void
setPathEdit(boolean edit)
protected void
setShowWarnings(java.lang.String cmd)
protected void
updateOBlockTablesMenu()
Fill in the Open/Hide Tables menu on tablesMenu.protected int
verifyWarning(java.lang.String message)
-
-
-
Field Detail
-
ROW_HEIGHT
public static final int ROW_HEIGHT
-
STRUT_SIZE
public static final int STRUT_SIZE
- See Also:
- Constant Field Values
-
SET_CLOSED
protected static final java.lang.String SET_CLOSED
-
SET_THROWN
protected static final java.lang.String SET_THROWN
-
-
Constructor Detail
-
TableFrames
public TableFrames()
-
TableFrames
public TableFrames(java.lang.String actionName)
-
-
Method Detail
-
getOblockTableModel
public OBlockTableModel getOblockTableModel()
-
getPortalTableModel
public PortalTableModel getPortalTableModel()
-
getPortalXRefTableModel
public BlockPortalTableModel getPortalXRefTableModel()
-
getBlockPathTableModel
public BlockPathTableModel getBlockPathTableModel(OBlock block)
-
getSignalTableModel
public SignalTableModel getSignalTableModel()
-
initComponents
public void initComponents()
-
addMenus
public javax.swing.JMenuBar addMenus(javax.swing.JMenuBar mBar)
-
getPrintMenuItems
public javax.swing.JMenu getPrintMenuItems(javax.swing.JTable oBlockTable, javax.swing.JTable portalTable, javax.swing.JTable signalTable, javax.swing.JTable blockPortalTable)
-
getOptionMenu
public javax.swing.JMenu getOptionMenu()
-
getTablesMenu
public javax.swing.JMenu getTablesMenu()
-
getDesktopFrame
protected JmriJFrame getDesktopFrame()
Get the JFrame containig all UI windows.- Returns:
- the contentframe
-
importBlocks
protected void importBlocks() throws java.lang.IllegalArgumentException
Convert a copy of your current JMRI Blocks to OBlocks and connect them with Portals and Paths. Accessed from the Options menu.- Throws:
java.lang.IllegalArgumentException
- exception
-
setShowWarnings
protected void setShowWarnings(java.lang.String cmd)
-
addCloseListener
void addCloseListener(JmriJFrame desktop)
-
updateOBlockTablesMenu
protected void updateOBlockTablesMenu()
Fill in the Open/Hide Tables menu on tablesMenu.
-
openPathTurnoutEditPane
public void openPathTurnoutEditPane(java.lang.String pathTurnoutName)
-
buildFrame
protected javax.swing.JInternalFrame buildFrame(javax.swing.table.AbstractTableModel tableModel, java.lang.String title, java.lang.String prompt)
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
protected javax.swing.JTable makeOBlockTable(OBlockTableModel model)
-
openOBlockEditor
protected boolean openOBlockEditor(java.lang.String blockSystemName, java.lang.String tabname)
-
openPathEditor
protected boolean openPathEditor(@Nonnull java.lang.String blockName, @CheckForNull java.lang.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
protected javax.swing.JTable makePortalTable(PortalTableModel model)
-
makeBlockPortalTable
protected javax.swing.JTable makeBlockPortalTable(BlockPortalTableModel model)
-
makeSignalTable
protected javax.swing.JTable makeSignalTable(SignalTableModel model)
-
openBlockPathPane
public void openBlockPathPane(java.lang.String blockSystemName, java.lang.String editorTabName)
-
openBlockPathFrame
protected void openBlockPathFrame(java.lang.String blockSystemName)
Open a block-specific Block-Path table in _desktop interface.- Parameters:
blockSystemName
- of the OBlock
-
disposeBlockPathFrame
protected void disposeBlockPathFrame(OBlock block)
-
makeBlockPathFrame
protected TableFrames.BlockPathFrame makeBlockPathFrame(OBlock block)
-
makeBlockPathEditPanel
protected TableFrames.BlockPathJPanel makeBlockPathEditPanel(OBlock block)
-
setPathEdit
protected void setPathEdit(boolean edit)
-
isPathEdit
protected boolean isPathEdit()
-
makeBlockPathTablePanel
protected javax.swing.JPanel makeBlockPathTablePanel(BlockPathTableModel _model)
-
makeBlockPathTable
protected javax.swing.JTable makeBlockPathTable(BlockPathTableModel _model)
-
makePathTurnoutFrame
protected TableFrames.PathTurnoutFrame makePathTurnoutFrame(OBlock block, java.lang.String pathName)
-
makePathTurnoutPanel
protected TableFrames.PathTurnoutJPanel makePathTurnoutPanel(@Nonnull OBlock block, @CheckForNull java.lang.String pathName)
-
makePathTurnoutTable
protected javax.swing.JTable makePathTurnoutTable(PathTurnoutTableModel model)
-
makePathTurnoutName
protected java.lang.String makePathTurnoutName(java.lang.String blockSysName, java.lang.String pathName)
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
protected void openPathTurnoutFrame(java.lang.String pathTurnoutName)
Open a block-specific PathTurnouts table as a JInternalFrame for _desktop from BlockPathTableModel- Parameters:
pathTurnoutName
- name of turnout configured on Path
-
openPathTurnoutEditor
protected void openPathTurnoutEditor(java.lang.String pathTurnoutName)
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
protected void addTurnoutPane(OPath path, PathTurnoutTableModel pathTurnoutModel)
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
protected int verifyWarning(java.lang.String message)
-
internalFrameClosing
public void internalFrameClosing(javax.swing.event.InternalFrameEvent e)
- Specified by:
internalFrameClosing
in interfacejavax.swing.event.InternalFrameListener
-
internalFrameClosed
public void internalFrameClosed(javax.swing.event.InternalFrameEvent e)
- Specified by:
internalFrameClosed
in interfacejavax.swing.event.InternalFrameListener
-
internalFrameOpened
public void internalFrameOpened(javax.swing.event.InternalFrameEvent e)
- Specified by:
internalFrameOpened
in interfacejavax.swing.event.InternalFrameListener
-
internalFrameIconified
public void internalFrameIconified(javax.swing.event.InternalFrameEvent e)
- Specified by:
internalFrameIconified
in interfacejavax.swing.event.InternalFrameListener
-
internalFrameDeiconified
public void internalFrameDeiconified(javax.swing.event.InternalFrameEvent e)
- Specified by:
internalFrameDeiconified
in interfacejavax.swing.event.InternalFrameListener
-
internalFrameActivated
public void internalFrameActivated(javax.swing.event.InternalFrameEvent e)
- Specified by:
internalFrameActivated
in interfacejavax.swing.event.InternalFrameListener
-
internalFrameDeactivated
public void internalFrameDeactivated(javax.swing.event.InternalFrameEvent e)
- Specified by:
internalFrameDeactivated
in interfacejavax.swing.event.InternalFrameListener
-
-