Changeset 145 in tmcsimulator-scriptbuilder for trunk/src/event/editor/frame
- Timestamp:
- 11/04/2019 08:14:32 AM (6 years ago)
- Location:
- trunk/src/event/editor/frame
- Files:
-
- 3 edited
-
Editor.form (modified) (6 diffs)
-
Editor.java (modified) (25 diffs)
-
PropertyModel.java (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/event/editor/frame/Editor.form
r134 r145 251 251 </NonVisualComponents> 252 252 <Properties> 253 <Property name="defaultCloseOperation" type="int" value=" 2"/>253 <Property name="defaultCloseOperation" type="int" value="0"/> 254 254 <Property name="title" type="java.lang.String" value="Event Editor"/> 255 255 </Properties> … … 279 279 <Component id="txtEventStart" min="-2" max="-2" attributes="0"/> 280 280 <EmptySpace max="-2" attributes="0"/> 281 <Component id="jLabel1" min="-2" max="-2" attributes="0"/> 282 <EmptySpace max="-2" attributes="0"/> 283 <Component id="timeHourComboSelector" min="-2" max="-2" attributes="0"/> 284 <EmptySpace max="-2" attributes="0"/> 285 <Component id="jLabel2" min="-2" max="-2" attributes="0"/> 286 <EmptySpace max="-2" attributes="0"/> 287 <Component id="timeMinuteComboSelector" min="-2" max="-2" attributes="0"/> 288 <EmptySpace max="-2" attributes="0"/> 289 <Component id="jLabel3" min="-2" max="-2" attributes="0"/> 290 <EmptySpace max="-2" attributes="0"/> 291 <Component id="timeSecondComboSelector" min="-2" max="-2" attributes="0"/> 292 <EmptySpace max="-2" attributes="0"/> 281 293 <Component id="bottomFramePanel" max="32767" attributes="0"/> 282 294 <EmptySpace max="-2" attributes="0"/> 283 295 <Component id="btnRemoveCurrentEvent" min="-2" pref="226" max="-2" attributes="0"/> 296 <EmptySpace max="-2" attributes="0"/> 297 <Component id="saveCloseBtn" min="-2" max="-2" attributes="0"/> 284 298 <EmptySpace max="-2" attributes="0"/> 285 299 </Group> … … 290 304 <Group type="102" alignment="0" attributes="0"> 291 305 <EmptySpace max="-2" attributes="0"/> 292 <Component id="eventTabsPane" pref="534" max="32767" attributes="0"/>306 <Component id="eventTabsPane" min="-2" pref="523" max="-2" attributes="0"/> 293 307 <EmptySpace max="-2" attributes="0"/> 294 308 <Group type="103" groupAlignment="0" attributes="0"> 295 309 <Component id="bottomFramePanel" min="-2" max="-2" attributes="0"/> 296 <Component id="txtEventStart" min="-2" max="-2" attributes="0"/> 297 <Component id="btnRemoveCurrentEvent" min="-2" max="-2" attributes="0"/> 310 <Group type="103" groupAlignment="3" attributes="0"> 311 <Component id="txtEventStart" alignment="3" min="-2" max="-2" attributes="0"/> 312 <Component id="timeSecondComboSelector" alignment="3" min="-2" max="-2" attributes="0"/> 313 <Component id="timeMinuteComboSelector" alignment="3" min="-2" max="-2" attributes="0"/> 314 <Component id="timeHourComboSelector" alignment="3" min="-2" max="-2" attributes="0"/> 315 <Component id="jLabel1" alignment="3" min="-2" max="-2" attributes="0"/> 316 <Component id="jLabel2" alignment="3" min="-2" max="-2" attributes="0"/> 317 <Component id="jLabel3" alignment="3" min="-2" max="-2" attributes="0"/> 318 </Group> 319 <Group type="103" groupAlignment="3" attributes="0"> 320 <Component id="saveCloseBtn" alignment="3" min="-2" max="-2" attributes="0"/> 321 <Component id="btnRemoveCurrentEvent" alignment="3" min="-2" max="-2" attributes="0"/> 322 </Group> 298 323 </Group> 299 324 </Group> … … 311 336 <DimensionLayout dim="0"> 312 337 <Group type="103" groupAlignment="0" attributes="0"> 313 <EmptySpace min="0" pref=" 613" max="32767" attributes="0"/>338 <EmptySpace min="0" pref="70" max="32767" attributes="0"/> 314 339 </Group> 315 340 </DimensionLayout> 316 341 <DimensionLayout dim="1"> 317 342 <Group type="103" groupAlignment="0" attributes="0"> 318 <EmptySpace min="0" pref=" 34" max="32767" attributes="0"/>343 <EmptySpace min="0" pref="45" max="32767" attributes="0"/> 319 344 </Group> 320 345 </DimensionLayout> … … 325 350 <Property name="text" type="java.lang.String" value="00:00:00"/> 326 351 </Properties> 352 <Events> 353 <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtEventStartActionPerformed"/> 354 </Events> 355 </Component> 356 <Component class="javax.swing.JButton" name="saveCloseBtn"> 357 <Properties> 358 <Property name="text" type="java.lang.String" value="Save and Close"/> 359 </Properties> 360 <Events> 361 <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="saveCloseBtnActionPerformed"/> 362 </Events> 327 363 </Component> 328 364 <Component class="javax.swing.JButton" name="btnRemoveCurrentEvent"> … … 334 370 </Events> 335 371 </Component> 372 <Component class="javax.swing.JComboBox" name="timeSecondComboSelector"> 373 <Properties> 374 <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> 375 <StringArray count="1"> 376 <StringItem index="0" value="Second"/> 377 </StringArray> 378 </Property> 379 </Properties> 380 <Events> 381 <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="timeSecondComboSelectorActionPerformed"/> 382 </Events> 383 <AuxValues> 384 <AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="<String>"/> 385 </AuxValues> 386 </Component> 387 <Component class="javax.swing.JComboBox" name="timeMinuteComboSelector"> 388 <Properties> 389 <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> 390 <StringArray count="1"> 391 <StringItem index="0" value="Minute"/> 392 </StringArray> 393 </Property> 394 </Properties> 395 <Events> 396 <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="timeMinuteComboSelectorActionPerformed"/> 397 </Events> 398 <AuxValues> 399 <AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="<String>"/> 400 </AuxValues> 401 </Component> 402 <Component class="javax.swing.JComboBox" name="timeHourComboSelector"> 403 <Properties> 404 <Property name="model" type="javax.swing.ComboBoxModel" editor="org.netbeans.modules.form.editors2.ComboBoxModelEditor"> 405 <StringArray count="1"> 406 <StringItem index="0" value="Hour"/> 407 </StringArray> 408 </Property> 409 </Properties> 410 <AuxValues> 411 <AuxValue name="JavaCodeGenerator_TypeParameters" type="java.lang.String" value="<String>"/> 412 </AuxValues> 413 </Component> 414 <Component class="javax.swing.JLabel" name="jLabel1"> 415 <Properties> 416 <Property name="text" type="java.lang.String" value="Hour"/> 417 </Properties> 418 </Component> 419 <Component class="javax.swing.JLabel" name="jLabel2"> 420 <Properties> 421 <Property name="text" type="java.lang.String" value="Minute"/> 422 </Properties> 423 </Component> 424 <Component class="javax.swing.JLabel" name="jLabel3"> 425 <Properties> 426 <Property name="text" type="java.lang.String" value="Second"/> 427 </Properties> 428 </Component> 336 429 </SubComponents> 337 430 </Form> -
trunk/src/event/editor/frame/Editor.java
r134 r145 11 11 import scriptbuilder.gui.IncidentEditorFrame; 12 12 import scriptbuilder.gui.ScriptBuilderFrame; 13 import scriptbuilder.gui.ScriptBuilderGuiConstants; 13 14 import scriptbuilder.gui.panels.IncidentTimelinePanel; 14 15 import scriptbuilder.structures.ScriptEvent; … … 32 33 model.addEventPanel(property, se); 33 34 } 34 35 /** 36 * adds all of the events from the timeslice to the incidentTimelinePanel 37 * @param ts the timeslice to be added 38 */ 35 39 public void setSlice(TimeSlice ts) 36 40 { … … 42 46 for (I_ScriptEvent se : slice.events) 43 47 { 44 48 45 49 this.addEvent(IncidentTimelinePanel.eventTypeToPropertyMap.get(se.getScriptEventType()), se); 46 50 … … 52 56 System.out.println("[" + eventTime + "]"); 53 57 txtEventStart.setText(eventTime); 58 List<Integer> timesS = timeGenerator(eventTime,"s"); 59 List<Integer> timesM = timeGenerator(eventTime,"m"); 60 List<Integer> timesH = timeGenerator(eventTime,"h"); 61 timeHourComboSelector.setModel(new DefaultComboBoxModel(timesH.toArray())); 62 timeMinuteComboSelector.setModel(new DefaultComboBoxModel(timesM.toArray())); 63 timeSecondComboSelector.setModel(new DefaultComboBoxModel(timesS.toArray())); 64 timeHourComboSelector.setSelectedItem(slice.getTime()/3600); 65 timeMinuteComboSelector.setSelectedItem((slice.getTime()%3600)/60); 66 timeSecondComboSelector.setSelectedItem(slice.getTime()%60); 54 67 } 55 68 56 69 } 70 71 private List<Integer> timeGenerator(String time,String type) 72 { 73 List<Integer> times = new ArrayList<Integer>(); 74 String[] timeArray = time.split(":"); 75 int currTime = 0; 76 switch(type) 77 { 78 case "h": 79 { 80 currTime = Integer.parseInt(timeArray[0]); 81 for(int i = 0;i< ScriptBuilderGuiConstants.MAX_SIMULATION_LENGTH/3600;i++) 82 { 83 times.add(i); 84 } 85 break; 86 } 87 case "m": 88 { 89 currTime = Integer.parseInt(timeArray[1]); 90 for(int i = 0; i<60;i++) 91 { 92 times.add(i); 93 } 94 95 break; 96 } 97 case "s": 98 { 99 //includes times 0,20,40,80 100 currTime = Integer.parseInt(timeArray[2]); 101 for(int i = 0; i<60;i+=ScriptBuilderGuiConstants.HORIZONTAL_TICK_RESOLUTION) 102 { 103 times.add(i); 104 } 105 break; 106 } 107 default: 108 { 109 } 110 111 } 112 113 114 //times.add(time); 115 116 return times; 117 } 118 119 57 120 58 121 private ActionListener optionalChangeListener = new ActionListener() … … 123 186 124 187 } 125 188 //this eventTime might need to be initialized to the correct time 126 189 String eventTime = ""; 127 190 … … 159 222 //If we deleted the first event(s), this will add the offsets, 160 223 //to ensure that events stay at the correct times 161 model.closePanels(); 162 } 163 }); 224 Object[] options = {"Yes","Cancel"}; 225 int result = JOptionPane.showOptionDialog(null,"Are you sure you want to exit without saving?", 226 "Exit", 227 JOptionPane.YES_NO_OPTION, 228 JOptionPane.QUESTION_MESSAGE, 229 null, 230 options, 231 options[1]); 232 switch (result){ 233 //should just close 234 case 0: 235 closeWindow(); 236 //this.setVisible(true); 237 break; 238 // should do nothing 239 case 1: 240 241 break; 242 default: 243 break; 244 } 245 //add a do you want to close without saving popup window here 246 247 } 248 }); 249 } 250 private void closeWindow(){ 251 this.dispose(); 164 252 } 165 253 … … 171 259 @SuppressWarnings("unchecked") 172 260 // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents 173 private void initComponents() 174 { 261 private void initComponents() { 175 262 176 263 eventTabsPane = new javax.swing.JTabbedPane(); 177 264 bottomFramePanel = new javax.swing.JPanel(); 178 265 txtEventStart = new javax.swing.JTextField(); 266 saveCloseBtn = new javax.swing.JButton(); 179 267 btnRemoveCurrentEvent = new javax.swing.JButton(); 268 timeSecondComboSelector = new javax.swing.JComboBox<>(); 269 timeMinuteComboSelector = new javax.swing.JComboBox<>(); 270 timeHourComboSelector = new javax.swing.JComboBox<>(); 271 jLabel1 = new javax.swing.JLabel(); 272 jLabel2 = new javax.swing.JLabel(); 273 jLabel3 = new javax.swing.JLabel(); 180 274 editorMenuBar = new javax.swing.JMenuBar(); 181 275 menuEvaluations = new javax.swing.JMenu(); … … 200 294 Witness = new javax.swing.JMenuItem(); 201 295 202 setDefaultCloseOperation(javax.swing.WindowConstants.D ISPOSE_ON_CLOSE);296 setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE); 203 297 setTitle("Event Editor"); 204 298 … … 207 301 bottomFramePanelLayout.setHorizontalGroup( 208 302 bottomFramePanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) 209 .add(0, 613, Short.MAX_VALUE)303 .add(0, 70, Short.MAX_VALUE) 210 304 ); 211 305 bottomFramePanelLayout.setVerticalGroup( 212 306 bottomFramePanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) 213 .add(0, 34, Short.MAX_VALUE)307 .add(0, 45, Short.MAX_VALUE) 214 308 ); 215 309 216 310 txtEventStart.setText("00:00:00"); 311 txtEventStart.addActionListener(new java.awt.event.ActionListener() { 312 public void actionPerformed(java.awt.event.ActionEvent evt) { 313 txtEventStartActionPerformed(evt); 314 } 315 }); 316 317 saveCloseBtn.setText("Save and Close"); 318 saveCloseBtn.addActionListener(new java.awt.event.ActionListener() { 319 public void actionPerformed(java.awt.event.ActionEvent evt) { 320 saveCloseBtnActionPerformed(evt); 321 } 322 }); 217 323 218 324 btnRemoveCurrentEvent.setText("Remove This Event"); 219 btnRemoveCurrentEvent.addActionListener(new java.awt.event.ActionListener() 220 { 221 public void actionPerformed(java.awt.event.ActionEvent evt) 222 { 325 btnRemoveCurrentEvent.addActionListener(new java.awt.event.ActionListener() { 326 public void actionPerformed(java.awt.event.ActionEvent evt) { 223 327 btnRemoveCurrentEventActionPerformed(evt); 224 328 } 225 329 }); 330 331 timeSecondComboSelector.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Second" })); 332 timeSecondComboSelector.addActionListener(new java.awt.event.ActionListener() { 333 public void actionPerformed(java.awt.event.ActionEvent evt) { 334 timeSecondComboSelectorActionPerformed(evt); 335 } 336 }); 337 338 timeMinuteComboSelector.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Minute" })); 339 timeMinuteComboSelector.addActionListener(new java.awt.event.ActionListener() { 340 public void actionPerformed(java.awt.event.ActionEvent evt) { 341 timeMinuteComboSelectorActionPerformed(evt); 342 } 343 }); 344 345 timeHourComboSelector.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Hour" })); 346 347 jLabel1.setText("Hour"); 348 349 jLabel2.setText("Minute"); 350 351 jLabel3.setText("Second"); 226 352 227 353 menuEvaluations.setText("Evaluations"); … … 230 356 ATMS.setText("ATMS"); 231 357 ATMS.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/ATMSEval.png"))); // NOI18N 232 ATMS.addActionListener(new java.awt.event.ActionListener() 233 { 234 public void actionPerformed(java.awt.event.ActionEvent evt) 235 { 358 ATMS.addActionListener(new java.awt.event.ActionListener() { 359 public void actionPerformed(java.awt.event.ActionEvent evt) { 236 360 multipleChange(evt); 237 361 } … … 242 366 ActivityLog.setText("Activity Log"); 243 367 ActivityLog.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/ActivityLogEval.png"))); // NOI18N 244 ActivityLog.addActionListener(new java.awt.event.ActionListener() 245 { 246 public void actionPerformed(java.awt.event.ActionEvent evt) 247 { 368 ActivityLog.addActionListener(new java.awt.event.ActionListener() { 369 public void actionPerformed(java.awt.event.ActionEvent evt) { 248 370 multipleChange(evt); 249 371 } … … 254 376 CAD.setText("CAD"); 255 377 CAD.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/CADEval.png"))); // NOI18N 256 CAD.addActionListener(new java.awt.event.ActionListener() 257 { 258 public void actionPerformed(java.awt.event.ActionEvent evt) 259 { 378 CAD.addActionListener(new java.awt.event.ActionListener() { 379 public void actionPerformed(java.awt.event.ActionEvent evt) { 260 380 multipleChange(evt); 261 381 } … … 266 386 CMS.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/CMSEval.png"))); // NOI18N 267 387 CMS.setText("CMS"); 268 CMS.addMouseListener(new java.awt.event.MouseAdapter() 269 { 270 public void mouseClicked(java.awt.event.MouseEvent evt) 271 { 388 CMS.addMouseListener(new java.awt.event.MouseAdapter() { 389 public void mouseClicked(java.awt.event.MouseEvent evt) { 272 390 multipleChangeListener(evt); 273 391 } 274 392 }); 275 CMS.addActionListener(new java.awt.event.ActionListener() 276 { 277 public void actionPerformed(java.awt.event.ActionEvent evt) 278 { 393 CMS.addActionListener(new java.awt.event.ActionListener() { 394 public void actionPerformed(java.awt.event.ActionEvent evt) { 279 395 multipleChange(evt); 280 396 } … … 285 401 Facilitator.setText("Facilitator"); 286 402 Facilitator.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/FacilitatorEval.png"))); // NOI18N 287 Facilitator.addActionListener(new java.awt.event.ActionListener() 288 { 289 public void actionPerformed(java.awt.event.ActionEvent evt) 290 { 403 Facilitator.addActionListener(new java.awt.event.ActionListener() { 404 public void actionPerformed(java.awt.event.ActionEvent evt) { 291 405 optionalChange(evt); 292 406 } … … 297 411 Radio.setText("Radio"); 298 412 Radio.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/RadioEval.png"))); // NOI18N 299 Radio.addActionListener(new java.awt.event.ActionListener() 300 { 301 public void actionPerformed(java.awt.event.ActionEvent evt) 302 { 413 Radio.addActionListener(new java.awt.event.ActionListener() { 414 public void actionPerformed(java.awt.event.ActionEvent evt) { 303 415 optionalChange(evt); 304 416 } … … 313 425 MaintenanceRadio.setText("Maintenance Radio"); 314 426 MaintenanceRadio.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/MaintenanceRadio.png"))); // NOI18N 315 MaintenanceRadio.addActionListener(new java.awt.event.ActionListener() 316 { 317 public void actionPerformed(java.awt.event.ActionEvent evt) 318 { 427 MaintenanceRadio.addActionListener(new java.awt.event.ActionListener() { 428 public void actionPerformed(java.awt.event.ActionEvent evt) { 319 429 optionalChange(evt); 320 430 } … … 325 435 TMTRadio.setText("TMT Radio"); 326 436 TMTRadio.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/TMTRadio.png"))); // NOI18N 327 TMTRadio.addActionListener(new java.awt.event.ActionListener() 328 { 329 public void actionPerformed(java.awt.event.ActionEvent evt) 330 { 437 TMTRadio.addActionListener(new java.awt.event.ActionListener() { 438 public void actionPerformed(java.awt.event.ActionEvent evt) { 331 439 optionalChange(evt); 332 440 } … … 337 445 Telephone.setText("Telephone"); 338 446 Telephone.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Telephone.png"))); // NOI18N 339 Telephone.addActionListener(new java.awt.event.ActionListener() 340 { 341 public void actionPerformed(java.awt.event.ActionEvent evt) 342 { 447 Telephone.addActionListener(new java.awt.event.ActionListener() { 448 public void actionPerformed(java.awt.event.ActionEvent evt) { 343 449 optionalChange(evt); 344 450 } … … 353 459 Audio.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Audio.png"))); // NOI18N 354 460 Audio.setText("Audio"); 355 Audio.addActionListener(new java.awt.event.ActionListener() 356 { 357 public void actionPerformed(java.awt.event.ActionEvent evt) 358 { 461 Audio.addActionListener(new java.awt.event.ActionListener() { 462 public void actionPerformed(java.awt.event.ActionEvent evt) { 359 463 AudioActionPerformed(evt); 360 464 } … … 375 479 CHPRadio.setText("CHP Radio"); 376 480 CHPRadio.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/CHPRadio.png"))); // NOI18N 377 CHPRadio.addActionListener(new java.awt.event.ActionListener() 378 { 379 public void actionPerformed(java.awt.event.ActionEvent evt) 380 { 481 CHPRadio.addActionListener(new java.awt.event.ActionListener() { 482 public void actionPerformed(java.awt.event.ActionEvent evt) { 381 483 optionalChange(evt); 382 484 } … … 417 519 .add(txtEventStart, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) 418 520 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 521 .add(jLabel1) 522 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 523 .add(timeHourComboSelector, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) 524 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 525 .add(jLabel2) 526 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 527 .add(timeMinuteComboSelector, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) 528 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 529 .add(jLabel3) 530 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 531 .add(timeSecondComboSelector, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) 532 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 419 533 .add(bottomFramePanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 420 534 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 421 535 .add(btnRemoveCurrentEvent, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 226, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) 536 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 537 .add(saveCloseBtn) 422 538 .addContainerGap()) 423 539 ); … … 426 542 .add(layout.createSequentialGroup() 427 543 .addContainerGap() 428 .add(eventTabsPane, org.jdesktop.layout.GroupLayout. DEFAULT_SIZE, 534, Short.MAX_VALUE)544 .add(eventTabsPane, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 523, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) 429 545 .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 430 546 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) 431 547 .add(bottomFramePanel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) 432 .add(txtEventStart, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) 433 .add(btnRemoveCurrentEvent))) 548 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) 549 .add(txtEventStart, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) 550 .add(timeSecondComboSelector, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) 551 .add(timeMinuteComboSelector, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) 552 .add(timeHourComboSelector, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) 553 .add(jLabel1) 554 .add(jLabel2) 555 .add(jLabel3)) 556 .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE) 557 .add(saveCloseBtn) 558 .add(btnRemoveCurrentEvent)))) 434 559 ); 435 560 … … 471 596 }//GEN-LAST:event_AudioActionPerformed 472 597 598 private void saveCloseBtnActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_saveCloseBtnActionPerformed 599 // TODO add your handling code here: 600 //closes the current frame 601 602 //updateEventTime(); 603 if(!txtEventStart.getText().equals("")) 604 { 605 updateEventTime(); 606 } 607 model.closePanels(); 608 closeWindow(); 609 //this.dispatchEvent(new WindowEvent(this,WindowEvent.WINDOW_CLOSING)); 610 }//GEN-LAST:event_saveCloseBtnActionPerformed 611 612 private void timeSecondComboSelectorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_timeSecondComboSelectorActionPerformed 613 // TODO add your handling code here: 614 }//GEN-LAST:event_timeSecondComboSelectorActionPerformed 615 616 private void timeMinuteComboSelectorActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_timeMinuteComboSelectorActionPerformed 617 // TODO add your handling code here: 618 }//GEN-LAST:event_timeMinuteComboSelectorActionPerformed 619 620 private void txtEventStartActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtEventStartActionPerformed 621 // TODO add your handling code here: 622 }//GEN-LAST:event_txtEventStartActionPerformed 623 473 624 private void updateEventTime() 474 625 { 475 String[] tokens = txtEventStart.getText().split(":"); 476 477 int hrs = Integer.parseInt(tokens[0]); 478 int mins = Integer.parseInt(tokens[1]); 479 int secs = Integer.parseInt(tokens[2]); 626 627 // String[] tokens = txtEventStart.getText().split(":"); 628 // 629 // int hrs = Integer.parseInt(tokens[0]); 630 // int mins = Integer.parseInt(tokens[1]); 631 // int secs = Integer.parseInt(tokens[2]); 632 int hrs = Integer.parseInt(timeHourComboSelector.getSelectedItem().toString()); 633 int mins = Integer.parseInt(timeMinuteComboSelector.getSelectedItem().toString()); 634 int secs = Integer.parseInt(timeSecondComboSelector.getSelectedItem().toString()); 635 480 636 481 637 int newTime = (3600 * hrs) + (60 * mins) + secs; … … 493 649 494 650 } 495 SimpleDateFormat df = new SimpleDateFormat("HH:mm:ss");496 df.setTimeZone(TimeZone.getTimeZone("GMT"));497 String eventTime = df.format(new Date(slice.getTime() * 1000));498 txtEventStart.setText(eventTime);651 // SimpleDateFormat df = new SimpleDateFormat("HH:mm:ss"); 652 // df.setTimeZone(TimeZone.getTimeZone("GMT")); 653 // String eventTime = df.format(new Date(slice.getTime() * 1000)); 654 // txtEventStart.setText(eventTime); 499 655 } 500 656 } … … 538 694 private javax.swing.JMenuBar editorMenuBar; 539 695 private javax.swing.JTabbedPane eventTabsPane; 696 private javax.swing.JLabel jLabel1; 697 private javax.swing.JLabel jLabel2; 698 private javax.swing.JLabel jLabel3; 540 699 private javax.swing.JMenu menuAutoData; 541 700 private javax.swing.JMenu menuEvaluations; 542 701 private javax.swing.JMenu menuInstructor; 702 private javax.swing.JButton saveCloseBtn; 703 private javax.swing.JComboBox<String> timeHourComboSelector; 704 private javax.swing.JComboBox<String> timeMinuteComboSelector; 705 private javax.swing.JComboBox<String> timeSecondComboSelector; 543 706 private javax.swing.JTextField txtEventStart; 544 707 // End of variables declaration//GEN-END:variables -
trunk/src/event/editor/frame/PropertyModel.java
r134 r145 70 70 try 71 71 { 72 //todo: this is where there are problems with initializing the unit window 72 73 JPanel panel = (JPanel) classMap.get(property).newInstance(); 73 74 … … 82 83 { 83 84 System.err.println("Could not create panel of type \"" + property + "\""); 84 } 85 } 85 86 } 86 87
Note: See TracChangeset
for help on using the changeset viewer.
