Package com.sun.pdfview
Class PDFShapeCmd
java.lang.Object
com.sun.pdfview.PDFCmd
com.sun.pdfview.PDFShapeCmd
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
FieldsModifier and TypeFieldDescription(package private) BasicStroke
the stroke style for the anti-antialias strokestatic final int
perform both stroke and fillprivate Rectangle2D
the bounding box of the pathstatic final int
set the clip region to the pathstatic final int
fill the path with the fill paintprivate GeneralPath
base pathstatic final int
stroke the outline of the path with the stroke paintprivate int
the style -
Constructor Summary
ConstructorsConstructorDescriptionPDFShapeCmd
(GeneralPath gp, int style) create a new PDFShapeCmd and check it against the previous one to find any shared edges. -
Method Summary
Modifier and TypeMethodDescriptionprivate GeneralPath
checkOverlap
(PDFRenderer state) Check for overlap with the previous shape to make anti-aliased shapes that are near each other look goodexecute
(PDFRenderer state) perform the stroke and record the dirty regionGet detailed information about this shapeprivate int
getPoints
(GeneralPath path, float[] mypoints) Get an array of 16 points from a path
-
Field Details
-
STROKE
public static final int STROKEstroke the outline of the path with the stroke paint- See Also:
-
FILL
public static final int FILLfill the path with the fill paint- See Also:
-
BOTH
public static final int BOTHperform both stroke and fill- See Also:
-
CLIP
public static final int CLIPset the clip region to the path- See Also:
-
gp
base path -
style
private int stylethe style -
bounds
the bounding box of the path -
againstroke
BasicStroke againstrokethe stroke style for the anti-antialias stroke
-
-
Constructor Details
-
PDFShapeCmd
create a new PDFShapeCmd and check it against the previous one to find any shared edges.- Parameters:
gp
- the pathstyle
- the style: an OR of STROKE, FILL, or CLIP. As a convenience, BOTH = STROKE | FILL.
-
-
Method Details
-
execute
perform the stroke and record the dirty region- Specified by:
execute
in classPDFCmd
- 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.
-
checkOverlap
Check for overlap with the previous shape to make anti-aliased shapes that are near each other look good -
getPoints
Get an array of 16 points from a path- Returns:
- the number of points we actually got
-
getDetails
Get detailed information about this shape- Overrides:
getDetails
in classPDFCmd
-