afreechart/src/main/java/org/afree/chart/plot/dial/DialPlot.java
/**
     * Draws the plot.  This method is usually called by the {@link AFreeChart}
     * instance that manages the plot.
     *
     * @param canvas  the graphics target.
     * @param area  the area in which the plot should be drawn.
     * @param anchor  the anchor point (typically the last point that the
     *     mouse clicked on, <code>null</code> is permitted).
     * @param parentState  the state for the parent plot (if any).
     * @param info  used to collect plot rendering info (<code>null</code>
     *     permitted).
     */
Draws the plot.  This method is usually called by the  AFreeChart
instance that manages the plot.

@param canvas  the graphics target.
@param area  the area in which the plot should be drawn.
@param anchor  the anchor point (typically the last point that the
mouse clicked on, null is permitted).
@param parentState  the state for the parent plot (if any).
@param info  used to collect plot rendering info (null
permitted).
Draws the plot . This method is usually called by the AFreeChart instance that manages the plot . @param canvas the graphics target . @param area the area in which the plot should be drawn . @param anchor the anchor point ( typically the last point that the mouse clicked on null is permitted ) . @param parentState the state for the parent plot ( if any ) . @param info used to collect plot rendering info ( null permitted ) .
public void draw(Canvas canvas, RectShape area, PointF anchor,
            PlotState parentState, PlotRenderingInfo info) {
        canvas.getClipBounds();
        canvas.save();
        canvas.clipRect(area.getMinX(), area.getMinY(), area.getMaxX(), area.getMaxY());
        RectShape frame = viewToFrame(area);
        if (this.background != null && this.background.isVisible()) {
            if (this.background.isClippedToWindow()) {
                RectShape savedClip = new RectShape(canvas.getClipBounds());
                canvas.clipPath(this.dialFrame.getWindow(frame).getPath());
                this.background.draw(canvas, this, frame, area);
                canvas.clipRect(savedClip.getRectF(), Op.REPLACE);
            }
            else {
                this.background.draw(canvas, this, frame, area);
            }
        }
        Iterator iterator = this.layers.iterator();
        while (iterator.hasNext()) {
            DialLayer current = (DialLayer) iterator.next();
            if (current.isVisible()) {
                if (current.isClippedToWindow()) {
                    RectShape savedClip = new RectShape(canvas.getClipBounds());
                    canvas.clipPath(this.dialFrame.getWindow(frame).getPath());
                    current.draw(canvas, this, frame, area);
                    canvas.clipRect(savedClip.getRectF(), Op.REPLACE);
                }
                else {
                    current.draw(canvas, this, frame, area);
                }
            }
        }
        iterator = this.pointers.iterator();
        while (iterator.hasNext()) {
            DialPointer current = (DialPointer) iterator.next();
            if (current.isVisible()) {
                if (current.isClippedToWindow()) {
                    RectShape savedClip = new RectShape(canvas.getClipBounds());
                    canvas.clipPath(this.dialFrame.getWindow(frame).getPath());
                    current.draw(canvas, this, frame, area);
                    canvas.clipRect(savedClip.getRectF(), Op.REPLACE);
                }
                else {
                    current.draw(canvas, this, frame, area);
                }
            }
        }
        if (this.cap != null && this.cap.isVisible()) {
            if (this.cap.isClippedToWindow()) {
                RectShape savedClip = new RectShape(canvas.getClipBounds());
                canvas.clipPath(this.dialFrame.getWindow(frame).getPath());
                this.cap.draw(canvas, this, frame, area);
                canvas.clipRect(savedClip.getRectF(), Op.REPLACE);
            }
            else {
                this.cap.draw(canvas, this, frame, area);
            }
        }
        if (this.dialFrame.isVisible()) {
            this.dialFrame.draw(canvas, this, frame, area);
        }
        canvas.restore();
    }
public void draw ( Canvas canvas , RectShape area , PointF anchor , PlotState parentState , PlotRenderingInfo info ) { canvas . getClipBounds ( ) ; canvas . save ( ) ; canvas . clipRect ( area . getMinX ( ) , area . getMinY ( ) , area . getMaxX ( ) , area . getMaxY ( ) ) ; RectShape frame = viewToFrame ( area ) ; if ( this . background != null && this . background . isVisible ( ) ) { if ( this . background . isClippedToWindow ( ) ) { RectShape savedClip = new RectShape ( canvas . getClipBounds ( ) ) ; canvas . clipPath ( this . dialFrame . getWindow ( frame ) . getPath ( ) ) ; this . background . draw ( canvas , this , frame , area ) ; canvas . clipRect ( savedClip . getRectF ( ) , Op . REPLACE ) ; } else { this . background . draw ( canvas , this , frame , area ) ; } } Iterator iterator = this . layers . iterator ( ) ; while ( iterator . hasNext ( ) ) { DialLayer current = ( DialLayer ) iterator . next ( ) ; if ( current . isVisible ( ) ) { if ( current . isClippedToWindow ( ) ) { RectShape savedClip = new RectShape ( canvas . getClipBounds ( ) ) ; canvas . clipPath ( this . dialFrame . getWindow ( frame ) . getPath ( ) ) ; current . draw ( canvas , this , frame , area ) ; canvas . clipRect ( savedClip . getRectF ( ) , Op . REPLACE ) ; } else { current . draw ( canvas , this , frame , area ) ; } } } iterator = this . pointers . iterator ( ) ; while ( iterator . hasNext ( ) ) { DialPointer current = ( DialPointer ) iterator . next ( ) ; if ( current . isVisible ( ) ) { if ( current . isClippedToWindow ( ) ) { RectShape savedClip = new RectShape ( canvas . getClipBounds ( ) ) ; canvas . clipPath ( this . dialFrame . getWindow ( frame ) . getPath ( ) ) ; current . draw ( canvas , this , frame , area ) ; canvas . clipRect ( savedClip . getRectF ( ) , Op . REPLACE ) ; } else { current . draw ( canvas , this , frame , area ) ; } } } if ( this . cap != null && this . cap . isVisible ( ) ) { if ( this . cap . isClippedToWindow ( ) ) { RectShape savedClip = new RectShape ( canvas . getClipBounds ( ) ) ; canvas . clipPath ( this . dialFrame . getWindow ( frame ) . getPath ( ) ) ; this . cap . draw ( canvas , this , frame , area ) ; canvas . clipRect ( savedClip . getRectF ( ) , Op . REPLACE ) ; } else { this . cap . draw ( canvas , this , frame , area ) ; } } if ( this . dialFrame . isVisible ( ) ) { this . dialFrame . draw ( canvas , this , frame , area ) ; } canvas . restore ( ) ; }
Draws the plot.
Draws the plot .
// first, expand the viewing area into a drawing frame // draw the background if there is one... // draw the pointers // draw the cap if there is one...