/** * Forces recalculation of the {@code AffineTransform} used to * scale the image display. */ public void resetTransform() { setTransform(); }
/** * Creates a new frame. * * @param title the frame title */ public JTSFrame(String title) { super(title); initComponents(); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); }
/** * Sets the image to display and repaints. * * @param image the image to display */ public void setImage(RenderedImage image) { this.image = image; setTransform(); repaint(); }
private static void doShowImage(RenderedImage img, String title) { ImageFrame f = new ImageFrame(img, title); f.setVisible(true); }
private void setMouseListener() { addMouseListener(this); addMouseMotionListener(this); }
private void initComponents() { canvas = new Canvas(); getContentPane().add(canvas); }
/** * Creatss a new instance. */ public SimpleImagePane() { margin = 0; addComponentListener(new ComponentAdapter() { @Override public void componentResized(ComponentEvent ce) { setTransform(); } }); }
/** * Removes the current display image and repaints. */ public void clear() { image = null; repaint(); }
public void run() { imagePane.setImage(curWorld); } });
/** * Displays the given image in a new ImageFrame. This method can be * safely called from any thread. The frame's closing behaviour will be * {@linkplain #EXIT_ON_CLOSE}. * * @param img image to display * @param title frame title */ public static void showImage( final RenderedImage img, final String title) { showImage(img, title, true); }
private static void doShowImage(RenderedImage img, String title) { ImageFrame f = new ImageFrame(img, title); f.setVisible(true); }
/** * Creates a new frame. * * @param title the frame title */ public JTSFrame(String title) { super(title); initComponents(); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); }
/** * Sets the image to display and repaints. * * @param image the image to display */ public void setImage(RenderedImage image) { this.image = image; setTransform(); repaint(); }
private void setMouseListener() { addMouseListener(this); addMouseMotionListener(this); }
private void initComponents() { canvas = new Canvas(); getContentPane().add(canvas); }
/** * Forces recalculation of the {@code AffineTransform} used to * scale the image display. */ public void resetTransform() { setTransform(); }
/** * Creatss a new instance. */ public SimpleImagePane() { margin = 0; addComponentListener(new ComponentAdapter() { @Override public void componentResized(ComponentEvent ce) { setTransform(); } }); }
/** * Removes the current display image and repaints. */ public void clear() { image = null; repaint(); }
public void run() { imagePane.setImage(curWorld); } });
/** * Displays the given image in a new ImageFrame. This method can be * safely called from any thread. The frame's closing behaviour will be * {@linkplain #EXIT_ON_CLOSE}. * * @param img image to display * @param title frame title */ public static void showImage( final RenderedImage img, final String title) { showImage(img, title, true); }