use of com.att.aro.ui.commonui.MessageDialogFactory in project VideoOptimzer by attdevsupport.
the class DataDump method startBackgroundWorker.
/**
* Initialize and start background worker thread to create datadump file
* @param traceFolders
*/
private void startBackgroundWorker(final List<File> traceFolders) {
SwingWorker<File, Object> datadumpWorker = new SwingWorker<File, Object>() {
@Override
protected File doInBackground() throws IOException, ProfileException {
Thread.setDefaultUncaughtExceptionHandler(new CrashHandler());
startDataDump(traceFolders);
return fileToSave;
}
@Override
protected void done() {
try {
if (get().getName().contains(EXTENSION_FILTER)) {
if (singleTrace) {
LOG.info(ResourceBundleHelper.getMessageString(MessageItem.table_export_success));
} else {
if (new MessageDialogFactory().showExportConfirmDialog(MSG_WINDOW) == JOptionPane.YES_OPTION) {
Desktop desktop = Desktop.getDesktop();
desktop.open(get());
}
}
}
this.cancel(true);
} catch (IOException e) {
LOG.error("Unexpected IOException analyzing trace", e);
new MessageDialogFactory().showUnexpectedExceptionDialog(MSG_WINDOW, e);
} catch (UnsupportedOperationException unsupportedException) {
MessageDialogFactory.showMessageDialog(MSG_WINDOW, ResourceBundleHelper.getMessageString(MessageItem.Error_unableToOpen));
} catch (InterruptedException e) {
LOG.error("Unexpected exception analyzing trace", e);
new MessageDialogFactory().showUnexpectedExceptionDialog(MSG_WINDOW, e);
} catch (ExecutionException e) {
LOG.error("Unexpected execution exception analyzing trace", e);
if (e.getCause() instanceof OutOfMemoryError) {
new MessageDialogFactory().showErrorDialog(null, ResourceBundleHelper.getMessageString(MessageItem.Error_outOfMemory));
} else {
new MessageDialogFactory().showUnexpectedExceptionDialog(MSG_WINDOW, e);
}
}
}
};
datadumpWorker.execute();
}
use of com.att.aro.ui.commonui.MessageDialogFactory in project VideoOptimzer by attdevsupport.
the class ConfigurationFrame method saveConfigurationData.
/**
* Implements the functionality of Save menu item.
*/
private boolean saveConfigurationData() {
synchronized (tableModel) {
try {
Profile profile = tableModel.getProfile();
if (profile.getName() != null) {
// Make sure current editor is closed
TableCellEditor networkAttrEditor = networkAttributesTable.getCellEditor();
TableCellEditor deviceAttrEditor = deviceAttributesTable.getCellEditor();
if (networkAttrEditor != null) {
networkAttrEditor.stopCellEditing();
}
if (deviceAttrEditor != null) {
deviceAttrEditor.stopCellEditing();
}
saveProfile(null, profile);
setProfile(profile);
return true;
}
} catch (ProfileException e) {
handleProfileException(e);
} catch (IOException e) {
LOG.error("IOException saving profile", e);
MessageDialogFactory dialog = new MessageDialogFactory();
dialog.showUnexpectedExceptionDialog(ConfigurationFrame.this, e);
}
return false;
}
}
use of com.att.aro.ui.commonui.MessageDialogFactory in project VideoOptimzer by attdevsupport.
the class ConfigurationFrame method saveAsConfigurationData.
/**
* Implements the functionality of Save As menu item.
*/
private boolean saveAsConfigurationData() {
synchronized (tableModel) {
JFileChooser fileChooser = new JFileChooser(UserPreferencesFactory.getInstance().create().getLastProfileDirectory());
fileChooser.setDialogTitle(DEFAULTBUNDLE.getString("configuration.savefile"));
fileChooser.setMultiSelectionEnabled(false);
int returnVal = fileChooser.showSaveDialog(this);
if (returnVal == JFileChooser.APPROVE_OPTION) {
try {
File file = fileChooser.getSelectedFile();
if (file.exists() && MessageDialogFactory.showConfirmDialog(this, DEFAULTBUNDLE.getString("configuration.fileExists"), DEFAULTBUNDLE.getString("configuration.confirm"), JOptionPane.YES_NO_OPTION) != JOptionPane.YES_OPTION) {
return false;
}
// Make sure current editor is closed
TableCellEditor networkAttrEditor = networkAttributesTable.getCellEditor();
TableCellEditor deviceAttrEditor = deviceAttributesTable.getCellEditor();
if (networkAttrEditor != null) {
networkAttrEditor.stopCellEditing();
}
if (deviceAttrEditor != null) {
deviceAttrEditor.stopCellEditing();
}
Profile profile = tableModel.getProfile();
saveProfile(file, profile);
setProfile(profile);
return true;
} catch (IOException ioException) {
MessageDialogFactory dialog = new MessageDialogFactory();
dialog.showUnexpectedExceptionDialog(ConfigurationFrame.this, ioException);
} catch (ProfileException profileException) {
handleProfileException(profileException);
}
}
return false;
}
}
use of com.att.aro.ui.commonui.MessageDialogFactory in project VideoOptimzer by attdevsupport.
the class ConfigurationFrame method handleProfileException.
private void handleProfileException(ProfileException profileException) {
MessageDialogFactory dialog = new MessageDialogFactory();
dialog.showErrorDialog(this, MessageFormat.format(ResourceBundleHelper.getMessageString("configuration.parseerror"), profileException.getMessage()));
}
use of com.att.aro.ui.commonui.MessageDialogFactory in project VideoOptimzer by attdevsupport.
the class SegmentTablePanel method launchStartUpDelayDialog.
public void launchStartUpDelayDialog() {
GoogleAnalyticsUtil.getGoogleAnalyticsInstance().sendViews("StartupDelayDialog");
IVideoPlayer player = aroView.getVideoPlayer();
double maxDuration = player.getDuration();
List<UserEvent> userEventList = analyzerResult.getAnalyzerResult().getTraceresult().getUserEvents();
if (maxDuration >= 0) {
selectVideoStreamWithRefresh(videoStream);
try {
dialog = new StartupDelayDialog(aroView.getGraphPanel(), maxDuration, videoStream, userEventList, this, viewIndex);
dialog.pack();
dialog.setSize(dialog.getPreferredSize());
dialog.validate();
dialog.setModalityType(ModalityType.APPLICATION_MODAL);
dialog.setVisible(true);
} catch (Exception e) {
LOG.error("Exception in StartupDelayDialog:", e);
new MessageDialogFactory().showErrorDialog(null, ResourceBundleHelper.getMessageString("startupdelay.error.message"));
}
}
}
Aggregations