@Override protected void paintComponent(Graphics g) { BufferedImage image = theImage.getImage(); if (image != null) { Graphics2D gg = (Graphics2D) g.create(); overlay.paint(gg, image, theImage.getImageTransform()); gg.dispose(); } }
public InternalImageFrame(ImageComponent ic, int locationX, int locationY) { super(ic.createFrameTitle(), true, true, true, true); addInternalFrameListener(this); setFrameIcon(null); this.ic = ic; setDefaultCloseOperation(DO_NOTHING_ON_CLOSE); scrollPane = new JScrollPane(this.ic); this.add(scrollPane); Dimension preferredSize = ic.getPreferredSize(); setSize((int) preferredSize.getWidth(), (int) preferredSize.getHeight(), locationX, locationY); setLocation(locationX, locationY); this.setVisible(true); }
public OriginalLabelVisualisation( RBMSegmentationStack s, int[] im, String[] c, float minData, boolean is, int bo) { stack = s; image = new float[im.length * 3]; int t = 0; for (int i = 0; i < im.length * 3; i += 3) { float m = 50 / (float) im[t]; image[i] = m; image[i + 1] = m; image[i + 2] = m; t++; } classes = c; isRGB = is; this.batchOffset = bo; this.setPreferredSize(new Dimension(compWidth, compHeight)); this.setLayout(new GridLayout(1, 2)); BufferedImage bi = DataConverter.pixelDataToImage(image, minData, isRGB); this.imageWidth = bi.getWidth(); this.imageHeight = bi.getHeight(); this.imgComp = new ImageComponent(bi); this.add(imgComp); this.repaint(); // Reconstruction imgComp.addMouseListener(this); }
public void setToNaturalSize(int locationX, int locationY) { Canvas canvas = ic.getCanvas(); int zoomedWidth = canvas.getZoomedWidth(); int zoomedHeight = canvas.getZoomedHeight(); setSize(zoomedWidth, zoomedHeight, locationX, locationY); }
@Override public void internalFrameActivated(InternalFrameEvent e) { ImageComponents.activeImageHasChanged(ic); ic.onActivation(); }
public void invertImage(String url) { imageComponent.invertImage(url, imageComponent); }