Ignore:
Timestamp:
04/11/2019 07:01:03 PM (7 years ago)
Author:
jdalbey
Message:

RevisionNumber?.java, SimulationManagerView?.java : Fix defect #119

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/tmcsim/cadsimulator/viewer/CADServerViewer.java

    r230 r365  
    2323import tmcsim.cadsimulator.viewer.model.CADSimulatorStatus; 
    2424import tmcsim.interfaces.CADViewer; 
     25import tmcsim.common.RevisionNumber; 
    2526 
    2627/** 
     
    6465    { 
    6566        super(); 
    66         setTitle("CAD Server " + getAppVersion()); 
     67        setTitle("CAD Server " + RevisionNumber.getAppVersion()); 
    6768 
    6869        initComponents(); 
    6970    } 
    7071 
    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 
    10173 
    10274    /** 
Note: See TracChangeset for help on using the changeset viewer.