int height = this.getPreferredSize().height; int headerHeight = header.getPreferredSize().height; height += headerHeight; final BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
int imageHeight = getIntYPixPerUnit() * ny; int headerHeight = headerPanel.getHeight(); imageHeight += headerHeight;  final BufferedImage image = new BufferedImage(width, imageHeight, BufferedImage.TYPE_INT_ARGB);
	public BufferedImage snapshot() {		updateSize();		int width = this.getPreferredSize().width + geneNamesDrawer.getPreferredSize().width;		int geneTreeWidth = 0;		if(geneTree != null) {			geneTreeWidth = geneTree.getPreferredSize().width;			width += geneTreeWidth;		}		int height = this.getPreferredSize().height;		int headerHeight = header.getPreferredSize().height;		height += headerHeight;		final BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);//TYPE_3BYTE_BGR		Graphics2D g = image.createGraphics();		g.setColor(Color.white);		g.fillRect(0, 0, image.getWidth(), image.getHeight());		/*		    JPanel temp =		    new JPanel() {		    public void paintComponent(Graphics g) {		    super.paintComponent(g);		    g.drawImage(image, 0, 0, null);		    }		    };		    pink_geneTree_sampleTreePanel.paint(g);		    JFrame f = new JFrame();		    f.getContentPane().add(temp);		    f.show();		  */		headerPanel.paint(g);// header panel contains sample tree and sample names		g.translate(0, headerPanel.getHeight());		g.dispose();		/*		    Component comp = pink_geneTree_sampleTreePanel.getTopLevelAncestor();		    boolean buffered = RepaintManager.currentManager(comp).isDoubleBufferingEnabled();		    RepaintManager.currentManager(comp).setDoubleBufferingEnabled(false);		    RepaintManager.currentManager(comp).setDoubleBufferingEnabled(buffered);		  */		return image;	}