List of usage examples for javafx.scene.canvas GraphicsContext clearRect
public void clearRect(double x, double y, double w, double h)
From source file:de.hs.mannheim.modUro.controller.diagram.fx.ChartCanvas.java
/** * Draws the content of the canvas and updates the * {@code renderingInfo} attribute with the latest rendering * information.//from ww w. ja va 2 s.c om */ public final void draw() { GraphicsContext ctx = getGraphicsContext2D(); ctx.save(); double width = getWidth(); double height = getHeight(); if (width > 0 && height > 0) { ctx.clearRect(0, 0, width, height); this.info = new ChartRenderingInfo(); this.chart.draw(this.g2, new Rectangle((int) width, (int) height), this.anchor, this.info); } ctx.restore(); this.anchor = null; }