Changeset 33 in tmcsimulator for trunk/src/tmcsim/paramicscommunicator


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/paramicscommunicator/ParamicsCommunicator.java

    r26 r33  
    1919import java.util.logging.Level; 
    2020import java.util.logging.Logger; 
     21 
    2122import javax.swing.JOptionPane; 
    2223import javax.swing.UIManager; 
     24 
    2325import org.w3c.dom.Document; 
    2426import org.w3c.dom.Element; 
     27 
    2528import tmcsim.common.CADProtocol.PARAMICS_ACTIONS; 
    2629import tmcsim.common.CADProtocol.PARAMICS_COMM_TAGS; 
     
    6063{ 
    6164 
    62     /** 
     65    private static final String CONFIG_FILE_NAME = "paramics_communicator_config.properties"; 
     66        /** 
    6367     * Error logger. 
    6468     */ 
     
    480484     * @param args Command line arguments. 
    481485     */ 
    482     public static void main(String[] args) 
    483     { 
    484         System.setProperty("PARAMICS_COMM_PROPERTIES", "config/paramics_communicator_config.properties"); 
    485  
    486         try 
    487         { 
    488             if (System.getProperty("PARAMICS_COMM_PROPERTIES") != null) 
    489             { 
    490                 UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); 
    491  
    492                 new Thread(new ParamicsCommunicator(System.getProperty( 
    493                         "PARAMICS_COMM_PROPERTIES"))).start(); 
    494             } else 
    495             { 
    496                 throw new Exception("PARAMICS_COMM_PROPERTIES system property not defined."); 
    497             } 
    498         } catch (Exception e) 
    499         { 
     486    public static void main(String[] args) { 
     487        if(System.getProperty("CONFIG_DIR") == null){ 
     488                System.setProperty("CONFIG_DIR", "config"); 
     489        } 
     490         
     491        try{ 
     492 
     493                UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); 
     494            new Thread(new ParamicsCommunicator(System.getProperty("CONFIG_DIR") + System.getProperty("file.separator") + CONFIG_FILE_NAME)).start(); 
     495         
     496        } catch (Exception e) { 
    500497            paramLogger.logp(Level.SEVERE, "ParamicsCommunicator", "Main", 
    501498                    "Error occured initializing application", e); 
Note: See TracChangeset for help on using the changeset viewer.