Changeset 19 in tmcsimulator for trunk/src


Ignore:
Timestamp:
04/24/2016 11:53:49 AM (10 years ago)
Author:
jdalbey
Message:

Add unit test for CADSimulator GUI

File:
1 edited

Legend:

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

    r5 r19  
    99import java.util.logging.LogRecord; 
    1010import java.util.logging.Logger; 
    11  
    1211import javax.swing.BorderFactory; 
    1312import javax.swing.Box; 
     
    2019import javax.swing.border.EtchedBorder; 
    2120import javax.swing.border.TitledBorder; 
    22  
    2321import tmcsim.common.CADEnums.PARAMICS_STATUS; 
    2422import tmcsim.common.CADEnums.SCRIPT_STATUS; 
    2523 
    2624/** 
    27  * SimulationStatusPanel is a GUI object used for displaying information 
    28  * for the current simulation. This information includes: 
    29  *  
     25 * SimulationStatusPanel is a GUI object used for displaying information for the 
     26 * current simulation. This information includes: 
     27 * 
    3028 * <ul> 
    3129 * <li>Current simulation time.</li> 
     
    3836 * <li>Error log messages</li> 
    3937 * </ul> 
    40  *  
     38 * 
    4139 * @author Matthew Cechini 
    4240 * @version 
    4341 */ 
    4442@SuppressWarnings("serial") 
    45 public class SimulationStatusPanel extends JPanel { 
    46  
    47     /** 
    48      * Logging Handler to listen for Information and Error 
    49      * messages logged for the CAD Simulator.  Received LogRecords 
    50      * are displayed in the info or error message Text Area. 
    51      *  
     43public class SimulationStatusPanel extends JPanel 
     44{ 
     45 
     46    /** 
     47     * Logging Handler to listen for Information and Error messages logged for 
     48     * the CAD Simulator. Received LogRecords are displayed in the info or error 
     49     * message Text Area. 
     50     * 
    5251     * @author Matthew Cechini 
    5352     */ 
    54     private class SimulatorErrorHandler extends Handler { 
    55         public void close() throws SecurityException { }  
    56         public void flush() { } 
    57         public void publish(LogRecord rec) { 
     53    private class SimulatorErrorHandler extends Handler 
     54    { 
     55 
     56        public void close() throws SecurityException 
     57        { 
     58        } 
     59 
     60        public void flush() 
     61        { 
     62        } 
     63 
     64        public void publish(LogRecord rec) 
     65        { 
    5866            StringBuffer msgBuffer = new StringBuffer(); 
    5967 
    60             msgBuffer.append(rec.getSourceClassName() + "." +  
    61                 rec.getSourceMethodName() + " = " +  
    62                 rec.getMessage()); 
    63              
    64             if(rec.getLevel() == Level.INFO) 
    65                 infoMessagesTA.setText(infoMessagesTA.getText() +  
    66                     msgBuffer.toString() + "\n"); 
    67             else  
    68                 errorMessagesTA.setText(errorMessagesTA.getText() +  
    69                         msgBuffer.toString() + "\n"); 
    70         } 
    71     } 
    72      
    73     /** Count of how many CAD clients have connected. */ 
     68            msgBuffer.append(rec.getSourceClassName() + "." 
     69                    + rec.getSourceMethodName() + " = " 
     70                    + rec.getMessage()); 
     71 
     72            if (rec.getLevel() == Level.INFO) 
     73            { 
     74                infoMessagesTA.setText(infoMessagesTA.getText() 
     75                        + msgBuffer.toString() + "\n"); 
     76            } else 
     77            { 
     78                errorMessagesTA.setText(errorMessagesTA.getText() 
     79                        + msgBuffer.toString() + "\n"); 
     80            } 
     81        } 
     82    } 
     83    /** 
     84     * Count of how many CAD clients have connected. 
     85     */ 
    7486    private int numClientsConnected = 0; 
    75      
    76     /** Logging ErrorHandler. */ 
     87    /** 
     88     * Logging ErrorHandler. 
     89     */ 
    7790    private SimulatorErrorHandler errorHandler; 
    78      
    79     /** 
    80      * Constructor.  Initialize GUI Objects.  Register the logging handler 
    81      * to listen for log records from all loggers that exist in the 
     91 
     92    /** 
     93     * Constructor. Initialize GUI Objects. Register the logging handler to 
     94     * listen for log records from all loggers that exist in the 
    8295     * "tmcsim.cadsimulator" package structure. 
    83      */  
    84     public SimulationStatusPanel() { 
    85          
     96     */ 
     97    public SimulationStatusPanel() 
     98    { 
     99 
    86100        initTimeAndStatus(); 
    87         initAdditionalInfo();    
     101        initAdditionalInfo(); 
    88102        initMessagesPanes(); 
    89          
    90         errorHandler = new SimulatorErrorHandler();      
    91         Logger.getLogger("tmcsim.cadsimulator").addHandler(errorHandler);        
    92          
     103 
     104        errorHandler = new SimulatorErrorHandler(); 
     105        Logger.getLogger("tmcsim.cadsimulator").addHandler(errorHandler); 
     106 
    93107        CADSimulatorViewerBox = Box.createVerticalBox(); 
    94108        CADSimulatorViewerBox.add(simulationTimeAndStatusBox); 
     
    96110        CADSimulatorViewerBox.add(infoMessagesPane); 
    97111        CADSimulatorViewerBox.add(errorMessagesPane); 
    98          
    99         add(CADSimulatorViewerBox);  
    100     }    
    101  
    102     /**  
    103      * Method is called when a CAD Client disconnects from the CAD Simulator.   
     112 
     113        add(CADSimulatorViewerBox); 
     114    } 
     115 
     116    /** 
     117     * Method is called when a CAD Client disconnects from the CAD Simulator. 
    104118     * The displayed number of connected clients is incremented by one. 
    105119     */ 
    106     public void connectClient() { 
    107          
     120    public void connectClient() 
     121    { 
     122 
    108123        numClientsConnected++; 
    109                      
    110         termConnectedTF.setText(String.valueOf(numClientsConnected));        
    111     } 
    112      
    113     /**  
    114      * Method is called when a CAD Client disconnects from the CAD Simulator.   
     124 
     125        termConnectedTF.setText(String.valueOf(numClientsConnected)); 
     126    } 
     127 
     128    /** 
     129     * Method is called when a CAD Client disconnects from the CAD Simulator. 
    115130     * The displayed number of connected clients is decremented by one. 
    116131     */ 
    117     public void disconnectClient() { 
    118          
    119         if(numClientsConnected > 0) 
     132    public void disconnectClient() 
     133    { 
     134 
     135        if (numClientsConnected > 0) 
     136        { 
    120137            numClientsConnected--; 
    121                      
     138        } 
     139 
    122140        termConnectedTF.setText(String.valueOf(numClientsConnected)); 
    123141    } 
    124      
     142 
    125143    /** 
    126144     * Method is called when Simulation Manager connects or disconnects. 
     
    128146     * @param connection True if simulation manager is connected, false if not. 
    129147     */ 
    130     public void setSimManagerStatus(boolean connection) { 
    131          
    132         if(connection)  
    133             managerConnectedTF.setText("Yes");       
    134         else 
     148    public void setSimManagerStatus(boolean connection) 
     149    { 
     150 
     151        if (connection) 
     152        { 
     153            managerConnectedTF.setText("Yes"); 
     154        } else 
     155        { 
    135156            managerConnectedTF.setText("No"); 
    136          
    137     } 
    138      
    139     /** 
    140      * Method called to convert current simulation time (parameter long value) to 
    141      * a string of format H:MM:SS. Time is then updated on GUI. 
     157        } 
     158 
     159    } 
     160 
     161    /** 
     162     * Method called to convert current simulation time (parameter long value) 
     163     * to a string of format H:MM:SS. Time is then updated on GUI. 
    142164     * 
    143165     * @param seconds Long value of current time 
    144166     */ 
    145     public void setTime(long seconds) {      
    146         String time = new String();      
    147         long timeSegment;    
    148          
     167    public void setTime(long seconds) 
     168    { 
     169        String time = new String(); 
     170        long timeSegment; 
     171 
    149172        timeSegment = seconds / 3600; 
    150         time += String.valueOf(timeSegment) + ":";       
    151          
     173        time += String.valueOf(timeSegment) + ":"; 
     174 
    152175        seconds = seconds % 3600; 
    153          
     176 
    154177        timeSegment = seconds / 60; 
    155         if(timeSegment < 10) 
     178        if (timeSegment < 10) 
     179        { 
    156180            time += "0"; 
    157          
    158         time += String.valueOf(timeSegment) + ":";       
    159         seconds = seconds % 60;  
    160          
     181        } 
     182 
     183        time += String.valueOf(timeSegment) + ":"; 
     184        seconds = seconds % 60; 
     185 
    161186        timeSegment = seconds; 
    162         if(timeSegment < 10) 
     187        if (timeSegment < 10) 
     188        { 
    163189            time += "0"; 
    164          
     190        } 
     191 
    165192        time += String.valueOf(timeSegment); 
    166          
    167         simulationClockLabel.setText(time);      
    168          
    169     } 
    170      
    171     /** 
    172      * This method is called within the CADSimulator whenever an error occurs.  The message 
    173      * is then displayed to the user in the "Error Messages" portion of the CAD Simulator Viewer. 
    174      * Invoke method with null parameter to clear messages. 
     193 
     194        simulationClockLabel.setText(time); 
     195 
     196    } 
     197 
     198    /** 
     199     * This method is called within the CADSimulator whenever an error occurs. 
     200     * The message is then displayed to the user in the "Error Messages" portion 
     201     * of the CAD Simulator Viewer. Invoke method with null parameter to clear 
     202     * messages. 
    175203     * 
    176204     * @param errorMessage String message that will be displayed 
    177205     */ 
    178     protected void displayError(String errorMessage) { 
    179         if(errorMessage == null) 
     206    protected void displayError(String errorMessage) 
     207    { 
     208        if (errorMessage == null) 
     209        { 
    180210            errorMessagesTA.setText(""); 
    181         else  
    182             errorMessagesTA.append(errorMessage + "\n");     
    183     } 
    184      
     211        } else 
     212        { 
     213            errorMessagesTA.append(errorMessage + "\n"); 
     214        } 
     215    } 
     216 
    185217    /** 
    186218     * Method is called to display the current status of the simulation. 
    187219     * 
    188      * @param newStatus Current status of simulation.  The following table describes 
    189      * each possible status and what is displayed.  Each status code is found 
    190      * as a public static int in the Coordinator Class. 
    191      * 
    192      *<table cellpadding="2" cellspacing="2" border="1" 
    193      * style="text-align: left; width: 250px;"> 
    194      *  <tbody> 
    195      *    <tr> 
    196      *      <th>Status<br></th> 
    197      *      <th>Actions Taken<br></th> 
    198      *    </tr> 
    199      *    <tr> 
    200      *      <td>NO_SCRIPT<br></td> 
    201      *      <td>Set the simulation status text to a black "No Script".  <br></td> 
    202      *    </tr> 
    203      *    <tr> 
    204      *      <td>SCRIPT_STOPPED_NOT_STARTED<br></td> 
    205      *      <td>Set the simulation status text to a red "Ready".  <br></td> 
    206      *    </tr> 
    207      *    <tr> 
    208      *      <td>SCRIPT_PAUSED_STARTED<br></td> 
    209      *      <td>Set the simulation status text to a red "Paused".  <br></td> 
    210      *    </tr> 
    211      *    <tr> 
    212      *      <td>SCRIPT_RUNNING<br></td> 
    213      *      <td>Set the simulation status text to a green "Running".  <br></td> 
    214      *    </tr> 
    215      *    <tr> 
    216      *      <td>ATMS_SYNCHRONIZATION<br></td> 
    217      *      <td>Set the simulation status text to an orange "Synchronizing".  <br></td> 
    218      *    </tr> 
    219      *  </tbody> 
    220      *</table>     */ 
    221     public void setScriptStatus(SCRIPT_STATUS newStatus) { 
    222          
    223         switch(newStatus) {      
     220     * @param newStatus Current status of simulation. The following table 
     221     * describes each possible status and what is displayed. Each status code is 
     222     * found as a public static int in the Coordinator Class. 
     223     * 
     224     * <table cellpadding="2" cellspacing="2" border="1" style="text-align: 
     225     * left; width: 250px;"> 
     226     * <tbody> 
     227     * <tr> 
     228     * <th>Status<br></th> 
     229     * <th>Actions Taken<br></th> 
     230     * </tr> 
     231     * <tr> 
     232     * <td>NO_SCRIPT<br></td> 
     233     * <td>Set the simulation status text to a black "No Script". <br></td> 
     234     * </tr> 
     235     * <tr> 
     236     * <td>SCRIPT_STOPPED_NOT_STARTED<br></td> 
     237     * <td>Set the simulation status text to a red "Ready". <br></td> 
     238     * </tr> 
     239     * <tr> 
     240     * <td>SCRIPT_PAUSED_STARTED<br></td> 
     241     * <td>Set the simulation status text to a red "Paused". <br></td> 
     242     * </tr> 
     243     * <tr> 
     244     * <td>SCRIPT_RUNNING<br></td> 
     245     * <td>Set the simulation status text to a green "Running". <br></td> 
     246     * </tr> 
     247     * <tr> 
     248     * <td>ATMS_SYNCHRONIZATION<br></td> 
     249     * <td>Set the simulation status text to an orange "Synchronizing". 
     250     * <br></td> 
     251     * </tr> 
     252     * </tbody> 
     253     * </table> 
     254     */ 
     255    public void setScriptStatus(SCRIPT_STATUS newStatus) 
     256    { 
     257 
     258        switch (newStatus) 
     259        { 
    224260            case NO_SCRIPT: 
    225261                simulationStatusText.setText("No Script"); 
    226                 simulationStatusText.setForeground(Color.BLACK);                                             
    227                 break;           
    228                  
     262                simulationStatusText.setForeground(Color.BLACK); 
     263                break; 
     264 
    229265            case SCRIPT_STOPPED_NOT_STARTED: 
    230266                simulationStatusText.setText("Ready"); 
    231                 simulationStatusText.setForeground(Color.RED);           
    232                 break;           
    233                  
     267                simulationStatusText.setForeground(Color.RED); 
     268                break; 
     269 
    234270            case SCRIPT_PAUSED_STARTED: 
    235271                simulationStatusText.setText("Paused"); 
    236272                simulationStatusText.setForeground(Color.RED); 
    237273                break; 
    238                  
     274 
    239275            case SCRIPT_RUNNING: 
    240276                simulationStatusText.setText("Running"); 
     
    245281                simulationStatusText.setForeground(Color.ORANGE); 
    246282                break; 
    247              
    248         }    
    249     } 
    250      
     283 
     284        } 
     285    } 
     286 
    251287    /** 
    252288     * Method is called when a connection to paramics is made or dropped. 
    253289     * 
    254      * @param newStatus The status denoting whether a connection has been 
    255      * made or dropped. 
    256      */ 
    257     public void setParamicsStatus(PARAMICS_STATUS newStatus) { 
    258          
    259         switch(newStatus) { 
     290     * @param newStatus The status denoting whether a connection has been made 
     291     * or dropped. 
     292     */ 
     293    public void setParamicsStatus(PARAMICS_STATUS newStatus) 
     294    { 
     295 
     296        switch (newStatus) 
     297        { 
    260298            case CONNECTED: 
    261299                paramicsConnectedTF.setText("Yes"); 
    262300                break; 
    263301            case DISCONNECTED: 
    264                 paramicsConnectedTF.setText("No");           
    265                 break; 
    266         } 
    267     } 
    268      
     302                paramicsConnectedTF.setText("No"); 
     303                break; 
     304        } 
     305    } 
     306 
    269307    /** 
    270308     * Method is called when a paramics network is loaded. 
     
    272310     * @param networkID Unique ID for Paramics network that has been loaded. 
    273311     */ 
    274     public void setParamicsNetworkLoaded(String networkID) { 
     312    public void setParamicsNetworkLoaded(String networkID) 
     313    { 
    275314        networkLoadedTF.setText(networkID); 
    276     }     
    277      
    278          
    279     /** Initialize Time and Status GUI Components */ 
    280     private void initTimeAndStatus() { 
    281          
    282         simulationTime        = new JPanel(); 
    283         simulationClock      = new JPanel(); 
    284         simulationStatus     = new JLabel("Simulation Status"); 
     315    } 
     316 
     317    /** 
     318     * Initialize Time and Status GUI Components 
     319     */ 
     320    private void initTimeAndStatus() 
     321    { 
     322 
     323        simulationTime = new JPanel(); 
     324        simulationClock = new JPanel(); 
     325        simulationStatus = new JLabel("Simulation Status"); 
    285326        simulationStatusText = new JLabel("No Script"); 
    286          
    287         simulationTime.setLayout(new BorderLayout());        
     327 
     328        simulationTime.setLayout(new BorderLayout()); 
    288329        simulationClock.setPreferredSize(new Dimension(100, 60)); 
    289330        simulationTimeAndStatusBox = new Box(BoxLayout.X_AXIS); 
    290         simulationStatusBox = new Box(BoxLayout.Y_AXIS);         
    291         simulationTimeBox   = new Box(BoxLayout.Y_AXIS); 
    292         simulationClockBox  = new Box(BoxLayout.X_AXIS); 
    293          
     331        simulationStatusBox = new Box(BoxLayout.Y_AXIS); 
     332        simulationTimeBox = new Box(BoxLayout.Y_AXIS); 
     333        simulationClockBox = new Box(BoxLayout.X_AXIS); 
     334 
    294335        simulationStatus.setAlignmentX(Box.CENTER_ALIGNMENT); 
    295336        simulationStatusText.setAlignmentX(Box.CENTER_ALIGNMENT); 
    296337        simulationStatusText.setName("simulationStatusText"); 
    297          
     338 
    298339        TitledBorder title = BorderFactory.createTitledBorder( 
    299340                BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), "Status"); 
    300341        title.setTitleJustification(TitledBorder.LEFT); 
    301342        simulationStatusBox.setBorder(title); 
    302          
     343 
    303344        simulationStatusBox.setMaximumSize(new Dimension(140, 60)); 
    304         simulationStatusBox.setAlignmentX(Box.CENTER_ALIGNMENT);                     
    305          
     345        simulationStatusBox.setAlignmentX(Box.CENTER_ALIGNMENT); 
     346 
    306347        simulationStatusBox.add(Box.createHorizontalStrut(120)); 
    307348        simulationStatusBox.add(Box.createVerticalGlue()); 
    308349        simulationStatusBox.add(simulationStatusText); 
    309350        simulationStatusBox.add(Box.createVerticalGlue()); 
    310          
     351 
    311352        simulationClockLabel = new JLabel("0:00:00"); 
    312353        simulationClockLabel.setFont(new Font("Geneva", Font.BOLD, 70)); 
     354        simulationClockLabel.setName("simulationClockLabel"); 
    313355        simulationClockLabel.setForeground(Color.BLACK); 
    314356        simulationClockLabel.setBackground(Color.BLACK); 
     
    316358        simulationClockBox.setBackground(Color.BLACK); 
    317359        simulationClockBox.add(simulationClockLabel); 
    318         simulationClockBox.setAlignmentX(Box.CENTER_ALIGNMENT);  
     360        simulationClockBox.setAlignmentX(Box.CENTER_ALIGNMENT); 
    319361        simulationTimeBox.add(simulationClockBox); 
    320                  
    321         simulationTimeAndStatusBox.add(Box.createHorizontalStrut(20));               
     362 
     363        simulationTimeAndStatusBox.add(Box.createHorizontalStrut(20)); 
    322364        simulationTimeAndStatusBox.add(simulationTimeBox); 
    323365        simulationTimeAndStatusBox.add(Box.createHorizontalStrut(20)); 
    324         simulationTimeAndStatusBox.add(simulationStatusBox);         
    325         simulationTimeAndStatusBox.add(Box.createHorizontalStrut(20));           
    326     } 
    327      
    328      
    329     /** Initialize Additional Info Label GUI Components */ 
    330     private void initAdditionalInfo() { 
    331          
     366        simulationTimeAndStatusBox.add(simulationStatusBox); 
     367        simulationTimeAndStatusBox.add(Box.createHorizontalStrut(20)); 
     368    } 
     369 
     370    /** 
     371     * Initialize Additional Info Label GUI Components 
     372     */ 
     373    private void initAdditionalInfo() 
     374    { 
     375 
    332376        terminalsConnectedLabel = new JLabel("Connected CAD Terminals: "); 
    333         termConnectedTF  = new JTextField("   " + String.valueOf(numClientsConnected)); 
     377        termConnectedTF = new JTextField("   " + String.valueOf(numClientsConnected)); 
    334378        termConnectedTF.setEditable(false); 
    335379        termConnectedTF.setName("termConnectedTF"); 
    336          
     380 
    337381        termConnectedBox = new Box(BoxLayout.X_AXIS); 
    338382        termConnectedBox.add(terminalsConnectedLabel); 
    339383        termConnectedBox.add(Box.createHorizontalGlue()); 
    340384        termConnectedBox.add(termConnectedTF); 
    341          
    342          
    343         managerConnectedLabel     = new JLabel("Simulation Manager Connected: "); 
     385 
     386 
     387        managerConnectedLabel = new JLabel("Simulation Manager Connected: "); 
    344388        managerConnectedTF = new JTextField("  No"); 
    345389        managerConnectedTF.setEditable(false); 
    346390        managerConnectedTF.setName("managerConnectedTF"); 
    347                  
     391 
    348392        managerConnectedBox = new Box(BoxLayout.X_AXIS); 
    349393        managerConnectedBox.add(managerConnectedLabel); 
    350394        managerConnectedBox.add(Box.createHorizontalGlue()); 
    351395        managerConnectedBox.add(managerConnectedTF); 
    352          
    353          
    354         paramicsConnectedLabel     = new JLabel("Connected to Paramics: "); 
     396 
     397 
     398        paramicsConnectedLabel = new JLabel("Connected to Paramics: "); 
    355399        paramicsConnectedTF = new JTextField("  No"); 
    356400        paramicsConnectedTF.setEditable(false); 
    357                  
     401        paramicsConnectedTF.setName("paramicsConnectedTF"); 
     402 
    358403        paramicsConnectedBox = new Box(BoxLayout.X_AXIS); 
    359404        paramicsConnectedBox.add(paramicsConnectedLabel); 
    360405        paramicsConnectedBox.add(Box.createHorizontalGlue()); 
    361406        paramicsConnectedBox.add(paramicsConnectedTF); 
    362          
    363          
    364         networkLoadedLabel     = new JLabel("Network Loaded: "); 
    365         networkLoadedTF = new JTextField("None");        
     407 
     408 
     409        networkLoadedLabel = new JLabel("Network Loaded: "); 
     410        networkLoadedTF = new JTextField("None"); 
    366411        networkLoadedTF.setEditable(false); 
    367                  
     412        networkLoadedTF.setName("networkLoadedTF"); 
     413 
    368414        networkLoadedBox = new Box(BoxLayout.X_AXIS); 
    369415        networkLoadedBox.add(networkLoadedLabel); 
    370416        networkLoadedBox.add(Box.createHorizontalGlue()); 
    371417        networkLoadedBox.add(networkLoadedTF); 
    372          
     418 
    373419 
    374420        additionalInfoBox = new Box(BoxLayout.Y_AXIS); 
    375         additionalInfoBox.setMinimumSize(new Dimension(300, 150));       
    376          
     421        additionalInfoBox.setMinimumSize(new Dimension(300, 150)); 
     422 
    377423        additionalInfoBox.add(Box.createVerticalStrut(10)); 
    378         additionalInfoBox.add(termConnectedBox);     
     424        additionalInfoBox.add(termConnectedBox); 
    379425        additionalInfoBox.add(Box.createVerticalStrut(10)); 
    380         additionalInfoBox.add(managerConnectedBox);  
     426        additionalInfoBox.add(managerConnectedBox); 
    381427        additionalInfoBox.add(Box.createVerticalStrut(10)); 
    382         additionalInfoBox.add(paramicsConnectedBox);     
     428        additionalInfoBox.add(paramicsConnectedBox); 
    383429        additionalInfoBox.add(Box.createVerticalStrut(10)); 
    384         additionalInfoBox.add(networkLoadedBox);     
    385         additionalInfoBox.add(Box.createVerticalStrut(20));  
    386          
    387              
    388     } 
    389      
    390     /**  Initialize Info & Error Messages GUI Components */ 
    391     private void initMessagesPanes() { 
     430        additionalInfoBox.add(networkLoadedBox); 
     431        additionalInfoBox.add(Box.createVerticalStrut(20)); 
     432 
     433 
     434    } 
     435 
     436    /** 
     437     * Initialize Info & Error Messages GUI Components 
     438     */ 
     439    private void initMessagesPanes() 
     440    { 
    392441 
    393442        infoMessagesTA = new JTextArea(6, 30); 
     
    396445        infoMessagesPane = new JScrollPane(infoMessagesTA); 
    397446        infoMessagesPane.setPreferredSize(new Dimension(300, 100)); 
    398          
     447        infoMessagesPane.setName("infoMessagesPane"); 
    399448        infoMessagesPane.setBorder(BorderFactory.createTitledBorder( 
    400                 BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), "Info Messages"));   
     449                BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), "Info Messages")); 
    401450        infoMessagesPane.setName("infoMessagesPane"); 
    402          
     451 
    403452        errorMessagesTA = new JTextArea(6, 30); 
    404453        errorMessagesTA.setForeground(Color.RED); 
    405454        errorMessagesTA.setEditable(false); 
     455        errorMessagesTA.setName("errorMessagesTA"); 
    406456        errorMessagesPane = new JScrollPane(errorMessagesTA); 
    407457        errorMessagesPane.setPreferredSize(new Dimension(300, 150)); 
    408          
     458        errorMessagesPane.setName("errorMessagesPane"); 
    409459        errorMessagesPane.setBorder(BorderFactory.createTitledBorder( 
    410                 BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), "Error Messages"));  
    411      
    412     } 
    413      
    414          
     460                BorderFactory.createEtchedBorder(EtchedBorder.LOWERED), "Error Messages")); 
     461 
     462    } 
    415463    private Box additionalInfoBox; 
    416     private Box termConnectedBox;    
    417     private Box managerConnectedBox;     
     464    private Box termConnectedBox; 
     465    private Box managerConnectedBox; 
    418466    private Box paramicsConnectedBox; 
    419     private Box networkLoadedBox;    
     467    private Box networkLoadedBox; 
    420468    private Box CADSimulatorViewerBox; 
    421469    private Box simulationTimeAndStatusBox; 
    422     private Box simulationStatusBox;         
     470    private Box simulationStatusBox; 
    423471    private Box simulationTimeBox; 
    424472    private Box simulationClockBox; 
    425      
    426473    private JLabel managerConnectedLabel; 
    427     private JLabel paramicsConnectedLabel;   
     474    private JLabel paramicsConnectedLabel; 
    428475    private JLabel simulationStatus; 
    429476    private JLabel simulationClockLabel; 
    430477    private JLabel simulationStatusText; 
    431     private JLabel terminalsConnectedLabel;  
     478    private JLabel terminalsConnectedLabel; 
    432479    private JLabel networkLoadedLabel; 
    433      
    434480    private JPanel simulationTime; 
    435     private JPanel simulationClock;      
    436          
     481    private JPanel simulationClock; 
    437482    private JTextField managerConnectedTF; 
    438483    private JTextField paramicsConnectedTF; 
    439484    private JTextField termConnectedTF; 
    440485    private JTextField networkLoadedTF; 
    441          
    442486    private JScrollPane infoMessagesPane; 
    443487    private JScrollPane errorMessagesPane; 
    444  
    445488    private JTextArea infoMessagesTA; 
    446489    private JTextArea errorMessagesTA; 
Note: See TracChangeset for help on using the changeset viewer.