Ignore:
Timestamp:
03/15/2017 10:20:21 AM (9 years ago)
Author:
jdalbey
Message:

Merge CAD Client updates for multiple incident view windows.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/tmcsim/client/cadclientgui/screens/IncidentEditor.java

    r3 r59  
    1 /* 
    2  * To change this template, choose Tools | Templates 
    3  * and open the template in the editor. 
    4  */ 
    51package tmcsim.client.cadclientgui.screens; 
    62 
     
    1713import java.util.Calendar; 
    1814import java.util.Date; 
    19  
    2015import javax.swing.BorderFactory; 
    2116import javax.swing.DefaultListModel; 
     
    3025import javax.swing.table.DefaultTableModel; 
    3126import javax.swing.table.TableCellRenderer; 
    32  
     27import tmcsim.client.cadclientgui.enums.CADDataEnums.TABLE; 
    3328import tmcsim.client.cadclientgui.enums.TableHeaders; 
    34 import tmcsim.client.cadclientgui.enums.CADDataEnums.TABLE; 
    3529 
    3630/** 
    37  * This class contains the view and controller for the IncidentEditor screen. The view is built using a GUI builder plug-in, and the controller  
    38  * uses listeners to control how the view and data act. 
     31 * This class contains the view and controller for the IncidentEditor screen. 
     32 * The view is built using a GUI builder plug-in, and the controller uses 
     33 * listeners to control how the view and data act. 
     34 * 
    3935 * @author Stuart 
    4036 */ 
    41 public class IncidentEditor extends javax.swing.JFrame { 
    42  
    43     private final String[] monthNames = { "January", "February", 
    44             "March", "April", "May", "June", "July", "August", "September", 
    45             "October", "November", "December"}; 
    46      
    47     private final String[] dayNames = { "Sun", "Mon", "Tue", "Wed", 
    48             "Thu", "Fri", "Sat"}; 
    49  
     37public class IncidentEditor extends javax.swing.JFrame 
     38{ 
     39    private final String[] monthNames = 
     40    { 
     41        "January", "February", 
     42        "March", "April", "May", "June", "July", "August", "September", 
     43        "October", "November", "December" 
     44    }; 
     45    private final String[] dayNames = 
     46    { 
     47        "Sun", "Mon", "Tue", "Wed", 
     48        "Thu", "Fri", "Sat" 
     49    }; 
    5050    private DefaultTableModel blankTable; 
    51      
    5251    private JTable calendarTable; 
    5352    private int todayRow; 
     
    5756     * Creates new form IncidentEditor 
    5857     */ 
    59     public IncidentEditor() { 
     58    public IncidentEditor() 
     59    { 
    6060        declareComponents(); 
    6161        initControllers(); 
     
    7171    // <editor-fold defaultstate="collapsed" 
    7272    // desc="Generated Code">//GEN-BEGIN:initComponents 
    73     private void declareComponents() { 
     73    private void declareComponents() 
     74    { 
    7475 
    7576        incidentLogScroll = new javax.swing.JScrollPane(); 
     
    9394        toCalendar = new javax.swing.JPanel(); 
    9495    } 
    95      
    96     public MouseListener newMouseListener(){ 
    97         return new MouseListener() { 
    98             public void mouseClicked(MouseEvent e) { 
     96 
     97    public MouseListener newMouseListener() 
     98    { 
     99        return new MouseListener() 
     100        { 
     101            public void mouseClicked(MouseEvent e) 
     102            { 
    99103                viewButton.setEnabled(true); 
    100104            } 
    101105 
    102             public void mouseEntered(MouseEvent e) { 
    103             } 
    104  
    105             public void mouseExited(MouseEvent e) { 
    106             } 
    107  
    108             public void mousePressed(MouseEvent e) { 
    109             } 
    110  
    111             public void mouseReleased(MouseEvent e) { 
    112             } 
    113         }; 
    114     } 
    115      
    116     public ActionListener newSearchActionListener(){ 
    117         return new ActionListener() { 
    118             public void actionPerformed(ActionEvent e) { 
     106            public void mouseEntered(MouseEvent e) 
     107            { 
     108            } 
     109 
     110            public void mouseExited(MouseEvent e) 
     111            { 
     112            } 
     113 
     114            public void mousePressed(MouseEvent e) 
     115            { 
     116            } 
     117 
     118            public void mouseReleased(MouseEvent e) 
     119            { 
     120            } 
     121        }; 
     122    } 
     123 
     124    public ActionListener newSearchActionListener() 
     125    { 
     126        return new ActionListener() 
     127        { 
     128            public void actionPerformed(ActionEvent e) 
     129            { 
    119130                ScreenManager.openSearch(); 
    120131            } 
    121  
    122         }; 
    123     } 
    124      
    125     public ActionListener newViewActionListener(){ 
    126         return new ActionListener() { 
    127             public void actionPerformed(ActionEvent e) { 
     132        }; 
     133    } 
     134 
     135    public ActionListener newViewActionListener() 
     136    { 
     137        return new ActionListener() 
     138        { 
     139            public void actionPerformed(ActionEvent e) 
     140            { 
    128141                String masterInc = (String) incidentLogTable.getValueAt( 
    129142                        incidentLogTable.getSelectedRow(), 5); 
    130143                int incidentId = 0; 
    131                 try { 
     144                try 
     145                { 
    132146                    incidentId = ScreenManager.theCoordinator 
    133147                            .getIncidentId(masterInc); 
    134                 } catch (RemoteException e1) { 
     148                } catch (RemoteException e1) 
     149                { 
    135150                    e1.printStackTrace(); 
    136151                } 
     
    139154        }; 
    140155    } 
    141      
    142     public ActionListener newRefreshActionListener(){ 
    143         return new ActionListener() { 
    144             public void actionPerformed(ActionEvent e) { 
     156 
     157    public ActionListener newRefreshActionListener() 
     158    { 
     159        return new ActionListener() 
     160        { 
     161            public void actionPerformed(ActionEvent e) 
     162            { 
    145163                refreshInformation(); 
    146164            } 
    147165        }; 
    148166    } 
    149      
    150     public ActionListener newExitActionListener(){ 
    151         return new ActionListener() { 
    152             public void actionPerformed(ActionEvent arg0) { 
     167 
     168    public ActionListener newExitActionListener() 
     169    { 
     170        return new ActionListener() 
     171        { 
     172            public void actionPerformed(ActionEvent arg0) 
     173            { 
    153174                close(); 
    154175            } 
    155176        }; 
    156177    } 
    157      
    158     private void initControllers() { 
    159          
     178 
     179    private void initControllers() 
     180    { 
     181 
    160182        incidentLogTable.addMouseListener(newMouseListener()); 
    161          
     183 
    162184        searchButton.addActionListener(newSearchActionListener()); 
    163185        viewButton.addActionListener(newViewActionListener()); 
     
    165187        exitButton.addActionListener(newExitActionListener()); 
    166188    } 
    167          
    168     private void initLayout() { 
     189 
     190    private void initLayout() 
     191    { 
    169192        blankTable = new DefaultTableModel(); 
    170193        blankTable.setColumnIdentifiers(TableHeaders.INCIDENT_EDITOR_HEADERS); 
     
    195218 
    196219        currentDatabaseCombo.setModel(new javax.swing.DefaultComboBoxModel( 
    197                 new String[] { "System" })); 
     220                new String[] 
     221        { 
     222            "System" 
     223        })); 
    198224        currentDatabaseCombo.setEnabled(false); 
    199225 
     
    202228        fromCalendar = createCalendar(); 
    203229        toCalendar = createCalendar(); 
    204          
     230 
    205231        reopenButton.setText("ReOpen"); 
    206232        reopenButton.setEnabled(false); 
     
    211237 
    212238        searchButton.setText("Search"); 
    213          
     239 
    214240        printButton.setText("Print"); 
    215241        printButton.setEnabled(false); 
     
    217243        viewButton.setText("View"); 
    218244        viewButton.setEnabled(false); 
    219          
     245 
    220246        refreshButton.setText("Refresh"); 
    221247        exitButton.setText("Exit"); 
    222          
     248 
    223249        fromLabel.setText("From..."); 
    224250 
    225251        toLabel.setText("To..."); 
    226          
     252 
    227253        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); 
    228254        getContentPane().setLayout(layout); 
    229255        layout.setHorizontalGroup( 
    230             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 
    231             .addComponent(incidentLogScroll) 
    232             .addGroup(layout.createSequentialGroup() 
     256                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 
     257                .addComponent(incidentLogScroll) 
     258                .addGroup(layout.createSequentialGroup() 
    233259                .addContainerGap() 
    234260                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 
    235                     .addComponent(agencyTypeLabel) 
    236                     .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE) 
    237                     .addGroup(layout.createSequentialGroup() 
    238                         .addGap(10, 10, 10) 
    239                         .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 
    240                             .addComponent(currentDatabaseLabel) 
    241                             .addComponent(currentDatabaseCombo, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE))) 
    242                     .addComponent(searchLimitLabel)) 
     261                .addComponent(agencyTypeLabel) 
     262                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 200, javax.swing.GroupLayout.PREFERRED_SIZE) 
     263                .addGroup(layout.createSequentialGroup() 
     264                .addGap(10, 10, 10) 
     265                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 
     266                .addComponent(currentDatabaseLabel) 
     267                .addComponent(currentDatabaseCombo, javax.swing.GroupLayout.PREFERRED_SIZE, 150, javax.swing.GroupLayout.PREFERRED_SIZE))) 
     268                .addComponent(searchLimitLabel)) 
    243269                .addGap(32, 32, 32) 
    244270                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 
    245                     .addComponent(fromLabel) 
    246                     .addComponent(fromCalendar, 200, 200, 200)) 
     271                .addComponent(fromLabel) 
     272                .addComponent(fromCalendar, 200, 200, 200)) 
    247273                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 45, Short.MAX_VALUE) 
    248274                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 
    249                     .addComponent(toLabel) 
    250                     .addComponent(toCalendar, 200, 200, 200)) 
     275                .addComponent(toLabel) 
     276                .addComponent(toCalendar, 200, 200, 200)) 
    251277                .addGap(25, 25, 25) 
    252278                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) 
    253                     .addComponent(reopenButton, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 
    254                     .addComponent(duplicateCellButton, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 
    255                     .addComponent(searchButton, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 
    256                     .addComponent(printButton, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 
    257                     .addComponent(viewButton, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 
    258                     .addComponent(refreshButton, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 
    259                     .addComponent(exitButton, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))) 
    260         ); 
     279                .addComponent(reopenButton, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 
     280                .addComponent(duplicateCellButton, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 
     281                .addComponent(searchButton, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 
     282                .addComponent(printButton, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 
     283                .addComponent(viewButton, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 
     284                .addComponent(refreshButton, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) 
     285                .addComponent(exitButton, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))); 
    261286        layout.setVerticalGroup( 
    262             layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 
    263             .addGroup(layout.createSequentialGroup() 
     287                layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 
     288                .addGroup(layout.createSequentialGroup() 
    264289                .addComponent(incidentLogScroll, javax.swing.GroupLayout.PREFERRED_SIZE, 300, javax.swing.GroupLayout.PREFERRED_SIZE) 
    265290                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 
    266291                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 
    267                     .addComponent(agencyTypeLabel) 
    268                     .addComponent(reopenButton) 
    269                     .addComponent(fromLabel) 
    270                     .addComponent(toLabel)) 
     292                .addComponent(agencyTypeLabel) 
     293                .addComponent(reopenButton) 
     294                .addComponent(fromLabel) 
     295                .addComponent(toLabel)) 
    271296                .addGap(2, 2, 2) 
    272297                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) 
    273                     .addGroup(layout.createSequentialGroup() 
    274                         .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE) 
    275                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 
    276                         .addComponent(currentDatabaseLabel) 
    277                         .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 
    278                         .addComponent(currentDatabaseCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) 
    279                         .addGap(18, 18, 18) 
    280                         .addComponent(searchLimitLabel)) 
    281                     .addGroup(layout.createSequentialGroup() 
    282                         .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 
    283                             .addComponent(fromCalendar, 150, 150, 150) 
    284                             .addComponent(toCalendar, 150, 150, 150))) 
    285                     .addGroup(layout.createSequentialGroup() 
    286                         .addComponent(duplicateCellButton) 
    287                         .addGap(2, 2, 2) 
    288                         .addComponent(searchButton) 
    289                         .addGap(2, 2, 2) 
    290                         .addComponent(printButton) 
    291                         .addGap(2, 2, 2) 
    292                         .addComponent(viewButton) 
    293                         .addGap(2, 2, 2) 
    294                         .addComponent(refreshButton) 
    295                         .addGap(2, 2, 2) 
    296                         .addComponent(exitButton))) 
    297                 .addGap(0, 41, Short.MAX_VALUE)) 
    298         ); 
     298                .addGroup(layout.createSequentialGroup() 
     299                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE) 
     300                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 
     301                .addComponent(currentDatabaseLabel) 
     302                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) 
     303                .addComponent(currentDatabaseCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) 
     304                .addGap(18, 18, 18) 
     305                .addComponent(searchLimitLabel)) 
     306                .addGroup(layout.createSequentialGroup() 
     307                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) 
     308                .addComponent(fromCalendar, 150, 150, 150) 
     309                .addComponent(toCalendar, 150, 150, 150))) 
     310                .addGroup(layout.createSequentialGroup() 
     311                .addComponent(duplicateCellButton) 
     312                .addGap(2, 2, 2) 
     313                .addComponent(searchButton) 
     314                .addGap(2, 2, 2) 
     315                .addComponent(printButton) 
     316                .addGap(2, 2, 2) 
     317                .addComponent(viewButton) 
     318                .addGap(2, 2, 2) 
     319                .addComponent(refreshButton) 
     320                .addGap(2, 2, 2) 
     321                .addComponent(exitButton))) 
     322                .addGap(0, 41, Short.MAX_VALUE))); 
    299323 
    300324        pack(); 
    301325    }// </editor-fold>//GEN-END:initComponents 
    302326 
    303     public JPanel createCalendar(){ 
    304          
     327    public JPanel createCalendar() 
     328    { 
     329 
    305330        JPanel calendarPanel = new JPanel(); 
    306331        Calendar now = Calendar.getInstance(); 
    307332        calendarPanel.setBorder(new LineBorder(new Color(0, 0, 0))); 
    308333        calendarPanel.setLayout(null); 
    309          
     334 
    310335        JLabel monthLabel = new JLabel("New label"); 
    311336        monthLabel.setBounds(0, 0, 140, 20); 
     
    314339        monthLabel.setText(monthNames[now.get(Calendar.MONTH)]); 
    315340        calendarPanel.add(monthLabel); 
    316          
     341 
    317342        JLabel yearLabel = new JLabel("New label"); 
    318343        yearLabel.setHorizontalAlignment(SwingConstants.CENTER); 
     
    321346        yearLabel.setText(Integer.toString(now.get(Calendar.YEAR))); 
    322347        calendarPanel.add(yearLabel); 
    323          
     348 
    324349        Date date = new Date(); 
    325350        DateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy"); 
    326351        String dateString = dateFormat.format(date); 
    327          
     352 
    328353        JLabel dateLabel1 = new JLabel("New label"); 
    329354        dateLabel1.setBounds(0, 130, 60, 20); 
     
    332357        dateLabel1.setHorizontalAlignment(JLabel.CENTER); 
    333358        calendarPanel.add(dateLabel1); 
    334          
     359 
    335360        JLabel dateLabel2 = new JLabel("New label"); 
    336361        dateLabel2.setBounds(140, 130, 60, 20); 
     
    339364        dateLabel2.setHorizontalAlignment(JLabel.CENTER); 
    340365        calendarPanel.add(dateLabel2); 
    341          
     366 
    342367        JScrollBar scrollBar = new JScrollBar(); 
    343368        scrollBar.setOrientation(JScrollBar.HORIZONTAL); 
     
    346371        scrollBar.setEnabled(false); 
    347372        calendarPanel.add(scrollBar); 
    348          
    349         calendarTable = new JTable(){ 
     373 
     374        calendarTable = new JTable() 
     375        { 
    350376            /* 
    351377             * Custom renderer to set different background/foreground colors 
    352378             * @see javax.swing.JTable#prepareRenderer(javax.swing.table.TableCellRenderer, int, int) 
    353379             */ 
    354             public Component prepareRenderer(TableCellRenderer renderer, int row, int column){ 
     380            public Component prepareRenderer(TableCellRenderer renderer, int row, int column) 
     381            { 
    355382                Component comp = super.prepareRenderer(renderer, row, column); 
    356                 if(todayRow == row && todayCol == column){ 
     383                if (todayRow == row && todayCol == column) 
     384                { 
    357385                    comp.setBackground(Color.BLUE); 
    358386                    comp.setForeground(Color.WHITE); 
    359387                } 
    360                 else{ 
     388                else 
     389                { 
    361390                    comp.setBackground(new Color(235, 235, 235)); 
    362391                    comp.setForeground(Color.BLACK); 
     
    368397        DefaultTableCellRenderer centerRenderer = new DefaultTableCellRenderer(); 
    369398        centerRenderer.setHorizontalAlignment(JLabel.CENTER); 
    370         for(int i = 0; i < dayNames.length; i++){ 
     399        for (int i = 0; i < dayNames.length; i++) 
     400        { 
    371401            calendarTable.getColumnModel().getColumn(i).setCellRenderer(centerRenderer); 
    372402        } 
     
    374404        calendarTable.setBounds(0, 20, 200, 110); 
    375405        calendarPanel.add(calendarTable); 
    376          
     406 
    377407        return calendarPanel; 
    378408    } 
    379      
    380     protected DefaultTableModel createDaysModel() { 
    381  
    382         String[][] emptyModel = {{"", "", "", "", "", "", ""}, 
    383                                 {"", "", "", "", "", "", ""}, 
    384                                 {"", "", "", "", "", "", ""}, 
    385                                 {"", "", "", "", "", "", ""}, 
    386                                 {"", "", "", "", "", "", ""}, 
    387                                 {"", "", "", "", "", "", ""}, 
    388                                 {"", "", "", "", "", "", ""}, 
    389                                 {"", "", "", "", "", "", ""}}; 
    390          
    391         String[] emptyHeader = {"", "", "", "", "", "", ""}; 
     409 
     410    protected DefaultTableModel createDaysModel() 
     411    { 
     412 
     413        String[][] emptyModel = 
     414        { 
     415            { 
     416                "", "", "", "", "", "", "" 
     417            }, 
     418            { 
     419                "", "", "", "", "", "", "" 
     420            }, 
     421            { 
     422                "", "", "", "", "", "", "" 
     423            }, 
     424            { 
     425                "", "", "", "", "", "", "" 
     426            }, 
     427            { 
     428                "", "", "", "", "", "", "" 
     429            }, 
     430            { 
     431                "", "", "", "", "", "", "" 
     432            }, 
     433            { 
     434                "", "", "", "", "", "", "" 
     435            }, 
     436            { 
     437                "", "", "", "", "", "", "" 
     438            } 
     439        }; 
     440 
     441        String[] emptyHeader = 
     442        { 
     443            "", "", "", "", "", "", "" 
     444        }; 
    392445        DefaultTableModel calendarModel = new DefaultTableModel(emptyModel, emptyHeader); 
    393446        int row = 0; 
    394447        int col = 0; 
    395          
     448 
    396449        Calendar today = Calendar.getInstance(); 
    397450        int tMonth = today.get(Calendar.MONTH); 
     
    411464        maximum.add(Calendar.MONTH, +1); 
    412465 
    413         for (int i = 0; i < dayNames.length; i++) { 
     466        for (int i = 0; i < dayNames.length; i++) 
     467        { 
    414468            calendarModel.setValueAt(dayNames[i], row, col); 
    415469            col++; 
     
    418472        row = 1; 
    419473 
    420         while (iterator.getTimeInMillis() < maximum.getTimeInMillis()) { 
     474        while (iterator.getTimeInMillis() < maximum.getTimeInMillis()) 
     475        { 
    421476            int lMonth = iterator.get(Calendar.MONTH); 
    422477            int lYear = iterator.get(Calendar.YEAR); 
    423478 
    424             if ((lMonth == tMonth) && (lYear == tYear)) { 
     479            if ((lMonth == tMonth) && (lYear == tYear)) 
     480            { 
    425481                int lDay = iterator.get(Calendar.DAY_OF_MONTH); 
    426482                calendarModel.setValueAt(Integer.toString(lDay), row, col); 
    427                 if ((tMonth == lMonth) && (tYear == lYear) && (tDay == lDay)) { 
     483                if ((tMonth == lMonth) && (tYear == lYear) && (tDay == lDay)) 
     484                { 
    428485                    todayRow = row; 
    429486                    todayCol = col; 
    430487                } 
    431             }  
     488            } 
    432489            iterator.add(Calendar.DAY_OF_YEAR, +1); 
    433              
     490 
    434491            col++; 
    435             if(col >= calendarModel.getColumnCount()){ 
     492            if (col >= calendarModel.getColumnCount()) 
     493            { 
    436494                row++; 
    437495                col = 0; 
     
    439497        } 
    440498 
    441          
     499 
    442500        return calendarModel; 
    443501    } 
    444      
    445     public void refreshInformation() { 
    446         try { 
     502 
     503    public void refreshInformation() 
     504    { 
     505        try 
     506        { 
    447507            incidentLogTable.setModel(ScreenManager.theCoordinator 
    448508                    .getCadDataTable(TABLE.INCIDENT_EDITOR)); 
    449         } catch (RemoteException e) { 
     509        } catch (RemoteException e) 
     510        { 
    450511            e.printStackTrace(); 
    451512        } 
     
    455516     * Makes screen visible. 
    456517     */ 
    457     public void open() { 
     518    public void open() 
     519    { 
    458520        incidentLogTable.setModel(blankTable); 
    459521        viewButton.setEnabled(false); 
     
    464526     * Hides screen. 
    465527     */ 
    466     public void close() { 
     528    public void close() 
     529    { 
    467530        setVisible(false); 
    468531    } 
    469  
    470532    // Variables declaration - do not modify//GEN-BEGIN:variables 
    471533    private javax.swing.JLabel agencyTypeLabel; 
Note: See TracChangeset for help on using the changeset viewer.