Search in sources :

Example 11 with AROUIPanelException

use of com.att.aro.ui.exception.AROUIPanelException in project VideoOptimzer by attdevsupport.

the class StatisticsTab method layoutEnergyEffecencySimulation.

/**
 * 3G, LTE, and WiFi render different attributes for the energy sub-panel on the statics tab.
 * This takes care of ensuring the right ones are used.
 *
 * @param rrcStateMachineType
 */
private void layoutEnergyEffecencySimulation(RrcStateMachineType rrcStateMachineType) {
    switch(rrcStateMachineType) {
        case Type3G:
            energyModelStatistics3GPanel = new EnergyModelStatistics3GPanel();
            if (energyModelStatisticsLTEPanel != null) {
                mainPanel.remove(energyModelStatisticsLTEPanel);
            }
            if (energyModelStatisticsWiFiPanel != null) {
                mainPanel.remove(energyModelStatisticsWiFiPanel);
            }
            energyModelStatisticsLTEPanel = null;
            energyModelStatisticsWiFiPanel = null;
            mainPanel.add(energyModelStatistics3GPanel, new GridBagConstraints(0, 15, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(10, 10, 10, 10), 0, 0));
            break;
        case LTE:
            energyModelStatisticsLTEPanel = new EnergyModelStatisticsLTEPanel();
            if (energyModelStatistics3GPanel != null) {
                mainPanel.remove(energyModelStatistics3GPanel);
            }
            if (energyModelStatisticsWiFiPanel != null) {
                mainPanel.remove(energyModelStatisticsWiFiPanel);
            }
            energyModelStatistics3GPanel = null;
            energyModelStatisticsWiFiPanel = null;
            mainPanel.add(energyModelStatisticsLTEPanel, new GridBagConstraints(0, 15, 1, 1, 1.0, 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(10, 10, 10, 10), 0, 0));
            break;
        case WiFi:
            energyModelStatisticsWiFiPanel = new EnergyModelStatisticsWiFiPanel();
            if (energyModelStatistics3GPanel != null) {
                mainPanel.remove(energyModelStatistics3GPanel);
            }
            if (energyModelStatisticsLTEPanel != null) {
                mainPanel.remove(energyModelStatisticsLTEPanel);
            }
            energyModelStatistics3GPanel = null;
            energyModelStatisticsLTEPanel = null;
            mainPanel.add(energyModelStatisticsWiFiPanel, new GridBagConstraints(0, 15, 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) EnergyModelStatistics3GPanel(com.att.aro.ui.view.statistics.energy.EnergyModelStatistics3GPanel) EnergyModelStatisticsLTEPanel(com.att.aro.ui.view.statistics.energy.EnergyModelStatisticsLTEPanel) AROUIPanelException(com.att.aro.ui.exception.AROUIPanelException) EnergyModelStatisticsWiFiPanel(com.att.aro.ui.view.statistics.energy.EnergyModelStatisticsWiFiPanel)

Aggregations

AROUIPanelException (com.att.aro.ui.exception.AROUIPanelException)11 JLabel (javax.swing.JLabel)4 PacketAnalyzerResult (com.att.aro.core.packetanalysis.pojo.PacketAnalyzerResult)2 Cursor (java.awt.Cursor)2 GridBagConstraints (java.awt.GridBagConstraints)2 Insets (java.awt.Insets)2 AbstractBestPracticeResult (com.att.aro.core.bestpractice.pojo.AbstractBestPracticeResult)1 CacheControlResult (com.att.aro.core.bestpractice.pojo.CacheControlResult)1 ConnectionClosingResult (com.att.aro.core.bestpractice.pojo.ConnectionClosingResult)1 DuplicateContentResult (com.att.aro.core.bestpractice.pojo.DuplicateContentResult)1 PeriodicTransferResult (com.att.aro.core.bestpractice.pojo.PeriodicTransferResult)1 UnnecessaryConnectionResult (com.att.aro.core.bestpractice.pojo.UnnecessaryConnectionResult)1 UsingCacheResult (com.att.aro.core.bestpractice.pojo.UsingCacheResult)1 AbstractRrcStateMachine (com.att.aro.core.packetanalysis.pojo.AbstractRrcStateMachine)1 BurstAnalysisInfo (com.att.aro.core.packetanalysis.pojo.BurstAnalysisInfo)1 CacheEntry (com.att.aro.core.packetanalysis.pojo.CacheEntry)1 Diagnosis (com.att.aro.core.packetanalysis.pojo.Diagnosis)1 RrcStateMachine3G (com.att.aro.core.packetanalysis.pojo.RrcStateMachine3G)1 RrcStateMachineLTE (com.att.aro.core.packetanalysis.pojo.RrcStateMachineLTE)1 Statistic (com.att.aro.core.packetanalysis.pojo.Statistic)1