Ignore:
Timestamp:
03/13/2019 10:07:54 AM (7 years ago)
Author:
jdalbey
Message:

Fix defect #102. Also add revision number to filenames of deploy jars.

File:
1 edited

Legend:

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

    r288 r310  
    387387    private void saveComment(String commentMsg) 
    388388    { 
    389                 DateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy"); 
    390                 DateFormat timeFormat = new SimpleDateFormat("HH:mm:ss"); 
    391                 // prepare fields to be added to comment table 
    392                 String[] fields = 
    393                 { 
    394                     dateFormat.format(new Date()), 
    395                     timeFormat.format(new Date()), 
    396                     ScreenManager.getUserName(), // Put username in "Initials" column 
    397                     "", // "Block" is left blank for now  
    398                     commentMsg 
    399                 }; 
    400                 try 
    401                 { 
    402                     // insert a new row in the comment table 
    403                     ScreenManager.theCoordinator.addCadDataIncidentTable( 
    404                             INC_TABLE.COMMENTS_NOTES, incidentId, fields); 
    405                     ((DefaultTableModel) commentsNotesTable.getModel()).insertRow(0, fields); 
    406                 } catch (RemoteException e) 
    407                 { 
    408                     e.printStackTrace(); 
    409                 } 
    410          
     389        DateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy"); 
     390        DateFormat timeFormat = new SimpleDateFormat("HH:mm:ss"); 
     391        // prepare fields to be added to comment table 
     392        String[] fields = 
     393        { 
     394            dateFormat.format(new Date()), 
     395            timeFormat.format(new Date()), 
     396            ScreenManager.getUserName(), // Put username in "Initials" column 
     397            "", // "Block" is left blank for now  
     398            commentMsg 
     399        }; 
     400        try 
     401        { 
     402            // insert a new row in the comment table 
     403            ScreenManager.theCoordinator.addCadDataIncidentTable( 
     404                    INC_TABLE.COMMENTS_NOTES, incidentId, fields); 
     405            ((DefaultTableModel) commentsNotesTable.getModel()).insertRow(0, fields); 
     406        } catch (RemoteException e) 
     407        { 
     408            e.printStackTrace(); 
     409        } 
    411410    } 
    412     // JD Add a mouselistener to the comments table to display a single cell 
    413     //  contents in a popup 
    414 //    public MouseListener newCommentsTableCellListener() 
    415 //    { 
    416 //        return new MouseListener() 
    417 //        { 
    418 //            public void mousePressed(MouseEvent event) 
    419 //            { 
    420 //            } 
    421 // 
    422 //            public void mouseReleased(MouseEvent event) 
    423 //            { 
    424 //            } 
    425 // 
    426 //            public void mouseEntered(MouseEvent event) 
    427 //            { 
    428 //            } 
    429 // 
    430 //            public void mouseExited(MouseEvent event) 
    431 //            { 
    432 //            } 
    433 // 
    434 //            public void mouseClicked(MouseEvent event) 
    435 //            { 
    436 //                Point point = event.getPoint(); 
    437 //                int row, column; 
    438 //                row = commentsNotesTable.rowAtPoint(point); 
    439 //                column = commentsNotesTable.columnAtPoint(point); 
    440 //                // See if the click was in column 4 (the comment column) 
    441 //                if (column == 4) 
    442 //                { 
    443 //                    JOptionPane.showMessageDialog(null, getWrappedText((String) commentsNotesTable.getValueAt(row, column)), 
    444 //                            "Comment/Note Text", JOptionPane.INFORMATION_MESSAGE); 
    445 //                } 
    446 // 
    447 //            } 
    448 //        }; 
    449 //    } 
     411 
    450412    private void initControllers() 
    451413    { 
     
    461423    } 
    462424 
    463     /** 
    464      * A custom renderer that sets a tool tip with the wrapped comment. JD 
    465      */ 
    466 // Obsolete JD 
    467 //    class LineWrapRenderer extends DefaultTableCellRenderer 
    468 //    { 
    469 //        public final static int kSegmentsize = 60; 
    470 // 
    471 //        protected void setValue(Object value) 
    472 //        { 
    473 //            String comment = (String) value; 
    474 //            setText(comment); 
    475 //            // Wrap long comments in a tooltip 
    476 //            setToolTipText(getWrappedText(comment)); 
    477 //        } 
    478 //    } 
    479 // 
    480 //    private String getWrappedText(String stringToWrap) 
    481 //    { 
    482 //        int limit = stringToWrap.length() / LineWrapRenderer.kSegmentsize; 
    483 //        StringBuilder toolTip = new StringBuilder("<html>"); 
    484 //        for (int jumper = 0; jumper <= limit; jumper++) 
    485 //        { 
    486 //            toolTip.append(stringToWrap.substring(jumper * LineWrapRenderer.kSegmentsize, Math.min((jumper + 1) * LineWrapRenderer.kSegmentsize, stringToWrap.length()))); 
    487 //            toolTip.append("<br>");  // Use html break to cause a line break 
    488 //        } 
    489 //        toolTip.append("</html>"); 
    490 //        return toolTip.toString(); 
    491 //    } 
    492425    private void initLayout() 
    493426    { 
Note: See TracChangeset for help on using the changeset viewer.