use of com.att.aro.ui.view.MainFrame in project VideoOptimzer by attdevsupport.
the class ExcludeTimeRangeAnalysisDialog method getOKButton.
/**
* Initializes and returns the start button
*/
private JButton getOKButton() {
if (startButton == null) {
startButton = new JButton();
startButton.setText(ResourceBundleHelper.getMessageString(DialogItem.Button_ok));
startButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent arg0) {
double startTime;
double endTime;
try {
startTime = getTimeValue(startTimeTextField);
endTime = getTimeValue(endTimeTextField);
} catch (NumberFormatException e) {
MessageDialogFactory.getInstance().showErrorDialog(ExcludeTimeRangeAnalysisDialog.this, ResourceBundleHelper.getMessageString(DialogItem.timerangeanalysis_numberError));
return;
}
double timeRangeEndTime = Double.valueOf(DECIMAL_FORMAT.format(traceEndTime));
if (startTime < endTime) {
if ((startTime >= 0.0) && (startTime <= endTime) && endTime <= timeRangeEndTime) {
AnalysisFilter filter = ((MainFrame) parent).getController().getTheModel().getAnalyzerResult().getFilter();
filter.setTimeRange(new TimeRange(startTime, endTime));
if (!hasDataAfterFiltering(filter)) {
MessageDialogFactory.getInstance().showErrorDialog(ExcludeTimeRangeAnalysisDialog.this, ResourceBundleHelper.getMessageString(DialogItem.timerangeanalysis_noResultDataError));
} else {
((MainFrame) parent).updateFilter(filter);
dispose();
}
} else {
String strErrorMessage = MessageFormat.format(ResourceBundleHelper.getMessageString(DialogItem.timerangeanalysis_rangeError), 0.00, DECIMAL_FORMAT.format(timeRangeEndTime));
MessageDialogFactory.showMessageDialog(ExcludeTimeRangeAnalysisDialog.this, strErrorMessage, ResourceBundleHelper.getMessageString(DialogItem.menu_error_title), JOptionPane.ERROR_MESSAGE);
}
} else {
String strErrorMessage = ResourceBundleHelper.getMessageString(DialogItem.timerangeanalysis_startTimeError);
MessageDialogFactory.showMessageDialog(ExcludeTimeRangeAnalysisDialog.this, strErrorMessage, ResourceBundleHelper.getMessageString(DialogItem.menu_error_title), JOptionPane.ERROR_MESSAGE);
}
}
});
}
return startButton;
}
use of com.att.aro.ui.view.MainFrame in project VideoOptimzer by attdevsupport.
the class FilterProcessesDialog method oKButtonAction.
/**
* Actions performed when OK button is clicked.
*/
private void oKButtonAction() {
CpuActivityList cpuAList = ((MainFrame) parent).getController().getTheModel().getAnalyzerResult().getTraceresult().getCpuActivityList();
cpuAList.setProcessSelection(filteredProcessSelection);
cpuAList.recalculateTotalCpu();
PacketAnalyzerResult tempresult = ((MainFrame) parent).getController().getTheModel().getAnalyzerResult();
BurstCollectionAnalysisData bd = burstAnalysis.analyze(tempresult.getTraceresult().getAllpackets(), tempresult.getProfile(), tempresult.getStatistic().getPacketSizeToCountMap(), tempresult.getStatemachine().getStaterangelist(), tempresult.getTraceresult().getUserEvents(), cpuAList.getCpuActivities(), tempresult.getSessionlist());
((MainFrame) parent).getController().getTheModel().getAnalyzerResult().setBurstCollectionAnalysisData(bd);
((MainFrame) parent).refresh();
callerMenuItem.setEnabled(true);
dispose();
}
use of com.att.aro.ui.view.MainFrame in project VideoOptimzer by attdevsupport.
the class PrivateDataDialog method initialize.
private void initialize() {
PacketAnalyzerResult currentTraceResult = ((MainFrame) parent).getController().getTheModel().getAnalyzerResult();
setCurrentPktAnalyzerResult(currentTraceResult);
this.setSize(400, 500);
this.setTitle(resourceBundle.getString("privatedatasetting.title"));
this.setLocationRelativeTo(getOwner());
this.setContentPane(getJDialogPanel());
}
use of com.att.aro.ui.view.MainFrame in project VideoOptimzer by attdevsupport.
the class AROToolMenu method openTimeRangeAnalysis.
private void openTimeRangeAnalysis() {
MainFrame mainFrame = ((MainFrame) parent);
if (mainFrame.getController().getTheModel() != null && mainFrame.getController().getTheModel().getAnalyzerResult() != null) {
TimeRangeAnalysisDialog timeRangeDialog = new TimeRangeAnalysisDialog(mainFrame.getJFrame(), parent);
timeRangeDialog.setVisible(true);
} else {
showNoTraceLoadedError();
}
}
use of com.att.aro.ui.view.MainFrame in project VideoOptimzer by attdevsupport.
the class AROToolMenu method collectErrorMessage.
private void collectErrorMessage() {
try {
LOG.debug("collecting logcat");
String fileName = String.format(FILE_NAME, LocalDate.now().format(DateTimeFormatter.BASIC_ISO_DATE), LocalTime.now().toSecondOfDay());
File outFile = new File(Util.getAROTraceDirAndroid(), fileName);
IDevice device = getDevice();
String adbPath = adbservice.getAdbPath(true);
String[] command = new String[] { adbPath, "logcat", "-d", "2", "-t", "5000", "com.att.arocollector:I" };
ProcessBuilder procBuilder = new ProcessBuilder(command);
Process process = procBuilder.redirectOutput(outFile).start();
process.waitFor(6, TimeUnit.SECONDS);
MessageDialogFactory.showMessageDialog(((MainFrame) parent).getJFrame(), MessageFormat.format(getMsg("logcat.collection.success"), fileName) + ":\n" + device.getName(), "Collection Successful", JOptionPane.INFORMATION_MESSAGE);
} catch (IOException | InterruptedException e) {
LOG.error("Logcat collection failed", e);
MessageDialogFactory.showMessageDialog(((MainFrame) parent).getJFrame(), e.getMessage(), getMsg("logcat.collection.failed"), JOptionPane.ERROR_MESSAGE);
}
}
Aggregations