|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.foray.ps.PsObjectComposite
org.foray.ps.PsGraphicsState
public class PsGraphicsState
Represents a PostScript Graphics State. According to PSLRM 2nd Edition, Section 4.2, the Graphics State is not itself an object. However, gstate is an object, and can be placed on the operand stack. Until we see a need to keep the two separate, we will treat the Graphics State and gstate as equivalent, and PsGraphicsState will extend PsObject.
Constructor Summary | |
---|---|
PsGraphicsState()
Constructor. |
Method Summary | |
---|---|
PsGraphicsState |
clone()
|
void |
closepath()
Closes the current sub-path. |
protected void |
copy(PsGraphicsState copyFrom)
Copies the contents of copyFrom into this, in conformity with the requirements of the copy operator. |
void |
curveto(PsNumber control1X,
PsNumber control1Y,
PsNumber control2X,
PsNumber control2Y,
PsNumber control3X,
PsNumber control3Y)
Marks the control points in a new Bezier curve segment in the current path. |
PsGraphicsState |
duplicate()
This is a shallow copy. |
Color |
getColor()
Returns the color. |
PsColorSpace |
getColorSpace()
Return the colorspace. |
PsMatrix |
getCTM()
Returns the current transformation matrix (CTM). |
float |
getDashOffset()
Returns the dash offset. |
PsArray |
getDashPattern()
Returns the dash pattern. |
BigDecimal |
getFlatness()
Returns the flatness. |
PsDictionary |
getFont()
Returns the font. |
PsInteger |
getLineCap()
Returns the line cap value. |
PsInteger |
getLineJoin()
Returns the line join value. |
PsNumber |
getLineWidth()
Returns the line width. |
PsNumber |
getMiterLimit()
Returns the miter limit. |
PsNumber |
getPositionX()
Returns the current "x" position, that is, the horizontal position of the "cursor" in user space units. |
PsNumber |
getPositionY()
Returns the current "y" position, that is, the vertical position of the "cursor" in user space units. |
PsName |
getTypeName()
Needed for the "type" operator. |
boolean |
isComparable(PsObject object)
Test the comparability of two PSObjects. |
boolean |
isComposite()
The method should be overridden by composite objects. |
boolean |
isExecutable()
Indicates whether this object is executable. |
void |
lineto(PsNumber x,
PsNumber y)
Marks the end-point of a new line segment in the current path. |
void |
moveto(PsNumber x,
PsNumber y)
Starts a new sub-path in the current path. |
void |
newpath()
Sets the current path to null. |
void |
setColor(Color newColor)
Sets the color. |
void |
setColorSpace(int colorSpace)
Sets the color space. |
void |
setCTM(PsMatrix ctm)
Sets the current transformation matrix (CTM). |
void |
setDash(PsArray dashPattern,
float dashOffset)
Set the dash pattern and offset. |
void |
setFlatness(BigDecimal flatness)
Sets the flatness. |
void |
setFont(PsDictionary font)
Sets the font. |
void |
setLineCap(PsInteger lineCap)
Sets the line cap value. |
void |
setLineJoin(PsInteger lineJoin)
Sets the line join value. |
void |
setLineWidth(PsNumber lineWidth)
Sets the line width. |
void |
setMiterLimit(PsNumber miterLimit)
Sets the miter limit. |
Methods inherited from class org.foray.ps.PsObjectComposite |
---|
getAccess, setAccess |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PsGraphicsState()
Method Detail |
---|
public PsGraphicsState clone()
clone
in class Object
public void setColorSpace(int colorSpace)
colorSpace
- The new colorspace.public void setColor(Color newColor)
newColor
- The new color.public Color getColor()
public PsColorSpace getColorSpace()
public void setDash(PsArray dashPattern, float dashOffset)
dashPattern
- The dash pattern to set.dashOffset
- The dash offset to set.public PsArray getDashPattern()
public float getDashOffset()
public void setFlatness(BigDecimal flatness)
flatness
- The new flatness.public BigDecimal getFlatness()
public PsInteger getLineJoin()
public void setLineJoin(PsInteger lineJoin)
lineJoin
- The line join value to set.public PsInteger getLineCap()
public void setLineCap(PsInteger lineCap)
lineCap
- The line cap value to set.public PsNumber getLineWidth()
public void setLineWidth(PsNumber lineWidth)
lineWidth
- The line width to set.public PsNumber getMiterLimit()
public void setMiterLimit(PsNumber miterLimit)
miterLimit
- The miter limit to set.public PsMatrix getCTM()
public void setCTM(PsMatrix ctm)
ctm
- The ctm to set.public PsDictionary getFont()
public void setFont(PsDictionary font)
font
- The font to set.public PsNumber getPositionX()
public PsNumber getPositionY()
public void newpath()
public void closepath()
public void moveto(PsNumber x, PsNumber y)
x
- The x value of the start of the new sub-path.y
- The y value of the start of the new sub-path.public void lineto(PsNumber x, PsNumber y)
x
- The x value of the line segment end-point.y
- The y value of the line segment end-point.public void curveto(PsNumber control1X, PsNumber control1Y, PsNumber control2X, PsNumber control2Y, PsNumber control3X, PsNumber control3Y)
control1X
- The x value of control point 1 in the curve segment.control1Y
- The y value of control point 1 in the curve segment.control2X
- The x value of control point 2 in the curve segment.control2Y
- The y value of control point 2 in the curve segment.control3X
- The x value of control point 3 in the curve segment.control3Y
- The y value of control point 3 in the curve segment.public PsGraphicsState duplicate()
PsObject
duplicate
in interface PsObject
public boolean isExecutable()
PsObject
isExecutable
in interface PsObject
public boolean isComparable(PsObject object)
PsObject
isComparable
in interface PsObject
object
- The object that should be tested for comparability.
this
is comparable to object
,
false otherwise.public PsName getTypeName()
PsObject
getTypeName
in interface PsObject
protected void copy(PsGraphicsState copyFrom)
copyFrom
- The PsGraphicsState
instance which should be
copied.public boolean isComposite()
PsObject
isComposite
in interface PsObject
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |