headerPanel.paint(g);
if(geneTree!=null) { g.translate(geneTree.getWidth(), 0); headerPanel.paint(g); g.translate(-geneTree.getWidth(), 0); } else { headerPanel.paint(g); }
	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 imageHeight = getYPixPerUnitAsInt() * ny;		int headerHeight = headerPanel.getHeight();		imageHeight += headerHeight;		final BufferedImage image = new BufferedImage(width, imageHeight, BufferedImage.TYPE_INT_ARGB);		//TYPE_3BYTE_BGR		Graphics2D g = image.createGraphics();		g.setColor(Color.white);		g.fillRect(0, 0, image.getWidth(), image.getHeight());		headerPanel.paint(g);		//topPanel.paint(g);		// header panel contains sample tree and sample names		g.translate(0, headerHeight);		if(sampleTree!=null) {			if(geneTree!=null) {				g.translate(geneTree.getWidth(), 0);			}			sampleTree.paint(g);						g.translate(0, sampleTree.getHeight());			if(geneTree!=null) {				g.translate(-geneTree.getWidth(), 0);			}		}		if(geneTree!=null) {			geneTree.paint(g);			g.translate(geneTree.getWidth(), 0);		}				pinkOGramAndGeneNamesPanel.paint(g);		g.dispose();				return image;	}