use of com.att.aro.core.datacollector.DataCollectorType in project VideoOptimzer by attdevsupport.
the class AttnrRadioGroupPanel method reselectPriorOptions.
public void reselectPriorOptions(AttenuatorModel attenuatorModel, boolean isIOS) {
DataCollectorType deviceType = deviceInfo.getCollector().getType();
switch(deviceType) {
case NON_ROOTED_ANDROID:
case IOS:
this.attenuatorModel = attenuatorModel;
attnrTTPanel.setAttenuatorModel(attenuatorModel);
attnrLoadPanel.setAttenuatorModel(attenuatorModel);
if (attenuatorModel.isConstantThrottle() && !attenuatorModel.isFreeThrottle()) {
sliderBtn.setSelected(true);
parentPanel.getAttnrHolder().remove(getLoadProfilePanel());
getLoadProfilePanel().resetComponent();
parentPanel.getAttnrHolder().add(getThroughputPanel(), BorderLayout.CENTER);
parentPanel.getAttnrHolder().revalidate();
parentPanel.getAttnrHolder().repaint();
attnrTTPanel.reselectPriorOptions(attenuatorModel);
} else if (!attenuatorModel.isConstantThrottle() && attenuatorModel.isLoadProfile()) {
loadFileBtn.setSelected(true);
parentPanel.getAttnrHolder().remove(getThroughputPanel());
getThroughputPanel().resetComponent();
parentPanel.getAttnrHolder().add(getLoadProfilePanel());
parentPanel.getAttnrHolder().revalidate();
parentPanel.getAttnrHolder().repaint();
attnrLoadPanel.reselectPriorOptions(attenuatorModel);
}
break;
case ROOTED_ANDROID:
// reset
AttenuatorModel attenuatorModelReset = new AttenuatorModel();
this.attenuatorModel = attenuatorModelReset;
deviceInfo.setAttenuatorModel(attenuatorModelReset);
attnrTTPanel.setAttenuatorModel(attenuatorModelReset);
attnrLoadPanel.setAttenuatorModel(attenuatorModelReset);
loadFileBtn.setEnabled(false);
break;
case DEFAULT:
defaultBtn.setSelected(true);
break;
}
}
use of com.att.aro.core.datacollector.DataCollectorType in project VideoOptimzer by attdevsupport.
the class RootedAndroidCollectorImplTest method testDataCoolectorType_returnIsCorrect.
@Test
public void testDataCoolectorType_returnIsCorrect() {
DataCollectorType testResult = rootedAndroidCollectorImpl.getType();
assertEquals(DataCollectorType.ROOTED_ANDROID, testResult);
}
use of com.att.aro.core.datacollector.DataCollectorType in project VideoOptimzer by attdevsupport.
the class AttnrRadioGroupPanel method itemStateChanged.
@Override
public void itemStateChanged(ItemEvent event) {
JRadioButton item = (JRadioButton) event.getItem();
String itemStr = item.getText();
if (event.getStateChange() == ItemEvent.SELECTED) {
if (attnrSlider.equals(itemStr)) {
// Slider
parentPanel.getAttnrHolder().remove(getLoadProfilePanel());
getLoadProfilePanel().resetComponent();
parentPanel.getAttnrHolder().add(getThroughputPanel(), BorderLayout.CENTER);
parentPanel.getAttnrHolder().revalidate();
parentPanel.getAttnrHolder().repaint();
attenuatorModel.setConstantThrottle(true);
attenuatorModel.setFreeThrottle(false);
attenuatorModel.setLoadProfile(false);
resizeDialog(HEIGHT_ATTENUATOR_SECTION);
DataCollectorType collectorType = deviceInfo.getCollector().getType();
if (DataCollectorType.IOS.equals(collectorType) && deviceInfo.isSharedNetworkActive()) {
MessageDialogFactory.getInstance().showInformationDialog(this, deviceInfo.messageComposed(), ResourceBundleHelper.getMessageString("dlog.collector.option.attenuator.attenuation.title"));
} else if (DataCollectorType.IOS.equals(collectorType)) {
new IOSStepsDialog(startCollectDialog);
}
} else if (attnrLoadFile.equals(itemStr)) {
// Profile
parentPanel.getAttnrHolder().remove(getThroughputPanel());
getThroughputPanel().resetComponent();
parentPanel.getAttnrHolder().add(getLoadProfilePanel());
parentPanel.getAttnrHolder().revalidate();
parentPanel.getAttnrHolder().repaint();
attenuatorModel.setConstantThrottle(false);
attenuatorModel.setFreeThrottle(false);
attenuatorModel.setLoadProfile(true);
resizeDialog(HEIGHT_LOAD_PROFILE_SECTION);
} else if (attnrNone.equals(itemStr)) {
// None
resizeDialog(HEIGHT_RESET);
reset();
} else {
resizeDialog(HEIGHT_RESET);
reset();
}
}
}
Aggregations