Example usage for java.awt.geom GeneralPath reset

List of usage examples for java.awt.geom GeneralPath reset

Introduction

In this page you can find the example usage for java.awt.geom GeneralPath reset.

Prototype

public final synchronized void reset() 

Source Link

Document

Resets the path to empty.

Usage

From source file:org.apache.pdfbox.pdfviewer.PageDrawer.java

/**
 * Stroke the path./*w w  w .  ja  v  a 2s .c  om*/
 *
 * @throws IOException If there is an IO error while stroking the path.
 */
public void strokePath() throws IOException {
    graphics.setComposite(getGraphicsState().getStrokeJavaComposite());
    Paint strokingPaint = getGraphicsState().getStrokingColor().getJavaColor();
    if (strokingPaint == null) {
        strokingPaint = getGraphicsState().getStrokingColor().getPaint(pageSize.height);
    }
    if (strokingPaint == null) {
        LOG.info("ColorSpace " + getGraphicsState().getStrokingColor().getColorSpace().getName()
                + " doesn't provide a stroking color, using white instead!");
        strokingPaint = Color.WHITE;
    }
    graphics.setPaint(strokingPaint);
    graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF);
    graphics.setClip(getGraphicsState().getCurrentClippingPath());
    GeneralPath path = getLinePath();
    graphics.draw(path);
    path.reset();
}

From source file:org.apache.pdflens.views.pagesview.PageDrawer.java

/**
 * Stroke the path.//from  w ww .jav  a2s  . c o m
 *
 * @throws IOException If there is an IO error while stroking the path.
 */
public void strokePath() throws IOException {
    graphics.setColor(getGraphicsState().getStrokingColor().getJavaColor());
    graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF);
    graphics.setClip(getGraphicsState().getCurrentClippingPath());
    GeneralPath path = getLinePath();
    graphics.draw(path);
    path.reset();
}