Package 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 Modifier and Type Field Description (package private) java.awt.BasicStroke
againstroke
the stroke style for the anti-antialias strokestatic int
BOTH
perform both stroke and fillprivate java.awt.geom.Rectangle2D
bounds
the bounding box of the pathstatic int
CLIP
set the clip region to the pathstatic int
FILL
fill the path with the fill paintprivate java.awt.geom.GeneralPath
gp
base pathstatic int
STROKE
stroke the outline of the path with the stroke paintprivate int
style
the style
-
Constructor Summary
Constructors Constructor 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private java.awt.geom.GeneralPath
checkOverlap(PDFRenderer state)
Check for overlap with the previous shape to make anti-aliased shapes that are near each other look goodjava.awt.geom.Rectangle2D
execute(PDFRenderer state)
perform the stroke and record the dirty regionjava.lang.String
getDetails()
Get detailed information about this shapeprivate int
getPoints(java.awt.geom.GeneralPath path, float[] mypoints)
Get an array of 16 points from a path
-
-
-
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
-
gp
private java.awt.geom.GeneralPath gp
base path
-
style
private int style
the style
-
bounds
private java.awt.geom.Rectangle2D bounds
the bounding box of the path
-
againstroke
java.awt.BasicStroke againstroke
the stroke style for the anti-antialias stroke
-
-
Method Detail
-
execute
public java.awt.geom.Rectangle2D execute(PDFRenderer state)
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
private java.awt.geom.GeneralPath checkOverlap(PDFRenderer state)
Check for overlap with the previous shape to make anti-aliased shapes that are near each other look good
-
getPoints
private int getPoints(java.awt.geom.GeneralPath path, float[] mypoints)
Get an array of 16 points from a path- Returns:
- the number of points we actually got
-
getDetails
public java.lang.String getDetails()
Get detailed information about this shape- Overrides:
getDetails
in classPDFCmd
-
-