Search in sources :

Example 11 with MainFrame

use of com.att.aro.ui.view.MainFrame in project VideoOptimzer by attdevsupport.

the class ExcludeTimeRangeAnalysisDialog method hasDataAfterFiltering.

private boolean hasDataAfterFiltering(AnalysisFilter filter) {
    List<PacketInfo> packetsInfoBeforeFilter = ((MainFrame) parent).getController().getTheModel().getAnalyzerResult().getTraceresult().getAllpackets();
    PacketAnalyzerImpl packetAnalyzerImpl = (PacketAnalyzerImpl) ((MainFrame) parent).getController().getAROService().getAnalyzer();
    List<PacketInfo> packetsInfoAfterFilter = packetAnalyzerImpl.filterPackets(filter, packetsInfoBeforeFilter);
    return packetsInfoAfterFilter.size() > 0;
}
Also used : PacketAnalyzerImpl(com.att.aro.core.packetanalysis.impl.PacketAnalyzerImpl) PacketInfo(com.att.aro.core.packetanalysis.pojo.PacketInfo) MainFrame(com.att.aro.ui.view.MainFrame)

Example 12 with MainFrame

use of com.att.aro.ui.view.MainFrame in project VideoOptimzer by attdevsupport.

the class FilterApplicationsAndIpDialog method initialize.

/**
 * Initializes the dialog.
 */
private void initialize() {
    PacketAnalyzerResult currentTraceResult = ((MainFrame) parent).getController().getTheModel().getAnalyzerResult();
    PacketAnalyzerResult initialTraceResult = ((MainFrame) parent).getController().getCurrentTraceInitialAnalyzerResult();
    if (currentTraceResult == null) {
        LOGGER.error("Trace result error! ");
        MessageDialogFactory.getInstance().showErrorDialog(FilterApplicationsAndIpDialog.this, "wrong..");
    } else {
        setCurrentPktAnalyzerResult(currentTraceResult);
        setInitialPktAnalyzerResult(initialTraceResult);
        // Save a copy of the filter before user makes any changes to the selection
        cloneFilter();
        this.jIpAddressesTableModel = new FilterIpAddressesTableModel(currentTraceResult.getFilter());
        this.jApplicationsTableModel = new FilterApplicationsTableModel(currentTraceResult.getFilter());
        this.jApplicationsTableModel.addTableModelListener(new TableModelListener() {

            @Override
            public void tableChanged(TableModelEvent e) {
                if (e.getColumn() == FilterApplicationsTableModel.SELECT_COL || e.getColumn() == FilterApplicationsTableModel.COLOR_COL) {
                    for (int row = e.getFirstRow(); row <= e.getLastRow(); ++row) {
                        if (row >= 0 && row < jApplicationsTableModel.getRowCount()) {
                            ApplicationSelection as = jApplicationsTableModel.getValueAt(row);
                            String appName = as.getAppName();
                            for (FilterIpAddressesTableModel.AppIPAddressSelection is : jIpAddressesTableModel.getData()) {
                                if (appName == is.getAppName() || (appName != null && appName.equals(is.getAppName()))) {
                                    if ((as.isSelected() || !is.getIpSelection().isSelected()) && e.getColumn() == FilterApplicationsTableModel.COLOR_COL) {
                                        is.getIpSelection().setColor(as.getColor());
                                    }
                                    if (e.getColumn() == FilterApplicationsTableModel.SELECT_COL) {
                                        is.getIpSelection().setSelected(as.isSelected());
                                    }
                                }
                            }
                        }
                    }
                    jIpAddressesTableModel.fireTableDataChanged();
                }
            }
        });
        this.jIpAddressesTableModel.addTableModelListener(new TableModelListener() {

            @Override
            public void tableChanged(TableModelEvent e) {
                if (e.getColumn() == FilterIpAddressesTableModel.SELECT_COL) {
                    for (int row = e.getFirstRow(); row <= e.getLastRow(); ++row) {
                        if (row >= 0 && row < jIpAddressesTableModel.getRowCount()) {
                            FilterIpAddressesTableModel.AppIPAddressSelection ipSel = jIpAddressesTableModel.getValueAt(row);
                            String appName = ipSel.getAppName();
                            boolean b = ipSel.getIpSelection().isSelected();
                            if (b) {
                                for (FilterIpAddressesTableModel.AppIPAddressSelection is : jIpAddressesTableModel.getData()) {
                                    if (appName == is.getAppName() || (appName != null && appName.equals(is.getAppName()))) {
                                        b &= is.getIpSelection().isSelected();
                                    }
                                }
                            }
                            for (ApplicationSelection as : jApplicationsTableModel.getData()) {
                                if (appName != null && appName.equals(as.getAppName())) {
                                    as.setSelected(b);
                                    break;
                                }
                            }
                            jApplicationsTableModel.fireTableDataChanged();
                        }
                    }
                }
            }
        });
    }
    this.setSize(600, 420);
    this.setModal(true);
    this.setTitle(ResourceBundleHelper.getMessageString(DialogItem.filter_title));
    this.setLayout(new BorderLayout());
    this.add(getMainPanel(), BorderLayout.CENTER);
    this.setLocationRelativeTo(getOwner());
    new EnableEscKeyCloseDialog(getRootPane(), this);
}
Also used : BorderLayout(java.awt.BorderLayout) EnableEscKeyCloseDialog(com.att.aro.ui.commonui.EnableEscKeyCloseDialog) TableModelEvent(javax.swing.event.TableModelEvent) TableModelListener(javax.swing.event.TableModelListener) ApplicationSelection(com.att.aro.core.packetanalysis.pojo.ApplicationSelection) PacketAnalyzerResult(com.att.aro.core.packetanalysis.pojo.PacketAnalyzerResult) MainFrame(com.att.aro.ui.view.MainFrame)

Example 13 with MainFrame

use of com.att.aro.ui.view.MainFrame in project VideoOptimzer by attdevsupport.

the class DataCollectorSelectNStartDialog method startButtonActionListener.

private ActionListener startButtonActionListener() {
    return new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent arg0) {
            LOG.debug("Button.start");
            String traceFolderName = traceFolderNameField.getText();
            AttnrRadioGroupPanel radioGP = getDeviceOptionPanel().getAttnrGroup().getAttnrRadioGP();
            if (radioGP.getSliderBtn().isSelected()) {
                boolean isAttenuateSelected = radioGP.getThroughputPanel().getDownloadCheckBox().isSelected() || radioGP.getThroughputPanel().getUploadCheckBox().isSelected();
                if (!isAttenuateSelected) {
                    LOG.info("need to set at least one DL or UL for the throttle");
                    proceed = false;
                    showAttenuationError();
                    return;
                }
            }
            boolean secureOrAttnEnabled = deviceOptionPanel.getAttnrGroup().getAttnrRadioGP().getSliderBtn().isSelected();
            if (deviceTablePanel.getSelection().isPlatform(Platform.iOS)) {
                if (deviceTablePanel.getSelection().getProductName() == null || deviceTablePanel.getSelection().getModel() == null) {
                    JOptionPane.showMessageDialog(DataCollectorSelectNStartDialog.this, ResourceBundleHelper.getMessageString("Error.app.nolibimobiledevice"), MessageFormat.format(ResourceBundleHelper.getMessageString("Error.app.noprerequisitelib"), ApplicationConfig.getInstance().getAppShortName()), JOptionPane.ERROR_MESSAGE);
                    return;
                }
                if (secureOrAttnEnabled && (!deviceOptionPanel.isSharedNetworkActive())) {
                    new IOSStepsDialog(DataCollectorSelectNStartDialog.this);
                    return;
                }
            }
            // don't allow whitespace
            traceFolderName = traceFolderName.replaceAll("\\s", "");
            if (!traceFolderName.isEmpty()) {
                proceed = true;
                if (traceFolderNameField.getText() != null) {
                    if (isContainsSpecialCharacterorSpace(traceFolderNameField.getText())) {
                        JOptionPane.showMessageDialog(getCollectorDialogComponent(), ResourceBundleHelper.getMessageString("Error.specialchar"), MessageFormat.format(ResourceBundleHelper.getMessageString("aro.title.short"), ApplicationConfig.getInstance().getAppShortName()), JOptionPane.ERROR_MESSAGE);
                        return;
                    } else if (traceFolderNameField.getText().toString().length() > TRACE_FOLDER_ALLOWED_LENGTH) {
                        JOptionPane.showMessageDialog(getCollectorDialogComponent(), ResourceBundleHelper.getMessageString("Error.tracefolderlength"), MessageFormat.format(ResourceBundleHelper.getMessageString("aro.title.short"), ApplicationConfig.getInstance().getAppShortName()), JOptionPane.ERROR_MESSAGE);
                        return;
                    } else {
                        DataCollectorSelectNStartDialog.this.dispose();
                    }
                }
            } else {
                LOG.info("traceFolderName is blank");
                proceed = false;
                JOptionPane.showMessageDialog(getCollectorDialogComponent(), ResourceBundleHelper.getMessageString("Error.tracefolderempty"), MessageFormat.format(ResourceBundleHelper.getMessageString("aro.title.short"), ApplicationConfig.getInstance().getAppShortName()), JOptionPane.ERROR_MESSAGE);
                traceFolderNameField.requestFocus();
            }
            if (deviceTablePanel.getSelection().isPlatform(Platform.Android) && !((AROAndroidDevice) deviceTablePanel.getSelection()).isAPKInstalled()) {
                if (MessageDialogFactory.showConfirmDialog(getCollectorDialogComponent(), ResourceBundleHelper.getMessageString("Message.permissions.warning"), MessageFormat.format(ResourceBundleHelper.getMessageString("aro.title.short"), ApplicationConfig.getInstance().getAppShortName()), JOptionPane.YES_NO_OPTION) == JOptionPane.YES_OPTION) {
                    ((MainFrame) getMainframeParent()).setAutoAssignPermissions(true);
                } else {
                    ((MainFrame) getMainframeParent()).setAutoAssignPermissions(false);
                }
            }
        }
    };
}
Also used : IOSStepsDialog(com.att.aro.ui.view.menu.datacollector.IOSStepsDialog) ActionListener(java.awt.event.ActionListener) ActionEvent(java.awt.event.ActionEvent) AROAndroidDevice(com.att.aro.core.mobiledevice.pojo.AROAndroidDevice) AttnrRadioGroupPanel(com.att.aro.ui.view.menu.datacollector.AttnrRadioGroupPanel) MainFrame(com.att.aro.ui.view.MainFrame)

Example 14 with MainFrame

use of com.att.aro.ui.view.MainFrame in project VideoOptimzer by attdevsupport.

the class AROVideoPlayer method refresh.

/**
 * Refreshes the Video player display using the specified analysis data.
 *
 * @param analysisData
 *            The analysis data that is used to refresh the video.
 * @throws IOException
 */
private void refresh() throws IOException {
    aroAdvancedTab.setVideoPlayer(this);
    // file:/Users/barrynelson/AROTraceAndroid/nt/video.mov
    String mediaUrl = VideoUtil.getMediaUrl(traceFile);
    if (traceFile == null || mediaUrl == null) {
        setVideoNotAvailableImage(true);
        return;
    }
    double videoStartTime = tdResult.getVideoStartTime();
    if (videoStartTime < 0.00001) {
        // checking if the video start time isn't available
        videoStartTime = new FileManagerImpl().getCreatedTime(mediaUrl) * 1000;
    }
    MediaLocator mlr = new MediaLocator(mediaUrl);
    try {
        videoPlayer = Manager.createRealizedPlayer(mlr);
    } catch (NoPlayerException noe) {
        MessageDialogFactory.getInstance().showErrorDialog(new Window(new Frame()), ResourceBundleHelper.getMessageString("video.error.noplayerexception") + noe.getMessage());
        return;
    } catch (IOException ioe) {
        MessageDialogFactory.getInstance().showErrorDialog(new Window(new Frame()), ResourceBundleHelper.getMessageString("video.error.ioexception") + ioe.getMessage());
    } catch (CannotRealizeException cre) {
        MessageDialogFactory.getInstance().showErrorDialog(new Window(new Frame()), ResourceBundleHelper.getMessageString("video.error.cannotrealizeexception") + cre.getMessage());
        return;
    }
    this.videoOffset = videoStartTime > 0.0 ? videoStartTime - ((double) tdResult.getTraceDateTime().getTime() / 1000) : 0.0;
    // Resetting the offset if the offset is longer than the video
    if (Math.abs(videoOffset) >= videoPlayer.getDuration().getSeconds()) {
        videoOffset = 0;
    }
    videoPlayer.setRate(PLAYBACK_RATE);
    setVideoNotAvailableImage(false);
    // This is to turn off plug-in settings on video info window, plugin tab
    Control[] controls = videoPlayer.getControls();
    for (int i = 0; i < controls.length; i++) {
        String strControlName = controls[i].toString();
        if (strControlName.contains("BasicJMD")) {
            Component basicJMDComp = controls[i].getControlComponent();
            if (basicJMDComp.getParent() != null) {
                basicJMDComp.getParent().setVisible(false);
            }
            basicJMDComp.setVisible(false);
        }
    }
    controlComponent = videoPlayer.getControlPanelComponent();
    if (controlComponent != null) {
        controlComponent.setVisible(true);
        aroVideoPanel.add(controlComponent, BorderLayout.SOUTH);
    }
    visualComponent = videoPlayer.getVisualComponent();
    if (visualComponent != null) {
        aroVideoPanel.add(visualComponent, BorderLayout.CENTER);
        visualComponent.setVisible(true);
    }
    videoPlayer.addControllerListener(new ControllerListener() {

        @Override
        public void controllerUpdate(ControllerEvent evt) {
            if (evt instanceof StartEvent || evt instanceof MediaTimeSetEvent) {
                if ((evt instanceof StartEvent) && showInfoMsg && tdResult.isExVideoTimeFileNotFound()) {
                    if (!syncVideoClicked) {
                        MessageDialogFactory.showMessageDialog(AROVideoPlayer.this, "The Analyzer loaded an external video. The video may not be in Sync with the traces.", "Information", 1);
                        showInfoMsg = false;
                    } else {
                        showInfoMsg = false;
                    }
                }
                VideoSyncThread syncThread = new VideoSyncThread(AROVideoPlayer.this, aroAdvancedTab, videoOffset);
                new Thread(syncThread).start();
            }
        }
    });
    setVisible(true);
    if (!tdResult.isNativeVideo()) {
        jButton.setVisible(true);
    }
    aroAdvancedTab.setGraphPanelClicked(false);
    Double startTime = 0.0;
    AnalysisFilter filter = ((MainFrame) aroView).getController().getTheModel().getAnalyzerResult().getFilter();
    if (null != filter) {
        startTime = filter.getTimeRange().getBeginTime();
    }
    setMediaTime(startTime);
}
Also used : Window(java.awt.Window) JFrame(javax.swing.JFrame) MainFrame(com.att.aro.ui.view.MainFrame) Frame(java.awt.Frame) CannotRealizeException(javax.media.CannotRealizeException) AnalysisFilter(com.att.aro.core.packetanalysis.pojo.AnalysisFilter) ControllerListener(javax.media.ControllerListener) MediaTimeSetEvent(javax.media.MediaTimeSetEvent) IOException(java.io.IOException) ControllerEvent(javax.media.ControllerEvent) Control(javax.media.Control) MediaLocator(javax.media.MediaLocator) StartEvent(javax.media.StartEvent) Component(java.awt.Component) NoPlayerException(javax.media.NoPlayerException) FileManagerImpl(com.att.aro.core.fileio.impl.FileManagerImpl)

Example 15 with MainFrame

use of com.att.aro.ui.view.MainFrame in project VideoOptimzer by attdevsupport.

the class VideoTab method refresh.

/**
 * Refreshes the VideoTab using the specified trace analysis
 * data. This method is typically called when a new trace file is loaded.
 *
 * @param analysisData
 *            The trace analysis data.
 */
@Override
public void refresh(AROTraceData traceData) {
    AbstractTraceResult result = traceData.getAnalyzerResult().getTraceresult();
    long newTraceTime = ((MainFrame) aroView).getLastOpenedTime();
    getProfilePanel().refresh(traceData);
    loadManifestDialog.refresh(traceData);
    if (lastOpenedTrace == newTraceTime && (trace.equals(result.getTraceDirectory()) || trace.equals(result.getTraceFile()))) {
        refreshLocal(traceData, loadManifestDialog.getAnalysisfilter().isCSI());
    } else {
        trace = result.getTraceDirectory() != null ? result.getTraceDirectory() : result.getTraceFile();
        lastOpenedTrace = newTraceTime;
        bpObservable.refreshModel(traceData);
        updateUI();
    }
}
Also used : AbstractTraceResult(com.att.aro.core.packetanalysis.pojo.AbstractTraceResult) 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