Search in sources :

Example 6 with MainFrame

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;
}
Also used : FileNameExtensionFilter(javax.swing.filechooser.FileNameExtensionFilter) JMenuItem(javax.swing.JMenuItem) BestPracticeResultsListener(com.att.aro.ui.model.listener.BestPracticeResultsListener) JMenu(javax.swing.JMenu) MainFrame(com.att.aro.ui.view.MainFrame)

Example 7 with MainFrame

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);
    }
}
Also used : PrivateDataDialog(com.att.aro.ui.view.menu.tools.PrivateDataDialog) MainFrame(com.att.aro.ui.view.MainFrame)

Example 8 with MainFrame

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);
}
Also used : AnalysisFilter(com.att.aro.core.packetanalysis.pojo.AnalysisFilter) MainFrame(com.att.aro.ui.view.MainFrame)

Example 9 with MainFrame

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;
}
Also used : ProfileType(com.att.aro.core.configuration.pojo.ProfileType) ActionListener(java.awt.event.ActionListener) ActionEvent(java.awt.event.ActionEvent) JButton(javax.swing.JButton) TimeRangeAnalysis(com.att.aro.core.packetanalysis.impl.TimeRangeAnalysis) MainFrame(com.att.aro.ui.view.MainFrame)

Example 10 with MainFrame

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);
}
Also used : TimeRange(com.att.aro.core.packetanalysis.pojo.TimeRange) EnableEscKeyCloseDialog(com.att.aro.ui.commonui.EnableEscKeyCloseDialog) PacketAnalyzerResult(com.att.aro.core.packetanalysis.pojo.PacketAnalyzerResult) MainFrame(com.att.aro.ui.view.MainFrame)

Aggregations

MainFrame (com.att.aro.ui.view.MainFrame)24 File (java.io.File)7 PacketAnalyzerResult (com.att.aro.core.packetanalysis.pojo.PacketAnalyzerResult)5 AnalysisFilter (com.att.aro.core.packetanalysis.pojo.AnalysisFilter)4 IOException (java.io.IOException)4 ActionEvent (java.awt.event.ActionEvent)3 ActionListener (java.awt.event.ActionListener)3 IFileManager (com.att.aro.core.fileio.IFileManager)2 FileManagerImpl (com.att.aro.core.fileio.impl.FileManagerImpl)2 TimeRange (com.att.aro.core.packetanalysis.pojo.TimeRange)2 StreamingVideoData (com.att.aro.core.videoanalysis.pojo.StreamingVideoData)2 EnableEscKeyCloseDialog (com.att.aro.ui.commonui.EnableEscKeyCloseDialog)2 MessageDialogFactory (com.att.aro.ui.commonui.MessageDialogFactory)2 TimeRangeAnalysisDialog (com.att.aro.ui.view.menu.tools.TimeRangeAnalysisDialog)2 JButton (javax.swing.JButton)2 FileNameExtensionFilter (javax.swing.filechooser.FileNameExtensionFilter)2 IDevice (com.android.ddmlib.IDevice)1 IExternalProcessRunner (com.att.aro.core.commandline.IExternalProcessRunner)1 ExternalProcessRunnerImpl (com.att.aro.core.commandline.impl.ExternalProcessRunnerImpl)1 ProfileType (com.att.aro.core.configuration.pojo.ProfileType)1