private void plotValues(List<Point2D> points, Color color) { Plotter p = new Plotter(); int index = 0; for (Point2D point : points) { p.createAndAddPointArtifact("Point" + (index++), point, color); } JFrame f = new JFrame("Plotter Test"); f.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { System.exit(0); } }); f.getContentPane().add(p.getJPanel(), BorderLayout.CENTER); f.pack(); f.setVisible(true); } }
public PlotterPanel() { plotter = new Plotter(); GridBagConstraints gridBagConstraints = new GridBagConstraints(); setLayout(new GridBagLayout()); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.fill = GridBagConstraints.BOTH; gridBagConstraints.gridwidth = 5; gridBagConstraints.gridheight = 5; gridBagConstraints.weightx = 1; gridBagConstraints.weighty = 1; add(plotter.getJPanel(), gridBagConstraints); }
public PlotterPanel() { plotter = new Plotter(); GridBagConstraints gridBagConstraints = new GridBagConstraints(); setLayout(new GridBagLayout()); gridBagConstraints.gridx = 0; gridBagConstraints.gridy = 0; gridBagConstraints.fill = GridBagConstraints.BOTH; gridBagConstraints.gridwidth = 5; gridBagConstraints.gridheight = 5; gridBagConstraints.weightx = 1; gridBagConstraints.weighty = 1; add(plotter.getJPanel(), gridBagConstraints); }
private static void showPlotterAndSleep(ArtifactList artifacts) { Plotter plotter = new Plotter(); plotter.setViewRange(2.0); artifacts.setVisible(true); JFrame frame = new JFrame("PolygonWigglingTest"); Dimension preferredSize = new Dimension(600, 600); frame.setPreferredSize(preferredSize); frame.add(plotter.getJPanel(), BorderLayout.CENTER); frame.setSize(preferredSize); frame.setVisible(true); artifacts.addArtifactsToPlotter(plotter); ThreadTools.sleepForever(); }
frame.add(plotter.getJPanel(), BorderLayout.CENTER);
frame.add(plotter.getJPanel(), BorderLayout.CENTER);
frame.add(plotter.getJPanel(), BorderLayout.CENTER);
frame.add(plotter.getJPanel(), BorderLayout.CENTER);
f.getContentPane().add(p.getJPanel(), BorderLayout.CENTER); f.pack(); f.setVisible(true);