|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Window
java.awt.Dialog
javax.swing.JDialog
gui.dialogs.ConnectionTimetableCreator
A dialog used to define a timetable for a connection. A list of stations and their order is already known at the time of creating a timetable.
Nested Class Summary |
Nested classes inherited from class javax.swing.JDialog |
javax.swing.JDialog.AccessibleJDialog |
Nested classes inherited from class java.awt.Dialog |
java.awt.Dialog.AccessibleAWTDialog |
Nested classes inherited from class java.awt.Window |
java.awt.Window.AccessibleAWTWindow |
Nested classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
Nested classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
private Connection |
addedConnection
A connection added to the world if the OK button has been clicked. |
static int |
CANCEL
The cancel dialog result. |
private javax.swing.JButton |
cancelButton
A cancel button. |
private java.lang.String |
connectionName
A name the new connection is to be given. |
private int |
dialogResult
The dialog result. |
private javax.swing.JCheckBox |
eachDayCheckbox
A `each day' check box. |
private javax.swing.JTextField |
everyXTimeSpanTextField
A text field to receive the every x time span repetition per day. |
private javax.swing.JCheckBox |
fridayCheckbox
A `Friday' checkbox. |
private int |
meanOfTransportation
A mean of transportation for a new connection. |
private javax.swing.JCheckBox |
mondayCheckbox
A `Monday' checkbox. |
static int |
OK
The OK dialog result. |
private javax.swing.JButton |
okButton
An OK button. |
private java.awt.Container |
panel
A main panel of this dialog. |
private javax.swing.JCheckBox |
repetitionsCheckBox
A `Use repetitions' check box. |
private javax.swing.JTextField |
repetitionsLowerLimit
A text field for a lower limit of repetitions. |
private javax.swing.JTextField |
repetitionsUpperLimit
A text field for an upper limit of repetitions. |
private javax.swing.JCheckBox |
returnConnectionsCheckBox
A 'return connection(s) check box. |
private javax.swing.JCheckBox |
saturdayCheckbox
A `Saturday' checkbox. |
private java.util.ArrayList |
stations
A list of stations. |
private int |
stationsCount
A count of stations in the timetable. |
private javax.swing.JCheckBox |
sundayCheckbox
A `Sunday' checkbox. |
private javax.swing.JCheckBox |
thursdayCheckbox
A `Thursday' checkbox. |
private javax.swing.JButton |
timesPerDayPreviewButton
A button used to preview the times that the `every x minutes' value defines. |
private StationsTimetableEditor |
timetableEditor
An editor for times of arrivals and departures per stations. |
private javax.swing.JCheckBox |
tuesdayCheckbox
A `Tuesday' checkbox. |
private javax.swing.JCheckBox |
wednesdayCheckbox
A `Wednesday' checkbox. |
Fields inherited from class javax.swing.JDialog |
accessibleContext, rootPane, rootPaneCheckingEnabled |
Fields inherited from class java.awt.Dialog |
|
Fields inherited from class java.awt.Window |
|
Fields inherited from class java.awt.Container |
|
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface javax.swing.WindowConstants |
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
ConnectionTimetableCreator(java.lang.String title,
java.lang.String connectionName,
java.util.ArrayList stations,
int meanOfTransportation,
Connection connection)
Constructor. |
Method Summary | |
void |
actionPerformed(java.awt.event.ActionEvent e)
|
private void |
AddOKCancel()
Adds the OK and Cancel buttons. |
private void |
AddRepetitionOptions(boolean fAddNonEditionOptions)
Adds the options to cuztomise the repetition of this connection. |
Connection |
GetAddedConnection()
Gets the connection added to the world if the OK button has been clicked. |
private char |
GetDayOfWeekMask()
Gets a mask of day of week set according to the settings on the dialog. |
int |
GetDialogResult()
Gets the dialog result. |
private java.util.ArrayList |
GetInvertedShiftsList()
Gets an ordered list of shifts of time for an inverted list of stations of a currently defined connection. |
private java.util.ArrayList |
GetInvertedStationsList()
Gets an inverted list of stations. |
private java.util.ArrayList |
GetShiftsList()
Gets an ordered list of shifts of time for a currently defined connection. |
private void |
OnEachDayCheckbox()
A handler for the each day checkbox. |
private void |
OnOKButton()
A handler for the OK button. |
private void |
OnPreviewButton()
A handler for the preview button. |
private void |
OnRepetitionCheckbox()
A handler for the repetiotion checkbox. |
boolean |
ValidateSettings(java.util.ArrayList errorsList,
boolean fValidateDayOfWeek)
Validates all the entered settings on this dialog. |
Methods inherited from class javax.swing.JDialog |
addImpl, createRootPane, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update |
Methods inherited from class java.awt.Dialog |
addNotify, dispose, getTitle, hide, isModal, isResizable, isUndecorated, setModal, setResizable, setTitle, setUndecorated, show |
Methods inherited from class java.awt.Window |
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, finalize, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getInputContext, getListeners, getLocale, getMostRecentFocusOwner, getOwnedWindows, getOwner, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindowStateListeners, isActive, isFocusableWindow, isFocusCycleRoot, isFocused, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, setCursor, setFocusableWindowState, setFocusCycleRoot, setLocationRelativeTo, 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, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, removeNotify, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, transferFocusBackward, 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, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, 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, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
private java.lang.String connectionName
private int meanOfTransportation
MeanOfTransportation.AIRPLANE
,
MeanOfTransportation.BUS
,
MeanOfTransportation.TRAIN
,
MeanOfTransportation.SHIP
private int stationsCount
private java.util.ArrayList stations
private StationsTimetableEditor timetableEditor
private javax.swing.JButton okButton
private javax.swing.JButton cancelButton
public static final int OK
public static final int CANCEL
private int dialogResult
private java.awt.Container panel
private Connection addedConnection
private javax.swing.JTextField repetitionsLowerLimit
private javax.swing.JTextField repetitionsUpperLimit
private javax.swing.JCheckBox eachDayCheckbox
private javax.swing.JCheckBox mondayCheckbox
private javax.swing.JCheckBox tuesdayCheckbox
private javax.swing.JCheckBox wednesdayCheckbox
private javax.swing.JCheckBox thursdayCheckbox
private javax.swing.JCheckBox fridayCheckbox
private javax.swing.JCheckBox saturdayCheckbox
private javax.swing.JCheckBox sundayCheckbox
private javax.swing.JCheckBox repetitionsCheckBox
private javax.swing.JTextField everyXTimeSpanTextField
private javax.swing.JButton timesPerDayPreviewButton
private javax.swing.JCheckBox returnConnectionsCheckBox
Constructor Detail |
public ConnectionTimetableCreator(java.lang.String title, java.lang.String connectionName, java.util.ArrayList stations, int meanOfTransportation, Connection connection)
title
- A title of the dialog window.connectionName
- A name the new connection is to be given. Ignored if connection is not null.stations
- A list of stations.meanOfTransportation
- A mean of transportation. This is required only to count the default times of travel. Ignored if connection is not null.connection
- A connection to be edited. Set it to null if creating a new connection.MeanOfTransportation.AIRPLANE
,
MeanOfTransportation.BUS
,
MeanOfTransportation.TRAIN
,
MeanOfTransportation.SHIP
Method Detail |
public int GetDialogResult()
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed
in interface java.awt.event.ActionListener
ActionListener.actionPerformed(java.awt.event.ActionEvent)
private void OnEachDayCheckbox()
actionPerformed(ActionEvent)
private void OnRepetitionCheckbox()
actionPerformed(ActionEvent)
private void OnPreviewButton()
actionPerformed(ActionEvent)
private void OnOKButton()
actionPerformed(ActionEvent)
public Connection GetAddedConnection()
private char GetDayOfWeekMask()
Connection.MONDAY
,
Connection.TUESDAY
,
Connection.WEDNESDAY
,
Connection.THURSDAY
,
Connection.FRIDAY
,
Connection.SATURDAY
,
Connection.SUNDAY
private java.util.ArrayList GetShiftsList()
private java.util.ArrayList GetInvertedShiftsList()
private java.util.ArrayList GetInvertedStationsList()
private void AddOKCancel()
private void AddRepetitionOptions(boolean fAddNonEditionOptions)
fAddNonEditionOptions
- Indicates whether to show the per day repetitons options and the return connection option. They are not available in the edition mode.public boolean ValidateSettings(java.util.ArrayList errorsList, boolean fValidateDayOfWeek)
errorsList
- A list of strings, the error messages will be added to.fValidateDayOfWeek
- Indicates whether to check the settings for day of week. Preview button does not neet it.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |