/** * Constructs a plot frame for the specified plot panel. * @param panel the plot panel. */ public PlotFrame(PlotPanel panel) { _panelTL = panel; _panelBR = panel; _panelMain = new MainPanel(); _panelMain.setLayout(new BorderLayout()); _panelMain.add(_panelTL,BorderLayout.CENTER); this.setSize(_panelMain.getPreferredSize()); this.add(_panelMain,BorderLayout.CENTER); this.setFont(DEFAULT_FONT); this.setBackground(DEFAULT_BACKGROUND); this.setSize(DEFAULT_WIDTH,DEFAULT_HEIGHT); addModeManager(); addResizedShownListener(); }
frame.setTitle("Example Contour Plot"); frame.setDefaultCloseOperation(PlotFrame.EXIT_ON_CLOSE); frame.add(jsp,BorderLayout.NORTH); frame.pack(); frame.setVisible(true);
_panelMain.add(_splitPane,BorderLayout.CENTER); this.setSize(_panelMain.getPreferredSize()); this.add(_panelMain,BorderLayout.CENTER); this.setBackground(DEFAULT_BACKGROUND); this.setFont(DEFAULT_FONT);
frame.add(buttPanel,BorderLayout.SOUTH); frame.setSize(600,500); frame.setDefaultCloseOperation(PlotFrame.EXIT_ON_CLOSE);
toolBar.add(new ModeToggleButton(pm)); toolBar.add(new ModeToggleButton(zm)); _plotFrame.add(toolBar,BorderLayout.WEST);
public static void main(String args[]) { System.out.println("LogAxisPlotDemo2"); int n = 1000; float X = 300; float[] x = ArrayMath.rampfloat(0.0f,X / n,n); float[] f = new float[n]; for (int i = 0; i < n; ++i) { f[i] = pow(1.5f * x[i],2); } // new plot PlotPanel plot = new PlotPanel(2,2); pv1 = plot.addPoints(0,0,x,f); pv2 = plot.addPoints(0,1,x,f); pv3 = plot.addPoints(1,0,x,f); pv4 = plot.addPoints(1,1,x,f); // frame setup plot.setVisible(true); PlotFrame frame = new PlotFrame(plot); frame.setSize(800,500); frame.add(makeScaleOptionPanel(),BorderLayout.EAST); frame.setDefaultCloseOperation(PlotFrame.EXIT_ON_CLOSE); frame.setVisible(true); }
public PlotFrameDemo() { float[] x = rampfloat(0.0f,4.0f*FLT_PI/200.0f,201); float[] s = sin(x); _plotPanel = new PlotPanel(); _plotPanel.setTitle("The sine function"); _plotPanel.setHLabel("x"); _plotPanel.setVLabel("sin(x)"); _gridView = _plotPanel.addGrid(); _pointsView = _plotPanel.addPoints(x,s); _pointsView.setStyle("r-o"); _plotFrame = new PlotFrame(_plotPanel); _plotFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); _plotFrame.setVisible(true); _plotFrame.add( new Label("In either plot or axes, click-drag to zoom, click to unzoom."), BorderLayout.NORTH); }