- Timestamp:
- 03/13/2019 10:07:54 AM (7 years ago)
- Location:
- trunk/src/tmcsim
- Files:
-
- 7 edited
-
application.properties (modified) (1 diff)
-
cadsimulator/Coordinator.java (modified) (1 diff)
-
client/CADClient.java (modified) (1 diff)
-
client/cadclientgui/data/CADData.java (modified) (1 diff)
-
client/cadclientgui/data/Incident.java (modified) (1 diff)
-
client/cadclientgui/screens/IncidentViewer.java (modified) (2 diffs)
-
common/SimulationException.java (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/tmcsim/application.properties
r291 r310 1 # Sat, 02 Mar 2019 15:51:02 -08001 #Wed, 13 Mar 2019 10:54:57 -0700 2 2 3 Application.revision= 2893 Application.revision=306 4 4 5 Application.buildnumber=10 25 Application.buildnumber=107 -
trunk/src/tmcsim/cadsimulator/Coordinator.java
r200 r310 500 500 501 501 CADServer.theIncidentMgr.addIncident(newIncident); 502 502 cadData.addIncident(newIncident); // fixes #102 503 503 if (simMgr != null) 504 504 { -
trunk/src/tmcsim/client/CADClient.java
r33 r310 287 287 theCoorInt.registerForCallback(this); 288 288 } catch (Exception e) { 289 throw new SimulationException(SimulationException.CAD_SIM_CONNECT, 289 throw new SimulationException(SimulationException.CAD_SIM_CONNECT,hostname, 290 290 e); 291 291 } -
trunk/src/tmcsim/client/cadclientgui/data/CADData.java
r66 r310 155 155 incidents = incident; 156 156 } 157 157 /** 158 * Add a single new incident to the list of incidents. Fixes #102 159 * @param incident a single new incident to be added 160 * @author jdalbey 161 */ 162 public void addIncident(Incident incident) 163 { 164 incidents.add(incident); 165 } 166 158 167 /** 159 168 * Returns the specified unitNum -
trunk/src/tmcsim/client/cadclientgui/data/Incident.java
r59 r310 263 263 264 264 public Long getIncidentLength() { 265 if (eventList.size() == 0) return 0L; 265 266 return eventList.lastElement().secondsToOccurInIncident 266 267 - eventList.firstElement().secondsToOccurInIncident; -
trunk/src/tmcsim/client/cadclientgui/screens/IncidentViewer.java
r288 r310 387 387 private void saveComment(String commentMsg) 388 388 { 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 } 411 410 } 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 450 412 private void initControllers() 451 413 { … … 461 423 } 462 424 463 /**464 * A custom renderer that sets a tool tip with the wrapped comment. JD465 */466 // Obsolete JD467 // class LineWrapRenderer extends DefaultTableCellRenderer468 // {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 tooltip476 // 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 break488 // }489 // toolTip.append("</html>");490 // return toolTip.toString();491 // }492 425 private void initLayout() 493 426 { -
trunk/src/tmcsim/common/SimulationException.java
r2 r310 19 19 * Error Message: "Unable to connect to the CAD Simulator." 20 20 */ 21 public static final String CAD_SIM_CONNECT = "Unable to connect to the CAD Simulator."; 21 public static final String CAD_SIM_CONNECT = "Unable to connect to the CAD Server. "+ 22 "Check that server is running at "; 22 23 23 24 /** … … 25 26 * Error Message: "Unable to communicate with the CAD Simulator." 26 27 */ 27 public static final String CAD_SIM_COMM = "Unable to communicate with the CAD S imulator.";28 public static final String CAD_SIM_COMM = "Unable to communicate with the CAD Server."; 28 29 29 30 /** … … 50 51 * Error Message: "Unable to connect to the CAD Simulator." 51 52 */ 52 public static final String NULL_VIEW = "Unable to connect to the CAD S imulator.";53 public static final String NULL_VIEW = "Unable to connect to the CAD Server."; 53 54 54 55 /**
Note: See TracChangeset
for help on using the changeset viewer.
