Changeset 365 in tmcsimulator for trunk/src/tmcsim/cadsimulator/viewer/CADServerViewer.java
- Timestamp:
- 04/11/2019 07:01:03 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/tmcsim/cadsimulator/viewer/CADServerViewer.java
r230 r365 23 23 import tmcsim.cadsimulator.viewer.model.CADSimulatorStatus; 24 24 import tmcsim.interfaces.CADViewer; 25 import tmcsim.common.RevisionNumber; 25 26 26 27 /** … … 64 65 { 65 66 super(); 66 setTitle("CAD Server " + getAppVersion());67 setTitle("CAD Server " + RevisionNumber.getAppVersion()); 67 68 68 69 initComponents(); 69 70 } 70 71 71 /** 72 * Read the version number from the application properties. The file 73 * 'application.properties' is generated by build.xml. 74 * 75 * @return a version string obtained from application.properties file, or 76 * "Version: unknown" if an IOerror prevents us from reading the file. 77 */ 78 private String getAppVersion() 79 { 80 String propfilename = "/tmcsim/application.properties"; 81 String propKey = "Application.revision"; 82 String version = "unknown"; 83 try 84 { 85 Properties props = new Properties(); 86 props.load(this.getClass().getResourceAsStream(propfilename)); 87 version = (String) props.get(propKey); 88 } catch (IOException ex) 89 { 90 Logger.getLogger("tmcsim/cadsimulator").log(Level.SEVERE, 91 "CADSimulatorView.getAppVersion()." 92 + " IOError reading " + propfilename); 93 } catch (NullPointerException npe) 94 { 95 Logger.getLogger("tmcsim/cadsimulator").log(Level.SEVERE, 96 "CADSimulatorView.getAppVersion().load." 97 + " Missing file: " + propfilename); 98 } 99 return "revision: " + version; 100 } 72 101 73 102 74 /**
Note: See TracChangeset
for help on using the changeset viewer.
