Search in sources :

Example 1 with GCViewerGui

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();
}
Also used : GCViewerGui(com.tagtraum.perf.gcviewer.view.GCViewerGui) GCPreferences(com.tagtraum.perf.gcviewer.view.model.GCPreferences)

Example 2 with GCViewerGui

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);
    }
}
Also used : GCModelLoaderController(com.tagtraum.perf.gcviewer.ctrl.GCModelLoaderController) GCViewerGui(com.tagtraum.perf.gcviewer.view.GCViewerGui) GCPreferences(com.tagtraum.perf.gcviewer.view.model.GCPreferences)

Example 3 with GCViewerGui

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());
}
Also used : GCViewerGui(com.tagtraum.perf.gcviewer.view.GCViewerGui) GCPreferences(com.tagtraum.perf.gcviewer.view.model.GCPreferences) Before(org.junit.Before)

Aggregations

GCViewerGui (com.tagtraum.perf.gcviewer.view.GCViewerGui)3 GCPreferences (com.tagtraum.perf.gcviewer.view.model.GCPreferences)3 GCModelLoaderController (com.tagtraum.perf.gcviewer.ctrl.GCModelLoaderController)1 Before (org.junit.Before)1