Package jmri.jmrit.timetable.swing
Class TimeTableFrame
- java.lang.Object
-
- java.awt.Component
-
- java.awt.Container
-
- java.awt.Window
-
- java.awt.Frame
-
- javax.swing.JFrame
-
- jmri.util.JmriJFrame
-
- jmri.jmrit.timetable.swing.TimeTableFrame
-
- All Implemented Interfaces:
java.awt.event.ComponentListener
,java.awt.event.WindowListener
,java.awt.image.ImageObserver
,java.awt.MenuContainer
,java.io.Serializable
,java.util.EventListener
,javax.accessibility.Accessible
,javax.swing.RootPaneContainer
,javax.swing.WindowConstants
,BeanInterface
,ModifiedFlag
,WindowInterface
public class TimeTableFrame extends JmriJFrame
Create and maintain timetables.A timetable describes the layout and trains along with the times that each train should be at specified locations. Logical Schema Layout Train Types Segments Stations Schedules Trains Stops
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static class
TimeTableFrame.TimeTableTreeNode
Timetable Tree Node Definition.-
Nested classes/interfaces inherited from class jmri.util.JmriJFrame
JmriJFrame.ScreenDimensions
-
Nested classes/interfaces inherited from class javax.swing.JFrame
javax.swing.JFrame.AccessibleJFrame
-
Nested classes/interfaces inherited from class java.awt.Window
java.awt.Window.AccessibleAWTWindow, java.awt.Window.Type
-
Nested classes/interfaces inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
-
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
-
Nested classes/interfaces inherited from interface jmri.util.swing.WindowInterface
WindowInterface.Hint
-
-
Field Summary
Fields Modifier and Type Field Description (package private) javax.swing.JButton
_addButton
(package private) javax.swing.JPanel
_addButtonPanel
(package private) javax.swing.JButton
_cancelAction
(package private) javax.swing.JButton
_copyButton
(package private) javax.swing.JPanel
_copyButtonPanel
(package private) TimeTableFrame.TimeTableTreeNode
_curNode
(package private) int
_curNodeId
(package private) int
_curNodeRow
(package private) java.lang.String
_curNodeText
(package private) java.lang.String
_curNodeType
(package private) javax.swing.tree.TreePath
_curTreePath
(package private) TimeTableDataManager
_dataMgr
(package private) javax.swing.JButton
_deleteButton
(package private) javax.swing.JPanel
_deleteButtonPanel
(package private) javax.swing.JPanel
_detailFooter
(package private) javax.swing.JPanel
_detailGrid
(package private) javax.swing.JButton
_displayButton
(package private) javax.swing.JButton
_duplicateButton
(package private) javax.swing.JPanel
_duplicateButtonPanel
(package private) boolean
_editActive
(package private) javax.swing.JTextField
_editDefaultSpeed
(package private) javax.swing.JTextField
_editDistance
(package private) javax.swing.JCheckBox
_editDoubleTrack
(package private) javax.swing.JSpinner
_editDuration
(package private) javax.swing.JTextField
_editEffDate
(package private) javax.swing.JTextField
_editFastClock
(package private) javax.swing.JTextField
_editLayoutName
(package private) javax.swing.JCheckBox
_editMetric
(package private) javax.swing.JTextField
_editNextSpeed
(package private) javax.swing.JComboBox<Scale>
_editScale
(package private) javax.swing.JTextField
_editScheduleName
(package private) javax.swing.JTextField
_editSegmentName
(package private) javax.swing.JSpinner
_editSidings
(package private) javax.swing.JSpinner
_editStaging
(package private) javax.swing.JSpinner
_editStagingTrack
(package private) javax.swing.JSpinner
_editStartHour
(package private) javax.swing.JTextField
_editStationName
(package private) javax.swing.JTextField
_editStopDuration
(package private) javax.swing.JTextArea
_editStopNotes
(package private) javax.swing.JComboBox<TimeTableDataManager.SegmentStation>
_editStopStation
(package private) javax.swing.JSpinner
_editThrottle
(package private) javax.swing.JTextField
_editThrottles
(package private) javax.swing.JTextField
_editTrainDesc
(package private) javax.swing.JTextField
_editTrainName
(package private) javax.swing.JTextArea
_editTrainNotes
(package private) javax.swing.JTextField
_editTrainStartTime
(package private) javax.swing.JComboBox<TrainType>
_editTrainType
(package private) javax.swing.JColorChooser
_editTrainTypeColor
(package private) javax.swing.JTextField
_editTrainTypeName
(package private) javax.swing.JPanel
_graphButtonPanel
(package private) javax.swing.JPanel
_gridPanel
(package private) boolean
_isDirty
(package private) TimeTableFrame.TimeTableTreeNode
_layoutNode
(package private) TimeTableFrame.TimeTableTreeNode
_leafNode
(package private) javax.swing.JPanel
_leftButtonBar
(package private) javax.swing.JPanel
_moveButtonPanel
(package private) javax.swing.JButton
_printButton
(package private) javax.swing.JButton
_saveButton
(package private) TimeTableFrame.TimeTableTreeNode
_scheduleHead
(package private) TimeTableFrame.TimeTableTreeNode
_scheduleNode
(package private) TimeTableFrame.TimeTableTreeNode
_segmentHead
(package private) TimeTableFrame.TimeTableTreeNode
_segmentNode
(package private) javax.swing.JLabel
_showArriveTime
(package private) javax.swing.JLabel
_showDepartTime
(package private) javax.swing.JLabel
_showRouteDuration
(package private) javax.swing.JLabel
_showScaleMK
(package private) javax.swing.JLabel
_showStopSeq
(package private) boolean
_showTrainTimes
(package private) TimeTableFrame.TimeTableTreeNode
_stationNode
(package private) TimeTableFrame.TimeTableTreeNode
_stopNode
(package private) javax.swing.event.TreeSelectionListener
_timetableListener
(package private) javax.swing.tree.DefaultTreeModel
_timetableModel
(package private) javax.swing.tree.DefaultMutableTreeNode
_timetableRoot
(package private) javax.swing.JTree
_timetableTree
(package private) TimeTableFrame.TimeTableTreeNode
_trainNode
(package private) boolean
_twoPage
(package private) TimeTableFrame.TimeTableTreeNode
_typeHead
(package private) TimeTableFrame.TimeTableTreeNode
_typeNode
(package private) javax.swing.JButton
_updateAction
(package private) javax.swing.event.ChangeListener
detailChangeEvent
Enable edit mode.(package private) java.awt.event.FocusListener
detailFocusEvent
Enable edit mode.static java.lang.String
EMPTY_GRID
(package private) java.util.List<java.lang.String>
feedbackList
(package private) javax.swing.JFileChooser
fileChooser
(package private) java.awt.event.ItemListener
layoutScaleItemEvent
If the custom scale item is selected provide a dialog to set the scale ratio(package private) java.awt.event.ItemListener
stopStationItemEvent
Change the max spinner value based on the station data.-
Fields inherited from class jmri.util.JmriJFrame
allowInFrameServlet, properties, reuseFrameSavedPosition, reuseFrameSavedSized, windowInterface
-
Fields 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_CURSOR
-
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
-
-
Constructor Summary
Constructors Constructor Description TimeTableFrame()
TimeTableFrame(java.lang.String tt)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) void
addLayout()
Create a new Layout object with default values.(package private) void
addPressed()
Add new items.(package private) void
addSchedule()
Create a new Schedule object with default values.(package private) void
addSegment()
Create a new Segment object with default values.(package private) void
addStation()
Create a new Station object with default values.(package private) void
addStop()
(package private) void
addTrain()
(package private) void
addTrainType()
Create a new Train Type object.(package private) void
buildComponents()
Initialize components.(package private) java.lang.String
buildNodeText(java.lang.String nodeType, java.lang.Object component, int idx)
Create the localized node text display strings based on node type.(package private) javax.swing.JTree
buildTree()
Create the TimeTable tree structure.(package private) void
cancelPressed()
Cancel the current node edit.(package private) void
completeImport(java.io.File file)
(package private) void
copyPressed()
Copy the stops from an existing train.(package private) Train
copyTrainSelection()
Select the train whose stops will be added to the new train.(package private) void
createMenu()
Create a Options/Tools menu(package private) void
createTimeTableContent()
Create the tree content.(package private) void
deleteLayout()
After confirmation, perform a cascade delete of the layout and its components.(package private) void
deletePressed()
Process the node delete request.(package private) void
deleteSchedule()
Delete a Schedule.(package private) void
deleteSegment()
Delete a Segment.(package private) void
deleteStation()
Delete a Station after checking for usage.(package private) void
deleteStop()
Delete a Stop.(package private) void
deleteTrain()
Delete a Train.(package private) void
deleteTrainType()
Delete a train type after checking for usage.(package private) void
donePressed()
Check for pending updates and close if none or approved.(package private) void
downPressed()
Move a Stop row down 1 row.(package private) void
duplicateLayout(int layoutId)
Create a copy of a layout.(package private) void
duplicatePressed()
Duplicate selected item.(package private) void
duplicateSchedule(int layoutId, int scheduleId, TimeTableFrame.TimeTableTreeNode schedulesNode)
Create a copy of a schedule.(package private) void
duplicateSegment(int layoutId, int segmentId, TimeTableFrame.TimeTableTreeNode segmentsNode)
Create a copy of a segment.(package private) void
duplicateStation(int segmentId, int stationId, TimeTableFrame.TimeTableTreeNode segmentNode)
Create a copy of a station.(package private) void
duplicateStop(int trainId, int stopId, int stationId, int seq, TimeTableFrame.TimeTableTreeNode trainNode)
Create a copy of a stop.(package private) void
duplicateTrain(int schedId, int trainId, int typeId, TimeTableFrame.TimeTableTreeNode schedNode)
Create a copy of a train.(package private) void
duplicateTrainType(int layoutId, int typeId, TimeTableFrame.TimeTableTreeNode typesNode)
Create a copy of a train type.(package private) void
editLayout()
(package private) void
editPressed()
Set up the edit environment for the selected node Called fromtreeRowSelected(jmri.jmrit.timetable.swing.TimeTableFrame.TimeTableTreeNode)
.(package private) void
editSchedule()
(package private) void
editSegment()
(package private) void
editStation()
(package private) void
editStop()
(package private) void
editTrain()
(package private) void
editTrainType()
(package private) void
exportCsvPressed()
protected java.lang.String
getClassName()
(package private) void
graphPressed(java.lang.String graphType)
(package private) void
importCsvPressed()
(package private) void
importFromOperationsPressed()
(package private) void
importPressed()
(package private) void
makeDetailGrid(java.lang.String gridType)
Build new GridBag content.(package private) void
makeEmptyGrid(java.awt.GridBagConstraints c)
This grid is used when there are no edit grids required.(package private) void
makeGridLabel(int row, java.lang.String label, java.lang.String hint, java.awt.GridBagConstraints c)
Create the label portion of a grid row.(package private) void
makeLayoutGrid(java.awt.GridBagConstraints c)
This grid is used to edit Layout data.(package private) void
makeScheduleGrid(java.awt.GridBagConstraints c)
This grid is used to edit the Schedule data.(package private) void
makeSegmentGrid(java.awt.GridBagConstraints c)
This grid is used to edit the Segment data.(package private) void
makeStationGrid(java.awt.GridBagConstraints c)
This grid is used to edit the Station data.(package private) void
makeStopGrid(java.awt.GridBagConstraints c)
This grid is used to edit the Stop data.(package private) void
makeTrainGrid(java.awt.GridBagConstraints c)
This grid is used to edit the Train data.(package private) void
makeTrainTypeGrid(java.awt.GridBagConstraints c)
This grid is used to edit the Train Type data.(package private) void
moveTreeNode(java.lang.String direction)
Move a tree node in response to a up or down request.(package private) int
parseNumber(javax.swing.JTextField textField, java.lang.String fieldName)
Convert text input to an integer.(package private) void
savePressed()
Save the current set of timetable data.(package private) void
setEditMode(boolean active)
Enable/disable buttons based on edit state.(package private) void
setMoveButtons()
Enable/Disable the Up and Down buttons based on the postion in the list.void
setShowReminder(boolean dirty)
Set/clear dirty flag and save button(package private) void
showNodeEditMessage()
Display reminder to save.(package private) void
treeRowSelected(TimeTableFrame.TimeTableTreeNode selectedNode)
Change the button row based on the currently selected node type.(package private) void
updateLayout()
Update the layout information.(package private) void
updatePressed()
Apply the updates to the current node.(package private) void
updateSchedule()
Update the schedule information.(package private) void
updateSegment()
Update the segment information.(package private) void
updateStation()
Update the station information.(package private) void
updateStop()
Update the stop information.(package private) void
updateTrain()
Update the train information.(package private) void
updateTrainType()
Update the train type information.(package private) void
upPressed()
Move a Stop row up 1 row.-
Methods inherited from class jmri.util.JmriJFrame
addHelpMenu, componentHidden, componentMoved, componentResized, componentShown, dispose, generateWindowRef, getAllowInFrameServlet, getEscapeKeyAction, getEscapeKeyClosesWindow, getFrame, getFrame, getFrameList, getFrameList, getIndexedProperty, getMaximumSize, getModifiedFlag, getPreferredSize, getProperty, getPropertyNames, getSavePosition, getSaveSize, getScreenDimensions, getWindowFrameRef, getWindowInterface, handleModified, hasIndexedProperty, hasProperty, initComponents, makePrivateWindow, markWindowModified, multipleInstances, pack, setAllowInFrameServlet, setEscapeKeyAction, setEscapeKeyClosesWindow, setFrameLocation, setIndexedProperty, setModifiedFlag, setProperty, setSavePosition, setSaveSize, setShutDownTask, setWindowInterface, show, show, storeValues, undecorate, windowActivated, windowClosed, windowClosing, windowDeactivated, windowDeiconified, windowIconified, windowOpened
-
Methods 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, update
-
Methods 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, setUndecorated
-
Methods 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, toFront
-
Methods 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, validateTree
-
Methods 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, transferFocusUpCycle
-
-
-
-
Field Detail
-
EMPTY_GRID
public static final java.lang.String EMPTY_GRID
- See Also:
- Constant Field Values
-
_dataMgr
TimeTableDataManager _dataMgr
-
_isDirty
boolean _isDirty
-
_showTrainTimes
boolean _showTrainTimes
-
_twoPage
boolean _twoPage
-
_timetableTree
javax.swing.JTree _timetableTree
-
_timetableModel
javax.swing.tree.DefaultTreeModel _timetableModel
-
_timetableRoot
javax.swing.tree.DefaultMutableTreeNode _timetableRoot
-
_timetableListener
javax.swing.event.TreeSelectionListener _timetableListener
-
_curTreePath
javax.swing.tree.TreePath _curTreePath
-
_layoutNode
TimeTableFrame.TimeTableTreeNode _layoutNode
-
_typeHead
TimeTableFrame.TimeTableTreeNode _typeHead
-
_typeNode
TimeTableFrame.TimeTableTreeNode _typeNode
-
_segmentHead
TimeTableFrame.TimeTableTreeNode _segmentHead
-
_segmentNode
TimeTableFrame.TimeTableTreeNode _segmentNode
-
_stationNode
TimeTableFrame.TimeTableTreeNode _stationNode
-
_scheduleHead
TimeTableFrame.TimeTableTreeNode _scheduleHead
-
_scheduleNode
TimeTableFrame.TimeTableTreeNode _scheduleNode
-
_trainNode
TimeTableFrame.TimeTableTreeNode _trainNode
-
_stopNode
TimeTableFrame.TimeTableTreeNode _stopNode
-
_leafNode
TimeTableFrame.TimeTableTreeNode _leafNode
-
_curNode
TimeTableFrame.TimeTableTreeNode _curNode
-
_curNodeId
int _curNodeId
-
_curNodeType
java.lang.String _curNodeType
-
_curNodeText
java.lang.String _curNodeText
-
_curNodeRow
int _curNodeRow
-
_detailGrid
javax.swing.JPanel _detailGrid
-
_detailFooter
javax.swing.JPanel _detailFooter
-
_gridPanel
javax.swing.JPanel _gridPanel
-
_editActive
boolean _editActive
-
_cancelAction
javax.swing.JButton _cancelAction
-
_updateAction
javax.swing.JButton _updateAction
-
_editLayoutName
javax.swing.JTextField _editLayoutName
-
_editScale
javax.swing.JComboBox<Scale> _editScale
-
_editFastClock
javax.swing.JTextField _editFastClock
-
_editThrottles
javax.swing.JTextField _editThrottles
-
_editMetric
javax.swing.JCheckBox _editMetric
-
_showScaleMK
javax.swing.JLabel _showScaleMK
-
_editTrainTypeName
javax.swing.JTextField _editTrainTypeName
-
_editTrainTypeColor
javax.swing.JColorChooser _editTrainTypeColor
-
_editSegmentName
javax.swing.JTextField _editSegmentName
-
_editStationName
javax.swing.JTextField _editStationName
-
_editDistance
javax.swing.JTextField _editDistance
-
_editDoubleTrack
javax.swing.JCheckBox _editDoubleTrack
-
_editSidings
javax.swing.JSpinner _editSidings
-
_editStaging
javax.swing.JSpinner _editStaging
-
_editScheduleName
javax.swing.JTextField _editScheduleName
-
_editEffDate
javax.swing.JTextField _editEffDate
-
_editStartHour
javax.swing.JSpinner _editStartHour
-
_editDuration
javax.swing.JSpinner _editDuration
-
_editTrainName
javax.swing.JTextField _editTrainName
-
_editTrainDesc
javax.swing.JTextField _editTrainDesc
-
_editTrainType
javax.swing.JComboBox<TrainType> _editTrainType
-
_editDefaultSpeed
javax.swing.JTextField _editDefaultSpeed
-
_editTrainStartTime
javax.swing.JTextField _editTrainStartTime
-
_editThrottle
javax.swing.JSpinner _editThrottle
-
_editTrainNotes
javax.swing.JTextArea _editTrainNotes
-
_showRouteDuration
javax.swing.JLabel _showRouteDuration
-
_showStopSeq
javax.swing.JLabel _showStopSeq
-
_editStopStation
javax.swing.JComboBox<TimeTableDataManager.SegmentStation> _editStopStation
-
_editStopDuration
javax.swing.JTextField _editStopDuration
-
_editNextSpeed
javax.swing.JTextField _editNextSpeed
-
_editStagingTrack
javax.swing.JSpinner _editStagingTrack
-
_editStopNotes
javax.swing.JTextArea _editStopNotes
-
_showArriveTime
javax.swing.JLabel _showArriveTime
-
_showDepartTime
javax.swing.JLabel _showDepartTime
-
_leftButtonBar
javax.swing.JPanel _leftButtonBar
-
_addButtonPanel
javax.swing.JPanel _addButtonPanel
-
_duplicateButtonPanel
javax.swing.JPanel _duplicateButtonPanel
-
_copyButtonPanel
javax.swing.JPanel _copyButtonPanel
-
_deleteButtonPanel
javax.swing.JPanel _deleteButtonPanel
-
_moveButtonPanel
javax.swing.JPanel _moveButtonPanel
-
_graphButtonPanel
javax.swing.JPanel _graphButtonPanel
-
_addButton
javax.swing.JButton _addButton
-
_duplicateButton
javax.swing.JButton _duplicateButton
-
_copyButton
javax.swing.JButton _copyButton
-
_deleteButton
javax.swing.JButton _deleteButton
-
_displayButton
javax.swing.JButton _displayButton
-
_printButton
javax.swing.JButton _printButton
-
_saveButton
javax.swing.JButton _saveButton
-
detailFocusEvent
transient java.awt.event.FocusListener detailFocusEvent
Enable edit mode. Used for JTextFields and JComboBoxs.
-
detailChangeEvent
transient javax.swing.event.ChangeListener detailChangeEvent
Enable edit mode. Used for JCheckBoxs, JSpinners and JColorChoosers.
-
stopStationItemEvent
transient java.awt.event.ItemListener stopStationItemEvent
Change the max spinner value based on the station data. The number of staging tracks varies depending on the selected station.
-
layoutScaleItemEvent
transient java.awt.event.ItemListener layoutScaleItemEvent
If the custom scale item is selected provide a dialog to set the scale ratio
-
fileChooser
javax.swing.JFileChooser fileChooser
-
feedbackList
java.util.List<java.lang.String> feedbackList
-
-
Constructor Detail
-
TimeTableFrame
public TimeTableFrame()
-
TimeTableFrame
public TimeTableFrame(java.lang.String tt)
-
-
Method Detail
-
createMenu
void createMenu()
Create a Options/Tools menu. - Option: Show train times on the graph. - Option: Enable two page graph printing. - Tool: Import a SchedGen data file. - Tool: Import a CSV data file. - Tool: Export a CSV data file. Include the standard Windows and Help menu bar items.
-
buildComponents
void buildComponents()
Initialize components. Add Focus and Change listeners to activate edit mode. Create the color selector for train types.
-
makeDetailGrid
void makeDetailGrid(java.lang.String gridType)
Build new GridBag content. The grid panel is hidden, emptied, re-built and made visible.- Parameters:
gridType
- The type of grid to create
-
makeEmptyGrid
void makeEmptyGrid(java.awt.GridBagConstraints c)
This grid is used when there are no edit grids required.- Parameters:
c
- The constraints object used for the grid construction
-
makeLayoutGrid
void makeLayoutGrid(java.awt.GridBagConstraints c)
This grid is used to edit Layout data.- Parameters:
c
- The constraints object used for the grid construction
-
makeTrainTypeGrid
void makeTrainTypeGrid(java.awt.GridBagConstraints c)
This grid is used to edit the Train Type data.- Parameters:
c
- The constraints object used for the grid construction
-
makeSegmentGrid
void makeSegmentGrid(java.awt.GridBagConstraints c)
This grid is used to edit the Segment data.- Parameters:
c
- The constraints object used for the grid construction
-
makeStationGrid
void makeStationGrid(java.awt.GridBagConstraints c)
This grid is used to edit the Station data.- Parameters:
c
- The constraints object used for the grid construction
-
makeScheduleGrid
void makeScheduleGrid(java.awt.GridBagConstraints c)
This grid is used to edit the Schedule data.- Parameters:
c
- The constraints object used for the grid construction
-
makeTrainGrid
void makeTrainGrid(java.awt.GridBagConstraints c)
This grid is used to edit the Train data.- Parameters:
c
- The constraints object used for the grid construction
-
makeStopGrid
void makeStopGrid(java.awt.GridBagConstraints c)
This grid is used to edit the Stop data.- Parameters:
c
- The constraints object used for the grid construction
-
makeGridLabel
void makeGridLabel(int row, java.lang.String label, java.lang.String hint, java.awt.GridBagConstraints c)
Create the label portion of a grid row.- Parameters:
row
- The grid row number.label
- The bundle key for the label text.hint
- The bundle key for the label tool tip.c
- The grid bag contraints object.
-
addPressed
void addPressed()
Add new items.
-
addLayout
void addLayout()
Create a new Layout object with default values. Add the layout node and the TrainTypes, Segments and Schedules collection nodes.
-
addTrainType
void addTrainType()
Create a new Train Type object. The default color is black.
-
addSegment
void addSegment()
Create a new Segment object with default values.
-
addStation
void addStation()
Create a new Station object with default values.
-
addSchedule
void addSchedule()
Create a new Schedule object with default values.
-
addTrain
void addTrain()
-
addStop
void addStop()
-
duplicatePressed
void duplicatePressed()
Duplicate selected item.
-
duplicateLayout
void duplicateLayout(int layoutId)
Create a copy of a layout.- Parameters:
layoutId
- The id of the layout to be duplicated.
-
duplicateTrainType
void duplicateTrainType(int layoutId, int typeId, TimeTableFrame.TimeTableTreeNode typesNode)
Create a copy of a train type.- Parameters:
layoutId
- The id for the parent layout. Zero if within the same layout.typeId
- The id of the train type to be duplicated.typesNode
- The types node which will be parent for the new train type.
-
duplicateSegment
void duplicateSegment(int layoutId, int segmentId, TimeTableFrame.TimeTableTreeNode segmentsNode)
Create a copy of a segment.- Parameters:
layoutId
- The id for the parent layout. Zero if within the same layout.segmentId
- The id of the segment to be duplicated.segmentsNode
- The segments node which will be parent for the new segment.
-
duplicateStation
void duplicateStation(int segmentId, int stationId, TimeTableFrame.TimeTableTreeNode segmentNode)
Create a copy of a station.- Parameters:
segmentId
- The id for the parent segment. Zero if within the same segment.stationId
- The id of the station to be duplicated.segmentNode
- The segment node which will be parent for the new station.
-
duplicateSchedule
void duplicateSchedule(int layoutId, int scheduleId, TimeTableFrame.TimeTableTreeNode schedulesNode)
Create a copy of a schedule.- Parameters:
layoutId
- The id for the parent layout. Zero if within the same layout.scheduleId
- The id of the schedule to be duplicated.schedulesNode
- The schedules node which will be parent for the new schedule.
-
duplicateTrain
void duplicateTrain(int schedId, int trainId, int typeId, TimeTableFrame.TimeTableTreeNode schedNode)
Create a copy of a train.- Parameters:
schedId
- The id for the parent schedule. Zero if within the same schedule.trainId
- The id of the train to be duplicated.typeId
- The id of the train type. If zero use the source train type.schedNode
- The schedule node which will be parent for the new train.
-
duplicateStop
void duplicateStop(int trainId, int stopId, int stationId, int seq, TimeTableFrame.TimeTableTreeNode trainNode)
Create a copy of a stop.- Parameters:
trainId
- The id for the parent train. Zero if within the same train.stopId
- The id of the stop to be duplicated.stationId
- The id of the station. If zero use the source station.seq
- The sequence for the new stop. If zero calculate the next sequence number.trainNode
- The train node which will be parent for the new stop.
-
copyPressed
void copyPressed()
Copy the stops from an existing train.
-
copyTrainSelection
Train copyTrainSelection()
Select the train whose stops will be added to the new train.- Returns:
- the selected train or null if there is no selection made.
-
editPressed
void editPressed()
Set up the edit environment for the selected node Called fromtreeRowSelected(jmri.jmrit.timetable.swing.TimeTableFrame.TimeTableTreeNode)
. This takes the place of an actual button.
-
editLayout
void editLayout()
-
editTrainType
void editTrainType()
-
editSegment
void editSegment()
-
editStation
void editStation()
-
editSchedule
void editSchedule()
-
editTrain
void editTrain()
-
editStop
void editStop()
-
updatePressed
void updatePressed()
Apply the updates to the current node.
-
updateLayout
void updateLayout()
Update the layout information. If the fast clock or metric values change, a recalc will be required. The throttles value cannot be less than the highest throttle assigned to a train.
-
updateTrainType
void updateTrainType()
Update the train type information.
-
updateSegment
void updateSegment()
Update the segment information.
-
updateStation
void updateStation()
Update the station information. The staging track value cannot be less than any train references.
-
updateSchedule
void updateSchedule()
Update the schedule information. Changes to the schedule times cannot make a train start time or a stop's arrival or departure times invalid.
-
updateTrain
void updateTrain()
Update the train information. The train start time has to have a h:mm format and cannot fall outside of the schedules times.
-
updateStop
void updateStop()
Update the stop information.
-
parseNumber
int parseNumber(javax.swing.JTextField textField, java.lang.String fieldName)
Convert text input to an integer.- Parameters:
textField
- JTextField containing the probable integer.fieldName
- The name of the field for the dialog.- Returns:
- the valid number or -1 for an invalid input.
-
deletePressed
void deletePressed()
Process the node delete request.
-
deleteLayout
void deleteLayout()
After confirmation, perform a cascade delete of the layout and its components.
-
deleteTrainType
void deleteTrainType()
Delete a train type after checking for usage.
-
deleteSegment
void deleteSegment()
Delete a Segment. If the segment contains inactive stations, provide the option to perform a cascade delete.
-
deleteStation
void deleteStation()
Delete a Station after checking for usage.
-
deleteSchedule
void deleteSchedule()
Delete a Schedule. If the schedule contains trains, provide the option to perform a cascade delete of trains and their stops.
-
deleteTrain
void deleteTrain()
Delete a Train. If the train contains stops, provide the option to perform a cascade delete of the stops.
-
deleteStop
void deleteStop()
Delete a Stop.
-
cancelPressed
void cancelPressed()
Cancel the current node edit.
-
upPressed
void upPressed()
Move a Stop row up 1 row.
-
downPressed
void downPressed()
Move a Stop row down 1 row.
-
moveTreeNode
void moveTreeNode(java.lang.String direction)
Move a tree node in response to a up or down request.- Parameters:
direction
- The direction of movement, Up or Down
-
setMoveButtons
void setMoveButtons()
Enable/Disable the Up and Down buttons based on the postion in the list.
-
graphPressed
void graphPressed(java.lang.String graphType)
-
importPressed
void importPressed()
-
importCsvPressed
void importCsvPressed()
-
completeImport
void completeImport(java.io.File file)
-
importFromOperationsPressed
void importFromOperationsPressed()
-
exportCsvPressed
void exportCsvPressed()
-
savePressed
void savePressed()
Save the current set of timetable data.
-
donePressed
void donePressed()
Check for pending updates and close if none or approved.
-
buildTree
javax.swing.JTree buildTree()
Create the TimeTable tree structure.- Returns:
- _timetableTree The tree ddefinition with its content
-
createTimeTableContent
void createTimeTableContent()
Create the tree content. Level 1 -- Layouts Level 2 -- Train Type, Segment and Schedule Containers Level 3 -- Train Types, Segments, Schedules Level 4 -- Stations, Trains Level 5 -- Stops
-
buildNodeText
java.lang.String buildNodeText(java.lang.String nodeType, java.lang.Object component, int idx)
Create the localized node text display strings based on node type.- Parameters:
nodeType
- The type of the nodecomponent
- The object or child objectidx
- Optional index value- Returns:
- nodeText containing the text to display on the node
-
treeRowSelected
void treeRowSelected(TimeTableFrame.TimeTableTreeNode selectedNode)
Change the button row based on the currently selected node type. Invoke edit where appropriate.- Parameters:
selectedNode
- The node object
-
showNodeEditMessage
void showNodeEditMessage()
Display reminder to save.
-
setShowReminder
public void setShowReminder(boolean dirty)
Set/clear dirty flag and save button- Parameters:
dirty
- True if changes have been made that are not saved.
-
setEditMode
void setEditMode(boolean active)
Enable/disable buttons based on edit state. The edit state controls the ability to select tree nodes.- Parameters:
active
- True to make edit active, false to make edit inactive
-
getClassName
protected java.lang.String getClassName()
-
-