Changeset 119 in tmcsimulator-scriptbuilder for trunk/src/event/editor


Ignore:
Timestamp:
09/13/2017 12:30:19 PM (9 years ago)
Author:
bmcguffin
Message:

Fixed a bug which caused an event to be destroyed if it was the only event in its incident and the user attempted to change its start time. (See  http://git.tokomak.net:8888/ticket/20 for more details.)

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

Legend:

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

    r101 r119  
    33<Form version="1.3" maxVersion="1.7" type="org.netbeans.modules.form.forminfo.JFrameFormInfo"> 
    44  <NonVisualComponents> 
    5     <Container class="javax.swing.JPanel" name="jPanel1"> 
    6  
    7       <Layout> 
    8         <DimensionLayout dim="0"> 
    9           <Group type="103" groupAlignment="0" attributes="0"> 
    10               <EmptySpace min="0" pref="100" max="32767" attributes="0"/> 
    11           </Group> 
    12         </DimensionLayout> 
    13         <DimensionLayout dim="1"> 
    14           <Group type="103" groupAlignment="0" attributes="0"> 
    15               <EmptySpace min="0" pref="100" max="32767" attributes="0"/> 
    16           </Group> 
    17         </DimensionLayout> 
    18       </Layout> 
    19     </Container> 
    20     <Menu class="javax.swing.JMenuBar" name="jMenuBar1"> 
     5    <Menu class="javax.swing.JMenuBar" name="editorMenuBar"> 
    216      <SubComponents> 
    22         <Menu class="javax.swing.JMenu" name="jMenu1"> 
     7        <Menu class="javax.swing.JMenu" name="menuEvaluations"> 
    238          <Properties> 
    249            <Property name="text" type="java.lang.String" value="Evaluations"/> 
     
    11297          </SubComponents> 
    11398        </Menu> 
    114         <Menu class="javax.swing.JMenu" name="JMenu2"> 
     99        <Menu class="javax.swing.JMenu" name="menuInstructor"> 
    115100          <Properties> 
    116101            <Property name="text" type="java.lang.String" value="Instructor Actions"/> 
     
    161146          </SubComponents> 
    162147        </Menu> 
    163         <Menu class="javax.swing.JMenu" name="jMenu3"> 
     148        <Menu class="javax.swing.JMenu" name="menuAutoData"> 
    164149          <Properties> 
    165150            <Property name="text" type="java.lang.String" value="Automated Data"/> 
     
    267252  </Properties> 
    268253  <SyntheticProperties> 
    269     <SyntheticProperty name="menuBar" type="java.lang.String" value="jMenuBar1"/> 
     254    <SyntheticProperty name="menuBar" type="java.lang.String" value="editorMenuBar"/> 
    270255    <SyntheticProperty name="formSizePolicy" type="int" value="1"/> 
    271256    <SyntheticProperty name="generateCenter" type="boolean" value="false"/> 
     
    286271    <DimensionLayout dim="0"> 
    287272      <Group type="103" groupAlignment="0" attributes="0"> 
    288           <Component id="jTabbedPane1" alignment="1" max="32767" attributes="0"/> 
     273          <Component id="eventTabsPane" alignment="1" max="32767" attributes="0"/> 
    289274          <Group type="102" alignment="0" attributes="0"> 
    290275              <EmptySpace max="-2" attributes="0"/> 
    291276              <Component id="txtEventStart" min="-2" max="-2" attributes="0"/> 
    292277              <EmptySpace max="-2" attributes="0"/> 
    293               <Component id="jPanel2" max="32767" attributes="0"/> 
     278              <Component id="bottomFramePanel" max="32767" attributes="0"/> 
    294279              <EmptySpace max="-2" attributes="0"/> 
    295280              <Component id="btnRemoveCurrentEvent" min="-2" pref="226" max="-2" attributes="0"/> 
     
    302287          <Group type="102" alignment="0" attributes="0"> 
    303288              <EmptySpace max="-2" attributes="0"/> 
    304               <Component id="jTabbedPane1" pref="534" max="32767" attributes="0"/> 
     289              <Component id="eventTabsPane" pref="534" max="32767" attributes="0"/> 
    305290              <EmptySpace max="-2" attributes="0"/> 
    306291              <Group type="103" groupAlignment="0" attributes="0"> 
    307                   <Component id="jPanel2" min="-2" max="-2" attributes="0"/> 
     292                  <Component id="bottomFramePanel" min="-2" max="-2" attributes="0"/> 
    308293                  <Component id="txtEventStart" min="-2" max="-2" attributes="0"/> 
    309294                  <Component id="btnRemoveCurrentEvent" min="-2" max="-2" attributes="0"/> 
     
    314299  </Layout> 
    315300  <SubComponents> 
    316     <Container class="javax.swing.JTabbedPane" name="jTabbedPane1"> 
     301    <Container class="javax.swing.JTabbedPane" name="eventTabsPane"> 
    317302 
    318303      <Layout class="org.netbeans.modules.form.compat2.layouts.support.JTabbedPaneSupportLayout"/> 
    319304    </Container> 
    320     <Container class="javax.swing.JPanel" name="jPanel2"> 
     305    <Container class="javax.swing.JPanel" name="bottomFramePanel"> 
    321306 
    322307      <Layout> 
  • trunk/src/event/editor/frame/Editor.java

    r102 r119  
    100100 
    101101        // For each menu 
    102         for (int menuCtr = 0; menuCtr < jMenuBar1.getMenuCount(); menuCtr++) 
     102        for (int menuCtr = 0; menuCtr < editorMenuBar.getMenuCount(); menuCtr++) 
    103103        { 
    104104            // for each menu item 
    105             for (java.awt.Component comp : jMenuBar1.getMenu(menuCtr).getMenuComponents()) 
     105            for (java.awt.Component comp : editorMenuBar.getMenu(menuCtr).getMenuComponents()) 
    106106            { 
    107107                JMenuItem item = (JMenuItem) comp; 
     
    164164    { 
    165165 
    166         jPanel1 = new javax.swing.JPanel(); 
    167         jTabbedPane1 = new javax.swing.JTabbedPane(); 
    168         jPanel2 = new javax.swing.JPanel(); 
     166        eventTabsPane = new javax.swing.JTabbedPane(); 
     167        bottomFramePanel = new javax.swing.JPanel(); 
    169168        txtEventStart = new javax.swing.JTextField(); 
    170169        btnRemoveCurrentEvent = new javax.swing.JButton(); 
    171         jMenuBar1 = new javax.swing.JMenuBar(); 
    172         jMenu1 = new javax.swing.JMenu(); 
     170        editorMenuBar = new javax.swing.JMenuBar(); 
     171        menuEvaluations = new javax.swing.JMenu(); 
    173172        ATMS = new javax.swing.JCheckBoxMenuItem(); 
    174173        ActivityLog = new javax.swing.JCheckBoxMenuItem(); 
     
    177176        Facilitator = new javax.swing.JCheckBoxMenuItem(); 
    178177        Radio = new javax.swing.JCheckBoxMenuItem(); 
    179         JMenu2 = new javax.swing.JMenu(); 
     178        menuInstructor = new javax.swing.JMenu(); 
    180179        MaintenanceRadio = new javax.swing.JCheckBoxMenuItem(); 
    181180        TMTRadio = new javax.swing.JCheckBoxMenuItem(); 
    182181        Telephone = new javax.swing.JCheckBoxMenuItem(); 
    183         jMenu3 = new javax.swing.JMenu(); 
     182        menuAutoData = new javax.swing.JMenu(); 
    184183        Audio = new javax.swing.JMenuItem(); 
    185184        CADLog = new javax.swing.JMenuItem(); 
     
    191190        Witness = new javax.swing.JMenuItem(); 
    192191 
    193         org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1); 
    194         jPanel1.setLayout(jPanel1Layout); 
    195         jPanel1Layout.setHorizontalGroup( 
    196             jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) 
    197             .add(0, 100, Short.MAX_VALUE) 
    198         ); 
    199         jPanel1Layout.setVerticalGroup( 
    200             jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) 
    201             .add(0, 100, Short.MAX_VALUE) 
    202         ); 
    203  
    204192        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE); 
    205193        setTitle("Event Editor"); 
    206194 
    207         org.jdesktop.layout.GroupLayout jPanel2Layout = new org.jdesktop.layout.GroupLayout(jPanel2); 
    208         jPanel2.setLayout(jPanel2Layout); 
    209         jPanel2Layout.setHorizontalGroup( 
    210             jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) 
     195        org.jdesktop.layout.GroupLayout bottomFramePanelLayout = new org.jdesktop.layout.GroupLayout(bottomFramePanel); 
     196        bottomFramePanel.setLayout(bottomFramePanelLayout); 
     197        bottomFramePanelLayout.setHorizontalGroup( 
     198            bottomFramePanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) 
    211199            .add(0, 613, Short.MAX_VALUE) 
    212200        ); 
    213         jPanel2Layout.setVerticalGroup( 
    214             jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) 
     201        bottomFramePanelLayout.setVerticalGroup( 
     202            bottomFramePanelLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) 
    215203            .add(0, 34, Short.MAX_VALUE) 
    216204        ); 
     
    227215        }); 
    228216 
    229         jMenu1.setText("Evaluations"); 
     217        menuEvaluations.setText("Evaluations"); 
    230218 
    231219        ATMS.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_A, java.awt.event.InputEvent.CTRL_MASK)); 
     
    239227            } 
    240228        }); 
    241         jMenu1.add(ATMS); 
     229        menuEvaluations.add(ATMS); 
    242230 
    243231        ActivityLog.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_A, java.awt.event.InputEvent.ALT_MASK)); 
     
    251239            } 
    252240        }); 
    253         jMenu1.add(ActivityLog); 
     241        menuEvaluations.add(ActivityLog); 
    254242 
    255243        CAD.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_C, java.awt.event.InputEvent.ALT_MASK)); 
     
    263251            } 
    264252        }); 
    265         jMenu1.add(CAD); 
     253        menuEvaluations.add(CAD); 
    266254 
    267255        CMS.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_C, java.awt.event.InputEvent.ALT_MASK | java.awt.event.InputEvent.CTRL_MASK)); 
     
    282270            } 
    283271        }); 
    284         jMenu1.add(CMS); 
     272        menuEvaluations.add(CMS); 
    285273 
    286274        Facilitator.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F, java.awt.event.InputEvent.CTRL_MASK)); 
     
    294282            } 
    295283        }); 
    296         jMenu1.add(Facilitator); 
     284        menuEvaluations.add(Facilitator); 
    297285 
    298286        Radio.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_R, java.awt.event.InputEvent.CTRL_MASK)); 
     
    306294            } 
    307295        }); 
    308         jMenu1.add(Radio); 
    309  
    310         jMenuBar1.add(jMenu1); 
    311  
    312         JMenu2.setText("Instructor Actions"); 
     296        menuEvaluations.add(Radio); 
     297 
     298        editorMenuBar.add(menuEvaluations); 
     299 
     300        menuInstructor.setText("Instructor Actions"); 
    313301 
    314302        MaintenanceRadio.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_M, java.awt.event.InputEvent.CTRL_MASK)); 
     
    322310            } 
    323311        }); 
    324         JMenu2.add(MaintenanceRadio); 
     312        menuInstructor.add(MaintenanceRadio); 
    325313 
    326314        TMTRadio.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_T, java.awt.event.InputEvent.ALT_MASK | java.awt.event.InputEvent.CTRL_MASK)); 
     
    334322            } 
    335323        }); 
    336         JMenu2.add(TMTRadio); 
     324        menuInstructor.add(TMTRadio); 
    337325 
    338326        Telephone.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_T, java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK)); 
     
    346334            } 
    347335        }); 
    348         JMenu2.add(Telephone); 
    349  
    350         jMenuBar1.add(JMenu2); 
    351  
    352         jMenu3.setText("Automated Data"); 
     336        menuInstructor.add(Telephone); 
     337 
     338        editorMenuBar.add(menuInstructor); 
     339 
     340        menuAutoData.setText("Automated Data"); 
    353341 
    354342        Audio.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_A, java.awt.event.InputEvent.CTRL_MASK)); 
    355343        Audio.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Audio.png"))); // NOI18N 
    356344        Audio.setText("Audio"); 
    357         jMenu3.add(Audio); 
     345        menuAutoData.add(Audio); 
    358346 
    359347        CADLog.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_C, java.awt.event.InputEvent.CTRL_MASK)); 
    360348        CADLog.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/CAD.png"))); // NOI18N 
    361349        CADLog.setText("CAD Log"); 
    362         jMenu3.add(CADLog); 
     350        menuAutoData.add(CADLog); 
    363351 
    364352        CCTV.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_V, java.awt.event.InputEvent.CTRL_MASK)); 
    365353        CCTV.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/CCTV.png"))); // NOI18N 
    366354        CCTV.setText("CCTV"); 
    367         jMenu3.add(CCTV); 
     355        menuAutoData.add(CCTV); 
    368356 
    369357        CHPRadio.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_C, java.awt.event.InputEvent.ALT_MASK)); 
     
    377365            } 
    378366        }); 
    379         jMenu3.add(CHPRadio); 
     367        menuAutoData.add(CHPRadio); 
    380368 
    381369        Paramics.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_P, java.awt.event.InputEvent.CTRL_MASK)); 
    382370        Paramics.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Paramics.png"))); // NOI18N 
    383371        Paramics.setText("Paramics"); 
    384         jMenu3.add(Paramics); 
     372        menuAutoData.add(Paramics); 
    385373 
    386374        Tow.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_T, java.awt.event.InputEvent.CTRL_MASK)); 
    387375        Tow.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Tow.png"))); // NOI18N 
    388376        Tow.setText("Tow"); 
    389         jMenu3.add(Tow); 
     377        menuAutoData.add(Tow); 
    390378 
    391379        Unit.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_U, java.awt.event.InputEvent.CTRL_MASK)); 
    392380        Unit.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Unit.png"))); // NOI18N 
    393381        Unit.setText("Unit"); 
    394         jMenu3.add(Unit); 
     382        menuAutoData.add(Unit); 
    395383 
    396384        Witness.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_W, java.awt.event.InputEvent.CTRL_MASK)); 
    397385        Witness.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Witness.png"))); // NOI18N 
    398386        Witness.setText("Witness"); 
    399         jMenu3.add(Witness); 
    400  
    401         jMenuBar1.add(jMenu3); 
    402  
    403         setJMenuBar(jMenuBar1); 
     387        menuAutoData.add(Witness); 
     388 
     389        editorMenuBar.add(menuAutoData); 
     390 
     391        setJMenuBar(editorMenuBar); 
    404392 
    405393        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane()); 
     
    407395        layout.setHorizontalGroup( 
    408396            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) 
    409             .add(org.jdesktop.layout.GroupLayout.TRAILING, jTabbedPane1) 
     397            .add(org.jdesktop.layout.GroupLayout.TRAILING, eventTabsPane) 
    410398            .add(layout.createSequentialGroup() 
    411399                .addContainerGap() 
    412400                .add(txtEventStart, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) 
    413401                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 
    414                 .add(jPanel2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 
     402                .add(bottomFramePanel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 
    415403                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 
    416404                .add(btnRemoveCurrentEvent, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 226, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) 
     
    421409            .add(layout.createSequentialGroup() 
    422410                .addContainerGap() 
    423                 .add(jTabbedPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 534, Short.MAX_VALUE) 
     411                .add(eventTabsPane, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 534, Short.MAX_VALUE) 
    424412                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED) 
    425413                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING) 
    426                     .add(jPanel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) 
     414                    .add(bottomFramePanel, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) 
    427415                    .add(txtEventStart, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE) 
    428416                    .add(btnRemoveCurrentEvent))) 
     
    447435    {//GEN-HEADEREND:event_btnRemoveCurrentEventActionPerformed 
    448436 
    449         int index = jTabbedPane1.getSelectedIndex(); 
    450  
    451         if (index >= 0 && jTabbedPane1.getTabComponentAt(index) != null) 
    452         { 
    453             JPanel removable = (JPanel) jTabbedPane1 
     437        int index = eventTabsPane.getSelectedIndex(); 
     438 
     439        if (index >= 0 && eventTabsPane.getTabComponentAt(index) != null) 
     440        { 
     441            JPanel removable = (JPanel) eventTabsPane 
    454442                    .getSelectedComponent(); 
    455             this.model.properties.removeProperty(removable); 
     443            PropertyPanel update = this.model.properties.removeProperty(removable); 
     444 
     445            ((I_ScriptEventEditorPanel) update.getPanel()).removeAssociatedEvent(); 
     446 
    456447        } 
    457448 
     
    466457        int secs = Integer.parseInt(tokens[2]); 
    467458 
    468         int time = (3600 * hrs) + (60 * mins) + secs; 
    469  
    470         int index = jTabbedPane1.getSelectedIndex(); 
    471  
    472         if (index >= 0 && jTabbedPane1.getTabComponentAt(index) != null) 
    473         { 
    474             JPanel removable = (JPanel) jTabbedPane1 
     459        int newTime = (3600 * hrs) + (60 * mins) + secs; 
     460 
     461        int index = eventTabsPane.getSelectedIndex(); 
     462 
     463        if (index >= 0 && eventTabsPane.getTabComponentAt(index) != null) 
     464        { 
     465            JPanel removable = (JPanel) eventTabsPane 
    475466                    .getSelectedComponent(); 
    476467            I_ScriptEvent ise = this.model.eventMap.get(removable); 
    477             if (time != slice.getTime()) 
    478             { 
    479                 System.out.println("New time = " + time); 
     468            if (newTime != slice.getTime() && incident.changeEventStart(ise, slice.getTime(), newTime)) 
     469            { 
    480470                this.model.properties.removeProperty(removable); 
    481                 incident.addNewEvent(ise, time); 
    482                 SimpleDateFormat df = new SimpleDateFormat("HH:mm:ss"); 
    483                 df.setTimeZone(TimeZone.getTimeZone("GMT")); 
    484                 String eventTime = df.format(new Date(slice.getTime() * 1000)); 
    485                 txtEventStart.setText(eventTime); 
    486             } 
     471 
     472            } 
     473            SimpleDateFormat df = new SimpleDateFormat("HH:mm:ss"); 
     474            df.setTimeZone(TimeZone.getTimeZone("GMT")); 
     475            String eventTime = df.format(new Date(slice.getTime() * 1000)); 
     476            txtEventStart.setText(eventTime); 
    487477        } 
    488478    } 
     
    514504    private javax.swing.JMenuItem CMS; 
    515505    private javax.swing.JCheckBoxMenuItem Facilitator; 
    516     private javax.swing.JMenu JMenu2; 
    517506    private javax.swing.JCheckBoxMenuItem MaintenanceRadio; 
    518507    private javax.swing.JMenuItem Paramics; 
     
    523512    private javax.swing.JMenuItem Unit; 
    524513    private javax.swing.JMenuItem Witness; 
     514    private javax.swing.JPanel bottomFramePanel; 
    525515    private javax.swing.JButton btnRemoveCurrentEvent; 
    526     private javax.swing.JMenu jMenu1; 
    527     private javax.swing.JMenu jMenu3; 
    528     private javax.swing.JMenuBar jMenuBar1; 
    529     private javax.swing.JPanel jPanel1; 
    530     private javax.swing.JPanel jPanel2; 
    531     private javax.swing.JTabbedPane jTabbedPane1; 
     516    private javax.swing.JMenuBar editorMenuBar; 
     517    private javax.swing.JTabbedPane eventTabsPane; 
     518    private javax.swing.JMenu menuAutoData; 
     519    private javax.swing.JMenu menuEvaluations; 
     520    private javax.swing.JMenu menuInstructor; 
    532521    private javax.swing.JTextField txtEventStart; 
    533522    // End of variables declaration//GEN-END:variables 
     
    552541        if (update.getType() == UpdateType.Add) 
    553542        { 
    554             jTabbedPane1.insertTab(null, null, 
     543            eventTabsPane.insertTab(null, null, 
    555544                    update.getPanel().getPanel(), null, update.getPosition()); 
    556             jTabbedPane1.setTabComponentAt(update.getPosition(), title); 
    557             jTabbedPane1.setSelectedIndex(update.getPosition()); 
     545            eventTabsPane.setTabComponentAt(update.getPosition(), title); 
     546            eventTabsPane.setSelectedIndex(update.getPosition()); 
    558547            topFrame.repaint(); 
    559548        } 
    560549        else if (update.getType() == UpdateType.Remove) 
    561550        { 
    562             jTabbedPane1.remove(update.getPanel().getPanel()); 
    563             if (update.getPanel().getPanel() instanceof I_ScriptEventEditorPanel) 
    564             { 
    565                 ((I_ScriptEventEditorPanel) update.getPanel().getPanel()).removeAssociatedEvent(); 
    566             } 
     551            eventTabsPane.remove(update.getPanel().getPanel()); 
    567552            topFrame.repaint(); 
    568553        } 
    569554        else if (update.getType() == UpdateType.TitleChange) 
    570555        { 
    571             final int index = jTabbedPane1.indexOfComponent( 
     556            final int index = eventTabsPane.indexOfComponent( 
    572557                    update.getPanel().getPanel()); 
    573558 
     
    576561                public void run() 
    577562                { 
    578                     Color c = jTabbedPane1.getForegroundAt(index); 
    579                     jTabbedPane1.setForegroundAt(index, Color.blue); 
     563                    Color c = eventTabsPane.getForegroundAt(index); 
     564                    eventTabsPane.setForegroundAt(index, Color.blue); 
    580565                    try 
    581566                    { 
     
    585570                    { 
    586571                    } 
    587                     if (index < jTabbedPane1.getTabCount()) 
     572                    if (index < eventTabsPane.getTabCount()) 
    588573                    { 
    589                         jTabbedPane1.setTabComponentAt(index, title); 
     574                        eventTabsPane.setTabComponentAt(index, title); 
    590575                    } 
    591576                    try 
     
    596581                    { 
    597582                    } 
    598                     if (index < jTabbedPane1.getTabCount()) 
     583                    if (index < eventTabsPane.getTabCount()) 
    599584                    { 
    600                         jTabbedPane1.setForegroundAt(index, c); 
     585                        eventTabsPane.setForegroundAt(index, c); 
    601586                    } 
    602587                } 
  • trunk/src/event/editor/frame/PropertyPanels.java

    r94 r119  
    9090    } 
    9191 
    92     private boolean remove(PropertyPanel panel) 
     92    private boolean remove(PropertyPanel removablePanel) 
    9393    { 
    9494        boolean result = false; 
    9595 
    96         if ((result = properties.remove(panel))) 
     96        if ((result = properties.remove(removablePanel))) 
    9797        { 
    9898            setChanged(); 
    99             notifyObservers(new PropertyUpdate(UpdateType.Remove, panel)); 
     99            notifyObservers(new PropertyUpdate(UpdateType.Remove, removablePanel)); 
    100100        } 
    101101        else 
     
    104104        } 
    105105 
    106         if (panel.getProperty().getType() == PropertyTypes.Multiple) 
     106        if (removablePanel.getProperty().getType() == PropertyTypes.Multiple) 
    107107        { 
    108108            Vector<MultPropertyPanel> panelsOfSameType = new Vector<MultPropertyPanel>(); 
    109109            Vector<MultPropertyPanel> panelsOfGreaterIndex = new Vector<MultPropertyPanel>(); 
    110110 
    111             propertyCounter.put(panel.getProperty(), propertyCounter.get(panel.getProperty()) - 1); 
     111            propertyCounter.put(removablePanel.getProperty(), propertyCounter.get(removablePanel.getProperty()) - 1); 
    112112 
    113113            // extract panels of the same property type 
    114114            for (PropertyPanel pan : properties) 
    115115            { 
    116                 if (pan.getProperty() == panel.getProperty()) 
     116                if (pan.getProperty() == removablePanel.getProperty()) 
    117117                { 
    118118                    panelsOfSameType.add((MultPropertyPanel) pan); 
     
    124124            for (MultPropertyPanel pan : panelsOfSameType) 
    125125            { 
    126                 if (pan.getIndex() > ((MultPropertyPanel) panel).getIndex()) 
     126                if (pan.getIndex() > ((MultPropertyPanel) removablePanel).getIndex()) 
    127127                { 
    128128                    panelsOfGreaterIndex.add(pan); 
     
    138138            } 
    139139        } 
    140         else if (panel.getProperty().getType() == PropertyTypes.Optional) 
     140        else if (removablePanel.getProperty().getType() == PropertyTypes.Optional) 
    141141        { 
    142142            // do nothing 
Note: See TracChangeset for help on using the changeset viewer.