Changeset 190 in tmcsimulator-scriptbuilder for trunk/src


Ignore:
Timestamp:
01/20/2020 06:28:53 PM (6 years ago)
Author:
sdanthin
Message:

incidentPaletteFrame.java Fixed GUI relating to Create new button. See ticket #219

Location:
trunk/src/scriptbuilder/gui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/scriptbuilder/gui/IncidentPaletteFrame.form

    r127 r190  
    22 
    33<Form version="1.5" maxVersion="1.9" type="org.netbeans.modules.form.forminfo.JFrameFormInfo"> 
     4  <Properties> 
     5    <Property name="title" type="java.lang.String" value="Incident Palette"/> 
     6  </Properties> 
    47  <SyntheticProperties> 
    58    <SyntheticProperty name="formSizePolicy" type="int" value="1"/> 
     
    5154        <DimensionLayout dim="0"> 
    5255          <Group type="103" groupAlignment="0" attributes="0"> 
    53               <Group type="102" alignment="1" attributes="0"> 
    54                   <EmptySpace max="-2" attributes="0"/> 
    55                   <Component id="txtSearchFilter" max="32767" attributes="0"/> 
    56                   <EmptySpace max="-2" attributes="0"/> 
    57                   <Component id="btnCreateIncident" min="-2" pref="123" max="-2" attributes="0"/> 
    58                   <EmptySpace min="-2" pref="23" max="-2" attributes="0"/> 
     56              <Group type="102" alignment="0" attributes="0"> 
     57                  <EmptySpace max="-2" attributes="0"/> 
     58                  <Component id="btnCreateIncident" min="-2" max="-2" attributes="0"/> 
     59                  <EmptySpace max="32767" attributes="0"/> 
    5960              </Group> 
    6061          </Group> 
     
    6465              <Group type="102" attributes="0"> 
    6566                  <EmptySpace max="-2" attributes="0"/> 
    66                   <Group type="103" groupAlignment="3" attributes="0"> 
    67                       <Component id="txtSearchFilter" alignment="3" min="-2" max="-2" attributes="0"/> 
    68                       <Component id="btnCreateIncident" alignment="3" min="-2" max="-2" attributes="0"/> 
    69                   </Group> 
     67                  <Component id="btnCreateIncident" min="-2" max="-2" attributes="0"/> 
    7068                  <EmptySpace max="32767" attributes="0"/> 
    7169              </Group> 
     
    7674        <Component class="javax.swing.JButton" name="btnCreateIncident"> 
    7775          <Properties> 
    78             <Property name="text" type="java.lang.String" value="Create New..."/> 
     76            <Property name="text" type="java.lang.String" value="Create New Incident..."/> 
    7977          </Properties> 
    8078          <Events> 
    8179            <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="btnCreateIncidentActionPerformed"/> 
    82           </Events> 
    83         </Component> 
    84         <Component class="javax.swing.JTextField" name="txtSearchFilter"> 
    85           <Events> 
    86             <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="txtSearchFilterActionPerformed"/> 
    8780          </Events> 
    8881        </Component> 
  • trunk/src/scriptbuilder/gui/IncidentPaletteFrame.java

    r189 r190  
    7171 
    7272        initComponents(); 
    73  
    74         txtSearchFilter.addKeyListener(new KeyListener() 
    75         { 
    76  
    77             @Override 
    78             public void keyTyped(KeyEvent e) 
    79             { 
    80             } 
    81  
    82             @Override 
    83             public void keyPressed(KeyEvent e) 
    84             { 
    85                 if (e.getKeyCode() == KeyEvent.VK_ENTER) 
    86                 { 
    87                     /*This feature has not yet been implemented. Show a message and just return.*/ 
    88                     if (true) 
    89                     { 
    90                         JOptionPane.showMessageDialog(txtSearchFilter.getTopLevelAncestor(), "This feature has not yet been implemented.\n", 
    91                                 "Feature not implemented", JOptionPane.INFORMATION_MESSAGE); 
    92                     } 
    93                 } 
    94             } 
    95  
    96             @Override 
    97             public void keyReleased(KeyEvent e) 
    98             { 
    99             } 
    100         }); 
     73//This is a deprecated feature that originally was used to search for text. 
     74//        txtSearchFilter.addKeyListener(new KeyListener() 
     75//        { 
     76// 
     77//            @Override 
     78//            public void keyTyped(KeyEvent e) 
     79//            { 
     80//            } 
     81// 
     82//            @Override 
     83//            public void keyPressed(KeyEvent e) 
     84//            { 
     85//                if (e.getKeyCode() == KeyEvent.VK_ENTER) 
     86//                { 
     87//                    /*This feature has not yet been implemented. Show a message and just return.*/ 
     88////                    if (true) 
     89////                    { 
     90////                        JOptionPane.showMessageDialog(txtSearchFilter.getTopLevelAncestor(), "This feature has not yet been implemented.\n", 
     91////                                "Feature not implemented", JOptionPane.INFORMATION_MESSAGE); 
     92////                    } 
     93//                } 
     94//            } 
     95// 
     96//            @Override 
     97//            public void keyReleased(KeyEvent e) 
     98//            { 
     99//            } 
     100//        }); 
    101101 
    102102        String fs = System.getProperty("file.separator"); 
     
    281281    @SuppressWarnings("unchecked") 
    282282    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents 
    283     private void initComponents() 
    284     { 
     283    private void initComponents() { 
    285284 
    286285        jPanel1 = new javax.swing.JPanel(); 
    287286        btnCreateIncident = new javax.swing.JButton(); 
    288         txtSearchFilter = new javax.swing.JTextField(); 
    289287        jPanel2 = new javax.swing.JPanel(); 
    290288        jScrollPane2 = new javax.swing.JScrollPane(); 
     
    296294        labelFileCount = new javax.swing.JLabel(); 
    297295 
    298         btnCreateIncident.setText("Create New..."); 
    299         btnCreateIncident.addActionListener(new java.awt.event.ActionListener() 
    300         { 
    301             public void actionPerformed(java.awt.event.ActionEvent evt) 
    302             { 
     296        setTitle("Incident Palette"); 
     297 
     298        btnCreateIncident.setText("Create New Incident..."); 
     299        btnCreateIncident.addActionListener(new java.awt.event.ActionListener() { 
     300            public void actionPerformed(java.awt.event.ActionEvent evt) { 
    303301                btnCreateIncidentActionPerformed(evt); 
    304             } 
    305         }); 
    306  
    307         txtSearchFilter.addActionListener(new java.awt.event.ActionListener() 
    308         { 
    309             public void actionPerformed(java.awt.event.ActionEvent evt) 
    310             { 
    311                 txtSearchFilterActionPerformed(evt); 
    312302            } 
    313303        }); 
     
    317307        jPanel1Layout.setHorizontalGroup( 
    318308            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 
    319             .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup() 
     309            .addGroup(jPanel1Layout.createSequentialGroup() 
    320310                .addContainerGap() 
    321                 .addComponent(txtSearchFilter) 
    322                 .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 
    323                 .addComponent(btnCreateIncident, javax.swing.GroupLayout.PREFERRED_SIZE, 123, javax.swing.GroupLayout.PREFERRED_SIZE) 
    324                 .addGap(23, 23, 23)) 
     311                .addComponent(btnCreateIncident) 
     312                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 
    325313        ); 
    326314        jPanel1Layout.setVerticalGroup( 
     
    328316            .addGroup(jPanel1Layout.createSequentialGroup() 
    329317                .addContainerGap() 
    330                 .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 
    331                     .addComponent(txtSearchFilter, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) 
    332                     .addComponent(btnCreateIncident)) 
     318                .addComponent(btnCreateIncident) 
    333319                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) 
    334320        ); 
    335321 
    336322        tableCurrentIncidents.setModel(new javax.swing.table.DefaultTableModel( 
    337             new Object [][] 
    338             { 
     323            new Object [][] { 
    339324                {null, null, null}, 
    340325                {null, null, null}, 
     
    349334                {null, null, null} 
    350335            }, 
    351             new String [] 
    352             { 
     336            new String [] { 
    353337                "Incident #", "Start Time", "Title" 
    354338            } 
    355         ) 
    356         { 
    357             Class[] types = new Class [] 
    358             { 
     339        ) { 
     340            Class[] types = new Class [] { 
    359341                java.lang.Integer.class, java.lang.String.class, java.lang.String.class 
    360342            }; 
    361             boolean[] canEdit = new boolean [] 
    362             { 
     343            boolean[] canEdit = new boolean [] { 
    363344                false, false, false 
    364345            }; 
    365346 
    366             public Class getColumnClass(int columnIndex) 
    367             { 
     347            public Class getColumnClass(int columnIndex) { 
    368348                return types [columnIndex]; 
    369349            } 
    370350 
    371             public boolean isCellEditable(int rowIndex, int columnIndex) 
    372             { 
     351            public boolean isCellEditable(int rowIndex, int columnIndex) { 
    373352                return canEdit [columnIndex]; 
    374353            } 
     
    400379 
    401380        btnClosePalette.setText("Done"); 
    402         btnClosePalette.addActionListener(new java.awt.event.ActionListener() 
    403         { 
    404             public void actionPerformed(java.awt.event.ActionEvent evt) 
    405             { 
     381        btnClosePalette.addActionListener(new java.awt.event.ActionListener() { 
     382            public void actionPerformed(java.awt.event.ActionEvent evt) { 
    406383                btnClosePaletteActionPerformed(evt); 
    407384            } 
     
    493470    }//GEN-LAST:event_btnClosePaletteActionPerformed 
    494471 
    495     private void txtSearchFilterActionPerformed(java.awt.event.ActionEvent evt)//GEN-FIRST:event_txtSearchFilterActionPerformed 
    496     {//GEN-HEADEREND:event_txtSearchFilterActionPerformed 
    497         // TODO add your handling code here: 
    498     }//GEN-LAST:event_txtSearchFilterActionPerformed 
    499  
    500472 
    501473    // Variables declaration - do not modify//GEN-BEGIN:variables 
     
    510482    private javax.swing.JScrollPane scrollAddPanels; 
    511483    private javax.swing.JTable tableCurrentIncidents; 
    512     private javax.swing.JTextField txtSearchFilter; 
    513484    // End of variables declaration//GEN-END:variables 
    514485 
Note: See TracChangeset for help on using the changeset viewer.