com.sun.pdfview

## Class PDFShapeCmd

- java.lang.Object
- - com.sun.pdfview.PDFCmd
  - - com.sun.pdfview.PDFShapeCmd

    public class PDFShapeCmd
    extends PDFCmd

Encapsulates a path. Also contains extra fields and logic to check for consecutive abutting anti-aliased regions. We stroke the shared line between these regions again with a 1-pixel wide line so that the background doesn't show through between them.

### Field Summary

Fields
`static int` `BOTH` perform both stroke and fill
`static int` `CLIP` set the clip region to the path
`static int` `FILL` fill the path with the fill paint
`static int` `STROKE` stroke the outline of the path with the stroke paint

### Constructor Summary

Constructors
Constructor and Description
`PDFShapeCmd(java.awt.geom.GeneralPath gp, int style)` create a new PDFShapeCmd and check it against the previous one to find any shared edges.

### Method Summary

Methods
`java.awt.geom.Rectangle2D` `execute(PDFRenderer state)` perform the stroke and record the dirty region
`java.lang.String` `getDetails()` Get detailed information about this shape

### Methods inherited from class com.sun.pdfview.PDFCmd

`toString`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Field Detail

#### STROKE

    public static final int STROKE

stroke the outline of the path with the stroke paint

See Also:
  Constant Field Values

#### FILL

    public static final int FILL

fill the path with the fill paint

See Also:
  Constant Field Values

#### BOTH

    public static final int BOTH

perform both stroke and fill

See Also:
  Constant Field Values

#### CLIP

    public static final int CLIP

set the clip region to the path

See Also:
  Constant Field Values

### Constructor Detail

#### PDFShapeCmd

    public PDFShapeCmd(java.awt.geom.GeneralPath gp,
               int style)

create a new PDFShapeCmd and check it against the previous one to find any shared edges.

Parameters:
  `gp` - the path
  `style` - the style: an OR of STROKE, FILL, or CLIP. As a convenience, BOTH = STROKE | FILL.

### Method Detail

#### execute

    public java.awt.geom.Rectangle2D execute(PDFRenderer state)

perform the stroke and record the dirty region

Specified by:
  `execute` in class `PDFCmd`
Parameters:
  `state` - the current graphics state; may be modified during execution.
Returns:
  the region of the page made dirty by executing this command or null if no region was touched. Note this value should be in the coordinates of the image touched, not the page.

#### getDetails

    public java.lang.String getDetails()

Get detailed information about this shape

Overrides:
  `getDetails` in class `PDFCmd`