public void run() { paintToPng(fdpi,fwin,ffileName); } });
public void actionPerformed(ActionEvent event) { JFileChooser fc = new JFileChooser(System.getProperty("user.dir")); fc.showSaveDialog(_plotFrame); File file = fc.getSelectedFile(); if (file!=null) { String filename = file.getAbsolutePath(); _plotFrame.paintToPng(300,6,filename); } } }
private static void go() { int nx = 101; float dx = 0.1f; float fx = -0.5f*dx*(float)(nx-1); Sampling sx = new Sampling(nx,dx,fx); float[] f1 = rampfloat(fx,dx,nx); float[] f2 = add(0.5f,sin(f1)); PlotPanel panel = new PlotPanel(2,1); SequenceView sv1 = panel.addSequence(0,0,sx,f1); sv1.setColor(Color.RED); SequenceView sv2 = panel.addSequence(1,0,sx,f2); sv2.setZero(SequenceView.Zero.MIDDLE); PlotFrame frame = new PlotFrame(panel); frame.setDefaultCloseOperation(PlotFrame.EXIT_ON_CLOSE); frame.setSize(950,500); frame.setVisible(true); frame.paintToPng(300,6,"junk.png"); } }
frame.paintToPng(720,3.333333,"junk.png");