private void storeZoom(boolean withName, String name) { Rectangle2D zoomstore = this.quadTreeRectToRectangle2D(this.viewBounds); if(withName) { final JDialog d = new JDialog((JFrame)null,"Name for this zoom", true); JTextField field = new JTextField(20); ActionListener al = new ActionListener() { @Override public void actionPerformed( ActionEvent e ) { d.setVisible(false); } }; field.addActionListener(al); d.getContentPane().add(field); d.pack(); d.setVisible(true); name = field.getText(); } this.canvas.repaint(); BufferedImage image = ImageUtil.createThumbnail(this.current, 300); otfVisConfig.addZoom(new ZoomEntry(image,zoomstore, name)); }
ZoomEntry z = zooms.get(i); JButton b = buttons.get(i); ImageIcon icon = new ImageIcon(ImageUtil.createThumbnail(z.getSnap(),Math.min(z.getSnap().getWidth(),b.getSize().width)-20)); b.setIcon(icon);