setLayout(new BorderLayout()); Canvas ic = new PlotCanvas(); ic.setSize(WIDTH, HEIGHT); add(ic); setResizable(false); pack(); Point loc = Prefs.getLocation(LOC_KEY); if (loc!=null) setLocation(loc); else GUI.center(this); image = createImage(WIDTH,HEIGHT); g = (Graphics2D)image.getGraphics(); g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON); g.fillRect(0, 0, WIDTH, HEIGHT); g.setFont(new Font("SansSerif",Font.PLAIN,12)); show(); ImageJ ij = IJ.getInstance(); if (ij!=null) { addKeyListener(ij); ic.addKeyListener(ij); ic.addMouseListener(ij); Thread.currentThread().setPriority(Thread.MIN_PRIORITY); while (!done) { updatePlot(); addText(); ic.repaint();
public void close() { super.close(); instance = null; Prefs.saveLocation(LOC_KEY, getLocation()); done = true; }
setLayout(new BorderLayout()); Canvas ic = new PlotCanvas(); ic.setSize(WIDTH, HEIGHT); add(ic); setResizable(false); pack(); Point loc = Prefs.getLocation(LOC_KEY); if (loc!=null) setLocation(loc); else GUI.center(this); image = createImage(WIDTH,HEIGHT); g = (Graphics2D)image.getGraphics(); g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON); g.fillRect(0, 0, WIDTH, HEIGHT); g.setFont(new Font("SansSerif",Font.PLAIN,12)); show(); ImageJ ij = IJ.getInstance(); if (ij!=null) { addKeyListener(ij); ic.addKeyListener(ij); ic.addMouseListener(ij); Thread.currentThread().setPriority(Thread.MIN_PRIORITY); while (!done) { updatePlot(); addText(); ic.repaint();
public void close() { super.close(); instance = null; Prefs.saveLocation(LOC_KEY, getLocation()); done = true; }