- Timestamp:
- 02/10/2019 06:43:12 AM (7 years ago)
- Location:
- trunk/src/atmsdriver/trafficeventseditor
- Files:
-
- 2 edited
-
TrafficEventsEditor.form (modified) (3 diffs)
-
TrafficEventsEditor.java (modified) (8 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/atmsdriver/trafficeventseditor/TrafficEventsEditor.form
r247 r253 898 898 <EmptySpace pref="28" max="32767" attributes="0"/> 899 899 <Group type="103" groupAlignment="1" max="-2" attributes="0"> 900 <Component id=" jButton2" max="32767" attributes="0"/>900 <Component id="btnSave" max="32767" attributes="0"/> 901 901 <Component id="jButton1" max="32767" attributes="0"/> 902 902 <Component id="jButton3" alignment="0" max="32767" attributes="0"/> … … 912 912 <Component id="jButton1" min="-2" max="-2" attributes="0"/> 913 913 <EmptySpace max="-2" attributes="0"/> 914 <Component id=" jButton2" min="-2" max="-2" attributes="0"/>914 <Component id="btnSave" min="-2" max="-2" attributes="0"/> 915 915 <EmptySpace max="-2" attributes="0"/> 916 916 <Component id="jButton3" min="-2" max="-2" attributes="0"/> … … 926 926 </Properties> 927 927 </Component> 928 <Component class="javax.swing.JButton" name=" jButton2">928 <Component class="javax.swing.JButton" name="btnSave"> 929 929 <Properties> 930 930 <Property name="text" type="java.lang.String" value="Save Script"/> 931 931 </Properties> 932 <Events> 933 <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnSaveActionPerformed"/> 934 </Events> 932 935 </Component> 933 936 <Component class="javax.swing.JButton" name="jButton3"> -
trunk/src/atmsdriver/trafficeventseditor/TrafficEventsEditor.java
r247 r253 10 10 import atmsdriver.model.LoopDetector.DOTCOLOR; 11 11 import atmsdriver.model.Station; 12 import java.io.File; 12 13 import java.util.ArrayList; 13 14 import java.util.Enumeration; … … 19 20 import javax.swing.DefaultListSelectionModel; 20 21 import javax.swing.JComboBox; 22 import javax.swing.JFileChooser; 21 23 import javax.swing.JList; 22 24 import javax.swing.JOptionPane; … … 398 400 jPanel14 = new javax.swing.JPanel(); 399 401 jButton1 = new javax.swing.JButton(); 400 jButton2= new javax.swing.JButton();402 btnSave = new javax.swing.JButton(); 401 403 jButton3 = new javax.swing.JButton(); 402 404 … … 895 897 jButton1.setText("Load Script"); 896 898 897 jButton2.setText("Save Script"); 899 btnSave.setText("Save Script"); 900 btnSave.addActionListener(new java.awt.event.ActionListener() 901 { 902 public void actionPerformed(java.awt.event.ActionEvent evt) 903 { 904 btnSaveActionPerformed(evt); 905 } 906 }); 898 907 899 908 jButton3.setText("Save Script As"); … … 906 915 .addContainerGap(28, Short.MAX_VALUE) 907 916 .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false) 908 .addComponent( jButton2, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)917 .addComponent(btnSave, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 909 918 .addComponent(jButton1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 910 919 .addComponent(jButton3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) … … 917 926 .addComponent(jButton1) 918 927 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 919 .addComponent( jButton2)928 .addComponent(btnSave) 920 929 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 921 930 .addComponent(jButton3) … … 1040 1049 timeFrames.cumulativePreviewHighways(); 1041 1050 }//GEN-LAST:event_CumulativeHighwaysPreviewButtonActionPerformed 1051 1052 /** 1053 * Shows the dialog for choosing a file to save the script data to. 1054 * @author jdalbey 1055 */ 1056 private void btnSaveActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_btnSaveActionPerformed 1057 {//GEN-HEADEREND:event_btnSaveActionPerformed 1058 boolean saved = false; 1059 JFileChooser chooser = new JFileChooser("."); 1060 int choice = chooser.showSaveDialog(chooser); 1061 if (choice == JFileChooser.APPROVE_OPTION) 1062 { 1063 File selectedFile = chooser.getSelectedFile(); 1064 //TODO: Save the script to the selected file 1065 JOptionPane.showMessageDialog(null, "Saving Not Implemented Yet"); 1066 } 1067 // return choice == JFileChooser.APPROVE_OPTION && saved; 1068 }//GEN-LAST:event_btnSaveActionPerformed 1042 1069 1043 1070 private DOTCOLOR getDotColorFromText(String text) … … 1142 1169 private javax.swing.JTable TrafficLaneEventsTable; 1143 1170 private javax.swing.JRadioButton YellowButton; 1171 private javax.swing.JButton btnSave; 1144 1172 private javax.swing.ButtonGroup colorRadioButtons; 1145 1173 private javax.swing.JButton jButton1; 1146 private javax.swing.JButton jButton2;1147 1174 private javax.swing.JButton jButton3; 1148 1175 private javax.swing.JLabel jLabel1;
Note: See TracChangeset
for help on using the changeset viewer.
