use of com.tagtraum.perf.gcviewer.view.GCViewerGui in project GCViewer by chewiebug.
the class GCViewerGuiController method windowClosing.
/**
* @see java.awt.event.WindowAdapter#windowClosing(java.awt.event.WindowEvent)
*/
@Override
public void windowClosing(WindowEvent e) {
// TODO SWINGWORKER fix closing of main window with correct storing of preferences
closeAllButSelectedDocument(((GCViewerGui) e.getWindow()));
GCPreferences preferences = copyPreferencesFromGui(((GCViewerGui) e.getWindow()));
preferences.store();
e.getWindow().dispose();
}
use of com.tagtraum.perf.gcviewer.view.GCViewerGui in project GCViewer by chewiebug.
the class GCViewerGuiController method startGui.
/**
* Start graphical user interface and load a log file (resourceName - if not <code>null</code>).
*
* @param gcResource {@link GCResource} to be loaded at startup or <code>null</code>
* @throws InvocationTargetException Some problem trying to start the gui
* @throws InterruptedException Some problem trying to start the gui
*/
public void startGui(final GCResource gcResource) throws InvocationTargetException, InterruptedException {
final GCViewerGui gcViewerGui = new GCViewerGui();
final GCModelLoaderController modelLoaderController = new GCModelLoaderControllerImpl(gcViewerGui);
Runnable guiStarter = new Runnable() {
@Override
public void run() {
new GCViewerGuiBuilder().initGCViewerGui(gcViewerGui, modelLoaderController);
applyPreferences(gcViewerGui, new GCPreferences());
gcViewerGui.addWindowListener(GCViewerGuiController.this);
Thread.setDefaultUncaughtExceptionHandler(new GCViewerUncaughtExceptionHandler(gcViewerGui));
gcViewerGui.setVisible(true);
}
};
SwingUtilities.invokeAndWait(guiStarter);
if (gcResource != null) {
Runnable resourceLoader = new Runnable() {
@Override
public void run() {
modelLoaderController.open(gcResource);
}
};
SwingUtilities.invokeLater(resourceLoader);
}
}
use of com.tagtraum.perf.gcviewer.view.GCViewerGui in project GCViewer by chewiebug.
the class TestGCModelLoaderController method setUp.
@Before
public void setUp() throws Exception {
gcViewerGui = new GCViewerGui();
controller = new GCModelLoaderControllerImpl(gcViewerGui);
new GCViewerGuiBuilder().initGCViewerGui(gcViewerGui, controller);
new GCViewerGuiController().applyPreferences(gcViewerGui, new GCPreferences());
}
Aggregations