Ignore:
Timestamp:
04/29/2016 12:55:04 AM (10 years ago)
Author:
bokumura
Message:

Directory Restructure: All system properties have been deprecated and replaced by the system property: "CONFIG_DIR". If CONFIG_DIR is not specified at run time, it will default to the "config/" directory.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/tmcsim/simulationmanager/SimulationManager.java

    r14 r33  
    99import java.util.logging.Level; 
    1010import java.util.logging.Logger; 
     11 
    1112import javax.swing.JOptionPane; 
    1213import javax.swing.UIManager; 
     14 
    1315import tmcsim.common.CADEnums.PARAMICS_STATUS; 
    1416import tmcsim.common.SimulationException; 
     
    4547{ 
    4648 
    47     /** 
     49    private static final String CONFIG_FILE_NAME = "sim_manager_config.properties"; 
     50        /** 
    4851     * Error logger. 
    4952     */ 
     
    193196     * @param args Command line arguments. 
    194197     */ 
    195     static public void main(String[] args) 
    196     { 
    197         //System.setProperty("SIM_MGR_PROPERTIES", "config/sim_manager_config.properties"); 
     198    static public void main(String[] args) { 
    198199        //System.setProperty("swing.defaultlaf", "com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel"); 
    199  
    200         try 
    201         { 
    202             if (System.getProperty("SIM_MGR_PROPERTIES") != null) 
    203             { 
    204                 UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); 
    205  
    206                 new SimulationManager(System.getProperty("SIM_MGR_PROPERTIES")); 
    207             } else 
    208             { 
    209                 throw new Exception("SIM_MGR_PROPERTIES system property not defined."); 
    210             } 
    211         } catch (Exception e) 
    212         { 
     200        if(System.getProperty("CONFIG_DIR") == null){ 
     201                System.setProperty("CONFIG_DIR", "config"); 
     202        } 
     203         
     204        try {            
     205                UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); 
     206            new SimulationManager(System.getProperty("CONFIG_DIR") + System.getProperty("file.separator") + CONFIG_FILE_NAME); 
     207        } catch (Exception e) { 
    213208            simManLogger.logp(Level.SEVERE, "SimulationManager", "Main", 
    214209                    "Error occured initializing application", e); 
Note: See TracChangeset for help on using the changeset viewer.