public static Plotter createPlotter(String frameTitle) { PlotterPanel plotterPanel = new PlotterPanel(); Plotter plotter = plotterPanel.getPlotter(); plotter.setViewRange(1.0); if (frameTitle == null) { frameTitle = "Plotter Panel " + plotterPanelId; } JFrame f = new JFrame(frameTitle); f.getContentPane().add(new JScrollPane(plotterPanel), BorderLayout.CENTER); f.pack(); f.setVisible(true); return plotter; } }
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 void displayPolygons(PlotterPanel plotterpanel, ArrayList<PolygonArtifact> polygonArtifacts) { if (plotterpanel == null) return; for (int i = 0; i < polygonArtifacts.size(); i++) { plotterpanel.getPlotter().addArtifact(polygonArtifacts.get(i)); try { Thread.sleep(100); } catch (Exception ex) { ex.printStackTrace(); } } }
soundDetectorGUI.add(fftPlotContainer, fftLayout); PlotterPanel boolPlotterPanel = new PlotterPanel(); GridBagConstraints boolPlotterLayout = new GridBagConstraints(); boolPlotterLayout.gridx = 0; soundDetectorGUI.add(boolPlotterPanel, boolPlotterLayout); boolPlotter = boolPlotterPanel.getPlotter(); boolPlotter.setFocusPointX((double) 320); boolPlotter.setFocusPointY((double) 80);
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); }
soundDetectorGUI.add(fftPlotContainer, fftLayout); PlotterPanel boolPlotterPanel = new PlotterPanel(); GridBagConstraints boolPlotterLayout = new GridBagConstraints(); boolPlotterLayout.gridx = 0; soundDetectorGUI.add(boolPlotterPanel, boolPlotterLayout); boolPlotter = boolPlotterPanel.getPlotter(); boolPlotter.setFocusPointX((double) 320); boolPlotter.setFocusPointY((double) 80);
soundDetectorGUI.add(fftPlotContainer, fftLayout); PlotterPanel boolPlotterPanel = new PlotterPanel(); GridBagConstraints boolPlotterLayout = new GridBagConstraints(); boolPlotterLayout.gridx = 0; soundDetectorGUI.add(boolPlotterPanel, boolPlotterLayout); boolPlotter = boolPlotterPanel.getPlotter(); boolPlotter.setFocusPointX((double) 320); boolPlotter.setFocusPointY((double) 80);