Changeset 145 in tmcsimulator-scriptbuilder for trunk/src/event/editor/frame


Ignore:
Timestamp:
11/04/2019 08:14:32 AM (6 years ago)
Author:
sdanthin
Message:

Move from Git to Svn (LARGE COMMIT)

Location:
trunk/src/event/editor/frame
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/event/editor/frame/Editor.form

    r134 r145  
    251251  </NonVisualComponents> 
    252252  <Properties> 
    253     <Property name="defaultCloseOperation" type="int" value="2"/> 
     253    <Property name="defaultCloseOperation" type="int" value="0"/> 
    254254    <Property name="title" type="java.lang.String" value="Event Editor"/> 
    255255  </Properties> 
     
    279279              <Component id="txtEventStart" min="-2" max="-2" attributes="0"/> 
    280280              <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"/> 
    281293              <Component id="bottomFramePanel" max="32767" attributes="0"/> 
    282294              <EmptySpace max="-2" attributes="0"/> 
    283295              <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"/> 
    284298              <EmptySpace max="-2" attributes="0"/> 
    285299          </Group> 
     
    290304          <Group type="102" alignment="0" attributes="0"> 
    291305              <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"/> 
    293307              <EmptySpace max="-2" attributes="0"/> 
    294308              <Group type="103" groupAlignment="0" attributes="0"> 
    295309                  <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> 
    298323              </Group> 
    299324          </Group> 
     
    311336        <DimensionLayout dim="0"> 
    312337          <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"/> 
    314339          </Group> 
    315340        </DimensionLayout> 
    316341        <DimensionLayout dim="1"> 
    317342          <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"/> 
    319344          </Group> 
    320345        </DimensionLayout> 
     
    325350        <Property name="text" type="java.lang.String" value="00:00:00"/> 
    326351      </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> 
    327363    </Component> 
    328364    <Component class="javax.swing.JButton" name="btnRemoveCurrentEvent"> 
     
    334370      </Events> 
    335371    </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="&lt;String&gt;"/> 
     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="&lt;String&gt;"/> 
     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="&lt;String&gt;"/> 
     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> 
    336429  </SubComponents> 
    337430</Form> 
  • trunk/src/event/editor/frame/Editor.java

    r134 r145  
    1111import scriptbuilder.gui.IncidentEditorFrame; 
    1212import scriptbuilder.gui.ScriptBuilderFrame; 
     13import scriptbuilder.gui.ScriptBuilderGuiConstants; 
    1314import scriptbuilder.gui.panels.IncidentTimelinePanel; 
    1415import scriptbuilder.structures.ScriptEvent; 
     
    3233        model.addEventPanel(property, se); 
    3334    } 
    34  
     35    /** 
     36     * adds all of the events from the timeslice to the incidentTimelinePanel 
     37     * @param ts the timeslice to be added 
     38     */ 
    3539    public void setSlice(TimeSlice ts) 
    3640    { 
     
    4246            for (I_ScriptEvent se : slice.events) 
    4347            { 
    44  
     48                 
    4549                this.addEvent(IncidentTimelinePanel.eventTypeToPropertyMap.get(se.getScriptEventType()), se); 
    4650 
     
    5256            System.out.println("[" + eventTime + "]"); 
    5357            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); 
    5467        } 
    5568 
    5669    } 
     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     
    57120 
    58121    private ActionListener optionalChangeListener = new ActionListener() 
     
    123186 
    124187        } 
    125  
     188        //this eventTime might need to be initialized to the correct time 
    126189        String eventTime = ""; 
    127190 
     
    159222                //If we deleted the first event(s), this will add the offsets, 
    160223                //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(); 
    164252    } 
    165253 
     
    171259    @SuppressWarnings("unchecked") 
    172260    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents 
    173     private void initComponents() 
    174     { 
     261    private void initComponents() { 
    175262 
    176263        eventTabsPane = new javax.swing.JTabbedPane(); 
    177264        bottomFramePanel = new javax.swing.JPanel(); 
    178265        txtEventStart = new javax.swing.JTextField(); 
     266        saveCloseBtn = new javax.swing.JButton(); 
    179267        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(); 
    180274        editorMenuBar = new javax.swing.JMenuBar(); 
    181275        menuEvaluations = new javax.swing.JMenu(); 
     
    200294        Witness = new javax.swing.JMenuItem(); 
    201295 
    202         setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); 
     296        setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE); 
    203297        setTitle("Event Editor"); 
    204298 
     
    207301        bottomFramePanelLayout.setHorizontalGroup( 
    208302            bottomFramePanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) 
    209             .add(0, 613, Short.MAX_VALUE) 
     303            .add(0, 70, Short.MAX_VALUE) 
    210304        ); 
    211305        bottomFramePanelLayout.setVerticalGroup( 
    212306            bottomFramePanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) 
    213             .add(0, 34, Short.MAX_VALUE) 
     307            .add(0, 45, Short.MAX_VALUE) 
    214308        ); 
    215309 
    216310        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        }); 
    217323 
    218324        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) { 
    223327                btnRemoveCurrentEventActionPerformed(evt); 
    224328            } 
    225329        }); 
     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"); 
    226352 
    227353        menuEvaluations.setText("Evaluations"); 
     
    230356        ATMS.setText("ATMS"); 
    231357        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) { 
    236360                multipleChange(evt); 
    237361            } 
     
    242366        ActivityLog.setText("Activity Log"); 
    243367        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) { 
    248370                multipleChange(evt); 
    249371            } 
     
    254376        CAD.setText("CAD"); 
    255377        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) { 
    260380                multipleChange(evt); 
    261381            } 
     
    266386        CMS.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/CMSEval.png"))); // NOI18N 
    267387        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) { 
    272390                multipleChangeListener(evt); 
    273391            } 
    274392        }); 
    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) { 
    279395                multipleChange(evt); 
    280396            } 
     
    285401        Facilitator.setText("Facilitator"); 
    286402        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) { 
    291405                optionalChange(evt); 
    292406            } 
     
    297411        Radio.setText("Radio"); 
    298412        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) { 
    303415                optionalChange(evt); 
    304416            } 
     
    313425        MaintenanceRadio.setText("Maintenance Radio"); 
    314426        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) { 
    319429                optionalChange(evt); 
    320430            } 
     
    325435        TMTRadio.setText("TMT Radio"); 
    326436        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) { 
    331439                optionalChange(evt); 
    332440            } 
     
    337445        Telephone.setText("Telephone"); 
    338446        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) { 
    343449                optionalChange(evt); 
    344450            } 
     
    353459        Audio.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Audio.png"))); // NOI18N 
    354460        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) { 
    359463                AudioActionPerformed(evt); 
    360464            } 
     
    375479        CHPRadio.setText("CHP Radio"); 
    376480        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) { 
    381483                optionalChange(evt); 
    382484            } 
     
    417519                .add(txtEventStart, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) 
    418520                .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) 
    419533                .add(bottomFramePanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 
    420534                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 
    421535                .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) 
    422538                .addContainerGap()) 
    423539        ); 
     
    426542            .add(layout.createSequentialGroup() 
    427543                .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) 
    429545                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 
    430546                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) 
    431547                    .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)))) 
    434559        ); 
    435560 
     
    471596    }//GEN-LAST:event_AudioActionPerformed 
    472597 
     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 
    473624    private void updateEventTime() 
    474625    { 
    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         
    480636 
    481637        int newTime = (3600 * hrs) + (60 * mins) + secs; 
     
    493649 
    494650            } 
    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); 
    499655        } 
    500656    } 
     
    538694    private javax.swing.JMenuBar editorMenuBar; 
    539695    private javax.swing.JTabbedPane eventTabsPane; 
     696    private javax.swing.JLabel jLabel1; 
     697    private javax.swing.JLabel jLabel2; 
     698    private javax.swing.JLabel jLabel3; 
    540699    private javax.swing.JMenu menuAutoData; 
    541700    private javax.swing.JMenu menuEvaluations; 
    542701    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; 
    543706    private javax.swing.JTextField txtEventStart; 
    544707    // End of variables declaration//GEN-END:variables 
  • trunk/src/event/editor/frame/PropertyModel.java

    r134 r145  
    7070        try 
    7171        { 
     72            //todo: this is where there are problems with initializing the unit window 
    7273            JPanel panel = (JPanel) classMap.get(property).newInstance(); 
    7374 
     
    8283        { 
    8384            System.err.println("Could not create panel of type \"" + property + "\""); 
    84         } 
     85        }             
    8586    } 
    8687     
Note: See TracChangeset for help on using the changeset viewer.