Search in sources :

Example 1 with RRCStateMachineSimulationPanelWiFi

use of com.att.aro.ui.view.statistics.statemachine.RRCStateMachineSimulationPanelWiFi in project VideoOptimzer by attdevsupport.

the class StatisticsTab method layoutRrcStateMachineSimulator.

/**
 * 3G, LTE, and WiFi render different attributes for the RRC sub-panel on the statics tab.
 * This takes care of ensuring the right ones are used.
 *
 * @param rrcStateMachineType
 */
private void layoutRrcStateMachineSimulator(RrcStateMachineType rrcStateMachineType) {
    switch(rrcStateMachineType) {
        case Type3G:
            rrcStateMachineSimulationPanel3G = new RRCStateMachineSimulationPanel3G();
            if (rrcStateMachineSimulationPanelLTE != null) {
                mainPanel.remove(rrcStateMachineSimulationPanelLTE);
            }
            if (rrcStateMachineSimulationPanelWiFi != null) {
                mainPanel.remove(rrcStateMachineSimulationPanelWiFi);
            }
            rrcStateMachineSimulationPanelLTE = null;
            rrcStateMachineSimulationPanelWiFi = null;
            mainPanel.add(rrcStateMachineSimulationPanel3G, new GridBagConstraints(0, 9, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(10, 10, 10, 10), 0, 0));
            break;
        case LTE:
            rrcStateMachineSimulationPanelLTE = new RRCStateMachineSimulationPanelLTE();
            if (rrcStateMachineSimulationPanel3G != null) {
                mainPanel.remove(rrcStateMachineSimulationPanel3G);
            }
            if (rrcStateMachineSimulationPanelWiFi != null) {
                mainPanel.remove(rrcStateMachineSimulationPanelWiFi);
            }
            rrcStateMachineSimulationPanel3G = null;
            rrcStateMachineSimulationPanelWiFi = null;
            mainPanel.add(rrcStateMachineSimulationPanelLTE, new GridBagConstraints(0, 9, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(10, 10, 10, 10), 0, 0));
            break;
        case WiFi:
            rrcStateMachineSimulationPanelWiFi = new RRCStateMachineSimulationPanelWiFi();
            if (rrcStateMachineSimulationPanel3G != null) {
                mainPanel.remove(rrcStateMachineSimulationPanel3G);
            }
            if (rrcStateMachineSimulationPanelLTE != null) {
                mainPanel.remove(rrcStateMachineSimulationPanelLTE);
            }
            rrcStateMachineSimulationPanel3G = null;
            rrcStateMachineSimulationPanelLTE = null;
            mainPanel.add(rrcStateMachineSimulationPanelWiFi, new GridBagConstraints(0, 9, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(10, 10, 10, 10), 0, 0));
            break;
        default:
            throw new AROUIPanelException("Energy render implementation not available.");
    }
}
Also used : GridBagConstraints(java.awt.GridBagConstraints) Insets(java.awt.Insets) AROUIPanelException(com.att.aro.ui.exception.AROUIPanelException) RRCStateMachineSimulationPanel3G(com.att.aro.ui.view.statistics.statemachine.RRCStateMachineSimulationPanel3G) RRCStateMachineSimulationPanelWiFi(com.att.aro.ui.view.statistics.statemachine.RRCStateMachineSimulationPanelWiFi) RRCStateMachineSimulationPanelLTE(com.att.aro.ui.view.statistics.statemachine.RRCStateMachineSimulationPanelLTE)

Aggregations

AROUIPanelException (com.att.aro.ui.exception.AROUIPanelException)1 RRCStateMachineSimulationPanel3G (com.att.aro.ui.view.statistics.statemachine.RRCStateMachineSimulationPanel3G)1 RRCStateMachineSimulationPanelLTE (com.att.aro.ui.view.statistics.statemachine.RRCStateMachineSimulationPanelLTE)1 RRCStateMachineSimulationPanelWiFi (com.att.aro.ui.view.statistics.statemachine.RRCStateMachineSimulationPanelWiFi)1 GridBagConstraints (java.awt.GridBagConstraints)1 Insets (java.awt.Insets)1