Search in sources :

Example 6 with GCPreferences

use of com.tagtraum.perf.gcviewer.view.model.GCPreferences in project GCViewer by chewiebug.

the class SimpleChartRenderer method render.

public void render(GCModel model, FileOutputStream outputStream) throws IOException {
    GCPreferences gcPreferences = new GCPreferences();
    gcPreferences.load();
    Dimension d = new Dimension(gcPreferences.getWindowWidth(), gcPreferences.getWindowHeight());
    BufferedImage image = new BufferedImage(d.width, d.height, BufferedImage.TYPE_INT_RGB);
    Graphics2D graphics = image.createGraphics();
    graphics.setBackground(Color.WHITE);
    graphics.clearRect(0, 0, image.getWidth(), image.getHeight());
    ChartDrawingParameters params = new ChartDrawingParameters(model, gcPreferences, d, graphics, image, outputStream);
    if (EventQueue.isDispatchThread()) {
        drawAndSaveToStream(params);
    } else {
        new SwingChartToStreamHelper().execute(params);
    }
}
Also used : GCPreferences(com.tagtraum.perf.gcviewer.view.model.GCPreferences) Dimension(java.awt.Dimension) BufferedImage(java.awt.image.BufferedImage) Graphics2D(java.awt.Graphics2D)

Example 7 with GCPreferences

use of com.tagtraum.perf.gcviewer.view.model.GCPreferences 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

GCPreferences (com.tagtraum.perf.gcviewer.view.model.GCPreferences)7 GCViewerGui (com.tagtraum.perf.gcviewer.view.GCViewerGui)3 GCModelLoaderController (com.tagtraum.perf.gcviewer.ctrl.GCModelLoaderController)1 OpenFile (com.tagtraum.perf.gcviewer.ctrl.action.OpenFile)1 DoubleData (com.tagtraum.perf.gcviewer.math.DoubleData)1 GCModel (com.tagtraum.perf.gcviewer.model.GCModel)1 ModelChartImpl (com.tagtraum.perf.gcviewer.view.ModelChartImpl)1 GCResourceGroup (com.tagtraum.perf.gcviewer.view.model.GCResourceGroup)1 Dimension (java.awt.Dimension)1 Graphics2D (java.awt.Graphics2D)1 BufferedImage (java.awt.image.BufferedImage)1 LinkedList (java.util.LinkedList)1 JCheckBoxMenuItem (javax.swing.JCheckBoxMenuItem)1 Before (org.junit.Before)1 Theory (org.junit.experimental.theories.Theory)1