- Timestamp:
- 03/24/2019 07:19:23 PM (7 years ago)
- Location:
- trunk/src/tmcsim
- Files:
-
- 2 edited
-
application.properties (modified) (1 diff)
-
simulationmanager/dialogs/GotoTimeIndexDialog.java (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/tmcsim/application.properties
r345 r346 1 #Sun, 24 Mar 2019 11:13:40-07001 #Sun, 24 Mar 2019 20:49:11 -0700 2 2 3 Application.revision=34 43 Application.revision=345 4 4 5 5 Application.buildnumber=110 -
trunk/src/tmcsim/simulationmanager/dialogs/GotoTimeIndexDialog.java
r2 r346 13 13 import javax.swing.JDialog; 14 14 import javax.swing.JLabel; 15 import javax.swing. JSpinner;15 import javax.swing.UIManager; 16 16 17 17 import tmcsim.simulationmanager.SimulationManagerView; 18 import tmcsim.simulationmanager.model.IncidentTimeSpinnerModel; 19 18 import timeselector.*; 20 19 21 20 /** … … 26 25 * 27 26 * @author Matthew Cechini 28 * @version27 * Modifed to use timeselector by jdalbey 3/24/2019 29 28 */ 30 29 @SuppressWarnings("serial") … … 47 46 48 47 initComponents(); 49 50 timeSpinner.setValue(initialValue);51 48 52 49 Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); … … 97 94 }); 98 95 99 incidentTimeModel = new IncidentTimeSpinnerModel(); 100 timeSpinner = new JSpinner(incidentTimeModel); 101 timeSpinner.setMaximumSize(new Dimension(70,20)); 102 timeSpinner.setAlignmentX(Box.CENTER_ALIGNMENT); 96 fldTimeSelection = new TimeSelectionField(false); 103 97 104 98 buttonBox = new Box(BoxLayout.X_AXIS); … … 117 111 gotoIndexBox.add(gotoLabel); 118 112 gotoIndexBox.add(Box.createVerticalStrut(10)); 119 gotoIndexBox.add( timeSpinner);113 gotoIndexBox.add(fldTimeSelection); 120 114 gotoIndexBox.add(Box.createVerticalStrut(10)); 121 115 gotoIndexBox.add(buttonBox); … … 128 122 129 123 /** 130 * Gets a string representation of the time set by the time 131 * spinner in the dialog. Format: H:MM:SS 132 * @return String representation of spinner time. 124 * Accessor to the String representation of user selected time. The text 125 * field contains a String representation of the time in a format produced 126 * by SimpleDateFormat pattern "h:mm:ss", e.g., "3:26:00" 127 * 128 * @return String containing the selected time. 133 129 */ 134 public String getGotoTime() { 135 return (String)timeSpinner.getValue(); 130 public String getGotoTime() 131 { 132 String result = fldTimeSelection.getText(); 133 return result.substring(1, result.length()); 136 134 } 137 135 136 /** Local main for unit testing */ 137 public static void main(String[] args) 138 { 139 try 140 { 141 UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); 142 } catch (Exception ex) 143 { 144 ex.printStackTrace(); 145 } 146 147 GotoTimeIndexDialog dlg = new GotoTimeIndexDialog(null,0); 148 System.out.println(dlg.getGotoTime()); 149 } 138 150 139 151 private JLabel gotoLabel; 140 private JSpinner timeSpinner;141 142 private IncidentTimeSpinnerModel incidentTimeModel;143 152 144 153 private JButton cancelButton;; … … 148 157 private Box buttonBox; 149 158 159 private TimeSelectionField fldTimeSelection; 150 160 }
Note: See TracChangeset
for help on using the changeset viewer.
