use of com.att.aro.ui.view.MainFrame in project VideoOptimzer by attdevsupport.
the class AROToolMenu method getMenu.
/**
* @return the toolMenu
*/
public JMenu getMenu() {
toolMenu = new JMenu(ResourceBundleHelper.getMessageString(MenuItem.menu_tools));
toolMenu.setMnemonic(KeyEvent.VK_UNDEFINED);
boolean isTracePathEmpty = true;
isTracePathEmpty = isTracePathEmpty();
if (Desktop.isDesktopSupported()) {
toolMenu.add(getMenuItem(MenuItem.menu_tools_wireshark, isTracePathEmpty));
}
toolMenu.add(menuAdder.getMenuItemInstance(MenuItem.menu_tools_timeRangeAnalysis));
toolMenu.addSeparator();
// xlsx/xls file name extension filter
FileNameExtensionFilter xlsxFilter = new FileNameExtensionFilter(ResourceBundleHelper.getMessageString("fileChooser.desc.excel"), ResourceBundleHelper.getMessageString("fileChooser.contentType.xls"), ResourceBundleHelper.getMessageString("fileChooser.contentType.xlsx"));
JMenu exportMenu = menuAdder.getMenuInstance(ResourceBundleHelper.getMessageString("menu.tools.resultExport"));
exportMenu.add(getMenuItem(MenuItem.menu_tools_htmlExport, isTracePathEmpty));
exportMenu.add(getMenuItem(MenuItem.menu_tools_jsonExport, isTracePathEmpty));
// Excel export menu item
JMenuItem excelExportMenuItem = getMenuItem(MenuItem.menu_tools_excelExport, isTracePathEmpty);
excelExportMenuItem.addActionListener(new BestPracticeResultsListener(((MainFrame) parent).getController().getTheModel(), Lists.newArrayList(xlsxFilter), 0));
exportMenu.add(excelExportMenuItem);
toolMenu.add(exportMenu);
JMenuItem exportExportMenuItem = getMenuItem(MenuItem.menu_tools_sessionsExport, isTracePathEmpty);
exportExportMenuItem.addActionListener(new ExportSessionData((MainFrame) parent, Lists.newArrayList(xlsxFilter), 0));
toolMenu.add(exportExportMenuItem);
toolMenu.addSeparator();
toolMenu.add(getMenuItem(MenuItem.menu_tools_editMetadata, isTracePathEmpty));
toolMenu.addSeparator();
toolMenu.add(menuAdder.getMenuItemInstance(MenuItem.menu_tools_privateData));
if (ResourceBundleHelper.getMessageString("preferences.test.env").equals(SettingsImpl.getInstance().getAttribute("env"))) {
toolMenu.add(menuAdder.getMenuItemInstance(MenuItem.menu_tools_getErrorMsg));
toolMenu.add(menuAdder.getMenuItemInstance(MenuItem.menu_tools_clearErrorMsg));
}
toolMenu.add(menuAdder.getMenuItemInstance(MenuItem.menu_tools_videoParserWizard));
if ("dev".equals(SettingsImpl.getInstance().getAttribute("env"))) {
if (SettingsImpl.getInstance().getAttribute("traceHandlerURL") != null && SettingsImpl.getInstance().checkAttributeValue("env", "dev")) {
toolMenu.addSeparator();
toolMenu.add(getMenuItem(MenuItem.menu_tools_ms_uploadTraceDialog, isTracePathEmpty));
}
}
return toolMenu;
}
use of com.att.aro.ui.view.MainFrame in project VideoOptimzer by attdevsupport.
the class AROToolMenu method openPrivateDataDialog.
private void openPrivateDataDialog() {
PrivateDataDialog privateDataDialog = ((MainFrame) parent).getPrivateDataDialog();
if (privateDataDialog == null) {
privateDataDialog = new PrivateDataDialog(parent);
}
if (privateDataDialog != null) {
privateDataDialog.setVisible(true);
privateDataDialog.setAlwaysOnTop(true);
}
}
use of com.att.aro.ui.view.MainFrame in project VideoOptimzer by attdevsupport.
the class PrivateDataDialog method refresh.
/**
* re-analyze best practices
*/
private void refresh() {
AnalysisFilter filter = getCurrentPktAnalyzerResult().getFilter();
((MainFrame) parent).updateFilter(filter);
}
use of com.att.aro.ui.view.MainFrame in project VideoOptimzer by attdevsupport.
the class TimeRangeAnalysisDialog method getCalculateStatisticsButton.
/**
* Initializes and returns the Calculate Statistics button
*/
private JButton getCalculateStatisticsButton() {
if (calculateStatisticsButton == null) {
calculateStatisticsButton = new JButton();
calculateStatisticsButton.setText(resourceBundle.getString("menu.tools.timeRangeAnalysis.calculateStatistics.button"));
calculateStatisticsButton.setToolTipText(resourceBundle.getString("menu.tools.timeRangeAnalysis.calculateStatistics.button.tooltip"));
calculateStatisticsButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent arg0) {
if (currentTraceResult == null) {
MessageDialogFactory.showMessageDialog(TimeRangeAnalysisDialog.this, resourceBundle.getString("menu.error.noTraceLoadedMessage"), resourceBundle.getString("error.title"), JOptionPane.ERROR_MESSAGE);
} else {
if (!updateCurrentfilter()) {
return;
}
if (!hasDataAfterFiltering(currentTraceResult.getFilter())) {
MessageDialogFactory.getInstance().showErrorDialog(TimeRangeAnalysisDialog.this, resourceBundle.getString("timerangeanalysis.noResultDataError"));
return;
}
double startTime;
double endTime;
try {
startTime = getTimeValue(startTimeTextField);
endTime = getTimeValue(endTimeTextField);
} catch (NumberFormatException e) {
MessageDialogFactory.showMessageDialog(TimeRangeAnalysisDialog.this, resourceBundle.getString("timerangeanalysis.numberError"));
return;
}
// Rounding traceEndTime as getEndTimeTextField() to
// handle time comparison
Double traceEndTimeRounded = Double.valueOf(DECIMAL_FORMAT.format(traceEndTime + ROUNDING_VALUE));
if (startTime < endTime) {
if (startTime >= 0.0 && startTime <= traceEndTimeRounded && endTime >= 0.0 && endTime <= traceEndTimeRounded) {
TimeRangeAnalysis timeRangeAnalysis = new TimeRangeAnalysis(startTime, endTime, currentTraceResult, ((MainFrame) parent).getController());
String msg = null;
ProfileType profileType = currentTraceResult.getProfile().getProfileType();
if (profileType == ProfileType.T3G) {
msg = resourceBundle.getString("timerangeanalysis.3g");
} else if (profileType == ProfileType.LTE) {
msg = resourceBundle.getString("timerangeanalysis.lte");
} else if (profileType == ProfileType.WIFI) {
msg = resourceBundle.getString("timerangeanalysis.wifi");
}
timeRangeAnalysisResultsTextArea.setText(MessageFormat.format((msg == null ? "" : msg), doubleToFixedDecimal(startTime, 3), doubleToFixedDecimal(endTime, 3), timeRangeAnalysis.getPayloadLen(), timeRangeAnalysis.getTotalBytes(), timeRangeAnalysis.getUplinkBytes(), timeRangeAnalysis.getDownlinkBytes(), doubleToFixedDecimal(timeRangeAnalysis.getRrcEnergy(), 2), doubleToFixedDecimal(timeRangeAnalysis.getActiveTime(), 2), doubleToFixedDecimal(timeRangeAnalysis.getAverageThroughput(), 2), doubleToFixedDecimal(timeRangeAnalysis.getAverageUplinkThroughput(), 2), doubleToFixedDecimal(timeRangeAnalysis.getAverageDownlinkThroughput(), 2) + getResultPanelNote(timeRangeAnalysis)));
timeRangeStartTime = startTime;
timeRangeEndTime = endTime;
} else {
String strErrorMessage = MessageFormat.format(resourceBundle.getString("timerangeanalysis.rangeError"), 0.00, doubleToFixedDecimal(traceEndTimeRounded, 3));
MessageDialogFactory.showMessageDialog(TimeRangeAnalysisDialog.this, strErrorMessage, resourceBundle.getString("error.title"), JOptionPane.ERROR_MESSAGE);
}
} else {
String strErrorMessage = resourceBundle.getString("timerangeanalysis.startTimeError");
MessageDialogFactory.showMessageDialog(TimeRangeAnalysisDialog.this, strErrorMessage, resourceBundle.getString("error.title"), JOptionPane.ERROR_MESSAGE);
}
}
}
});
}
return calculateStatisticsButton;
}
use of com.att.aro.ui.view.MainFrame in project VideoOptimzer by attdevsupport.
the class ExcludeTimeRangeAnalysisDialog method initialize.
/**
* Initializes the dialog.
*
* @return void
*/
private void initialize() {
PacketAnalyzerResult traceresult = ((MainFrame) parent).getController().getTheModel().getAnalyzerResult();
if (traceresult == null) {
LOGGER.error("Trace result error! ");
MessageDialogFactory.getInstance().showErrorDialog(ExcludeTimeRangeAnalysisDialog.this, "wrong..");
} else {
if (endTimeResetValue == 0.0) {
endTimeResetValue = traceresult.getTraceresult().getTraceDuration();
}
traceEndTime = endTimeResetValue;
TimeRange timeRange = traceresult.getFilter().getTimeRange();
if (timeRange != null) {
timeRangeStartTime = timeRange.getBeginTime();
timeRangeEndTime = timeRange.getEndTime();
} else {
timeRangeStartTime = 0.0;
timeRangeEndTime = traceEndTime;
}
}
// For cancel button
saveInitTimeRangeValues(timeRangeStartTime, timeRangeEndTime);
this.setSize(400, 150);
this.setModal(true);
this.setTitle(ResourceBundleHelper.getMessageString(DialogItem.excludetimerangeanalysis_title));
this.setLocationRelativeTo(getOwner());
this.setContentPane(getJDialogPanel());
getRootPane().setDefaultButton(startButton);
new EnableEscKeyCloseDialog(getRootPane(), this);
}
Aggregations