|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.gnu.glib.Struct
org.freedesktop.cairo.CairoObject
org.freedesktop.cairo.Context
Constructor Summary | |
Context(Surface target)
Creates a new Context with all graphics state parameters set to default values and with target as a target surface. |
Method Summary | |
void |
arc(double x,
double y,
double radius,
double angle1,
double angle2)
|
void |
arc(Point point,
double radius,
double angle1,
double angle2)
Adds an arc from angle1 to angle2 to the current path. |
void |
arcNegative(double x,
double y,
double radius,
double angle1,
double angle2)
|
void |
arcNegative(Point point,
double radius,
double angle1,
double angle2)
Adds an arc from angle1 to angle2 to the current path. |
void |
clip()
Establishes a new clip region by intersecting the current clip region with the current path as it would be filled by fill() and according to the current fill rule (see setFillRule()). |
void |
clipPreserve()
Establishes a new clip region by intersecting the current clip region with the current path as it would be filled by fill() and according to the current fill rule (see setFillRule()). |
void |
closePath()
Closes the current path by connecting current point to the starting point with a line segment. |
void |
copyPage()
|
void |
curveTo(double x1,
double y1,
double x2,
double y2,
double x3,
double y3)
|
void |
curveTo(Point p1,
Point p2,
Point p3)
Draws a cubic bezier curve from the current point to (x3, y3) using 2 control points (x1, y1) and (x2, y2). |
Point |
deviceToUser(Point point)
Transform a coordinate from device space to user space by multiplying the given point by the inverse of the current transformation matrix (CTM). |
Point |
deviceToUserDistance(Point distance)
Transform a distance vector from device space to user space. |
void |
ellipse(double cx,
double cy,
double rx,
double ry)
Creates an ellipse path. |
void |
fill()
A drawing operator that fills the current path according to the current fill rule. |
Rectangle |
fillExtents()
|
void |
fillPreserve()
A drawing operator that fills the current path according to the current fill rule. |
FontExtents |
fontExtents()
Gets the font extents for the currently selected font. |
Antialias |
getAntialias()
|
Point |
getCurrentPoint()
Returns the current point of the surface. |
FillRule |
getFillRule()
Gets the current fill rule, as set by setFillRule(). |
FontFace |
getFontFace()
Gets the current font face. |
Matrix |
getFontMatrix()
Gets the current font matrix. |
FontOptions |
getFontOptions()
|
LineCap |
getLineCap()
Returns current linecap style. |
LineJoin |
getLineJoin()
Return current line join style. |
double |
getLineWidth()
Returns the stroke line width. |
Matrix |
getMatrix()
Returns the current transformation matrix |
double |
getMiterLimit()
Returns the miter limit for miter style line joins |
Operator |
getOperator()
Returns the current surface operator |
Pattern |
getSource()
Gets the current source pattern for this object. |
Surface |
getTarget()
Gets the target surface for the cairo context as passed to the constructor. |
double |
getTolerance()
Returns the tesselation tolerance of the current state. |
TextExtents |
glyphExtents(Glyph[] glyphs)
Gets the extents for an array of glyphs. |
void |
glyphPath(Glyph[] glyphs)
|
void |
identityMatrix()
Resets the current transformation matrix (CTM) by setting it equal to the identity matrix. |
void |
lineTo(double x,
double y)
|
void |
lineTo(Point p)
Draws a line segment as part of the current path. |
void |
mask(Pattern pattern)
A drawing operator that paints the current source using the alpha channel of pattern as a mask. |
void |
mask(Surface surface,
double sx,
double sy)
A drawing operator that paints the current source using the alpha channel of surface as a mask. |
void |
moveTo(double x,
double y)
|
void |
moveTo(Point p)
Moves the current point in the path to the given co-ordinates. |
void |
newPath()
Starts a new path. |
void |
paint()
A drawing operator that paints the current source everywhere within the current clip region. |
void |
paintWithAlpha(double alpha)
A drawing operator that paints the current source everywhere within the current clip region using a mask of constant alpha value alpha. |
void |
rectangle(Point p1,
Point p2)
|
void |
rectangle(Rectangle rect)
|
void |
relCurveTo(double x1,
double y1,
double x2,
double y2,
double x3,
double y3)
|
void |
relCurveTo(Point p1,
Point p2,
Point p3)
Draws a cubic bezier curve from the current point to p3 using 2 control points p1 and p2. |
void |
relLineTo(double x,
double y)
|
void |
relLineTo(Point p)
Draws a line segment as part of the current path. |
void |
relMoveTo(double x,
double y)
|
void |
relMoveTo(Point p)
Moves to the current path to a new point. |
void |
resetClip()
Reset the current clip region to its original, unrestricted state. |
void |
restore()
Restores the state saved by a preceding call to save()
and removes that state from the stack of saved states. |
void |
rotate(double angle)
Modifies the current transformation matrix (CTM) by rotating the user-space axes by angle radians. |
void |
save()
Makes a copy of the current state and saves it on an internal stack of saved states. |
void |
scale(double sx,
double sy)
Modifies the current transformation matrix (CTM) by scaling the X and Y user-space axes by sx and sy respectively. |
void |
selectFontFace(java.lang.String family,
FontSlant slant,
FontWeight weight)
Selects a family and style of font from a simplified description as a family name, slant and weight. |
void |
setAntialias(Antialias antialias)
|
void |
setDash(double[] dashes,
double offset)
Sets the line dash. |
void |
setFillRule(FillRule fillrule)
Set the current fill rule within the Context. |
void |
setFontFace(FontFace fontFace)
Replaces the current FontFace object in the context with fontFace. |
void |
setFontMatrix(Matrix matrix)
Sets the current font matrix to matrix. |
void |
setFontOptions(FontOptions fontOptions)
|
void |
setFontSize(double scale)
Sets the current font matrix to a scale by a factor of size, replacing any font matrix previously set with cairo_setFontSize() or setFontMatrix(). |
void |
setLineCap(LineCap linecap)
Sets the current line cap style within the cairo context. |
void |
setLineJoin(LineJoin linejoin)
Sets the current line join style within the cairo context. |
void |
setLineWidth(double width)
Sets the current line width within the cairo context. |
void |
setMatrix(Matrix matrix)
Modifies the current transformation matrix (CTM) by setting it equal to matrix. |
void |
setMiterLimit(double limit)
Sets the miter limit. |
void |
setOperator(Operator op)
Sets the compositing operator to be used for all drawing operations. |
void |
setSource(Pattern pattern)
Sets the source pattern within the Cairo object. |
void |
setSource(Surface surface,
double x,
double y)
|
void |
setSourceRGB(double red,
double green,
double blue)
Sets a constant color for filling and stroking. |
void |
setSourceRGBA(double red,
double green,
double blue,
double alpha)
Sets the source pattern within this Cairo object to a translucent color. |
void |
setTolerance(double tolerance)
Sets the tolerance used when converting paths into trapezoids. |
void |
showGlyphs(Glyph[] glyphs)
|
void |
showPage()
|
void |
showText(java.lang.String text)
Draws the given text on the screen. |
Status |
status()
|
void |
stroke()
A drawing operator that strokes the current path according to the current line width, line join, line cap, and dash settings. |
Rectangle |
strokeExtents()
|
void |
strokePreserve()
A drawing operator that strokes the current path according to the current line width, line join, line cap, and dash settings. |
TextExtents |
textExtents(java.lang.String text)
Gets the extents for a string of text. |
void |
textPath(java.lang.String text)
|
void |
transform(Matrix matrix)
Modifies the current transformation matrix (CTM) by applying matrix as an additional transformation. |
void |
translate(double tx,
double ty)
Modifies the current transformation matrix (CTM) by tanslating the user-space origin by (tx, ty). |
Point |
userToDevice(Point point)
Transform a coordinate from user space to device space by multiplying the given point by the current transformation matrix (CTM). |
Point |
userToDeviceDistance(Point distance)
Transform a distance vector from user space to device space. |
Methods inherited from class org.gnu.glib.Struct |
equals, getHandle, getNullHandle, hashCode |
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Context(Surface target)
target
- target surface for the context.Method Detail |
public void save()
restore()
is called, the saved state will be restored.
Multiple calls save() and restore() can be nested;
each call to restore() restores the state from the matching
paired save().
public void restore()
save()
and removes that state from the stack of saved states.
public void setOperator(Operator op)
op
- public void setSource(Pattern pattern)
pattern
- public void setSourceRGB(double red, double green, double blue)
red
- green
- blue
- public void setSourceRGBA(double red, double green, double blue, double alpha)
red
- green
- blue
- alpha
- public void setSource(Surface surface, double x, double y)
surface
- x
- y
- public void setTolerance(double tolerance)
tolerance
- public void setFillRule(FillRule fillrule)
fillrule
- public void setLineWidth(double width)
width
- public void setLineCap(LineCap linecap)
linecap
- public void setLineJoin(LineJoin linejoin)
linejoin
- public void setDash(double[] dashes, double offset)
dashes
- offset
- public void setMiterLimit(double limit)
limit
- public void translate(double tx, double ty)
tx
- ty
- public void scale(double sx, double sy)
sx
- sy
- public void rotate(double angle)
angle
- public void transform(Matrix matrix)
matrix
- the transformation matrix to appendpublic void setMatrix(Matrix matrix)
matrix
- the transformation matrixpublic void identityMatrix()
public Point userToDevice(Point point)
public Point userToDeviceDistance(Point distance)
public Point deviceToUser(Point point)
public Point deviceToUserDistance(Point distance)
public void newPath()
public void moveTo(Point p)
p
- the point co-ordinate of the point to move topublic void moveTo(double x, double y)
public void lineTo(Point p)
p
- the point coordinate for the end point for the line segmentpublic void lineTo(double x, double y)
public void curveTo(Point p1, Point p2, Point p3)
p1
- x co-ordinate of the first control pointp2
- x co-ordinate of the second control pointp3
- x co-ordinate of the end pointpublic void curveTo(double x1, double y1, double x2, double y2, double x3, double y3)
public void arc(Point point, double radius, double angle1, double angle2)
point
- radius
- angle1
- angle2
- public void arc(double x, double y, double radius, double angle1, double angle2)
public void arcNegative(Point point, double radius, double angle1, double angle2)
point
- radius
- angle1
- angle2
- public void arcNegative(double x, double y, double radius, double angle1, double angle2)
public void relMoveTo(Point p)
p
- relative distance between current point and the new pointpublic void relMoveTo(double x, double y)
public void relLineTo(Point p)
p
- The relative coordinate for the end point for the line segmentpublic void relLineTo(double x, double y)
public void relCurveTo(Point p1, Point p2, Point p3)
p1
- relative co-ordinate of the first control pointp2
- relative co-ordinate of the second control pointp3
- relative co-ordinate of the end pointpublic void relCurveTo(double x1, double y1, double x2, double y2, double x3, double y3)
public void rectangle(Point p1, Point p2)
public void rectangle(Rectangle rect)
public void closePath()
public void paint()
public void paintWithAlpha(double alpha)
alpha
- public void mask(Pattern pattern)
pattern
- public void mask(Surface surface, double sx, double sy)
surface
- sx
- sy
- public void stroke()
public void strokePreserve()
public void fill()
public void fillPreserve()
public void copyPage()
public void showPage()
public Rectangle strokeExtents()
public Rectangle fillExtents()
public void resetClip()
public void clip()
public void clipPreserve()
public void selectFontFace(java.lang.String family, FontSlant slant, FontWeight weight)
family
- font family nameslant
- font slantweight
- font weightpublic void setFontSize(double scale)
scale
- the scaling factor.public void setFontMatrix(Matrix matrix)
matrix
- transformation matrix.public Matrix getFontMatrix()
public void showText(java.lang.String text)
text
- String to draw on the screen.public void showGlyphs(Glyph[] glyphs)
public FontFace getFontFace()
public FontExtents fontExtents()
public void setFontFace(FontFace fontFace)
fontFace
- public TextExtents textExtents(java.lang.String text)
public TextExtents glyphExtents(Glyph[] glyphs)
public void textPath(java.lang.String text)
public void glyphPath(Glyph[] glyphs)
public Operator getOperator()
public Pattern getSource()
public double getTolerance()
public Point getCurrentPoint()
public FillRule getFillRule()
public double getLineWidth()
public LineCap getLineCap()
public LineJoin getLineJoin()
public double getMiterLimit()
public Matrix getMatrix()
public Surface getTarget()
public Status status()
public void setAntialias(Antialias antialias)
public Antialias getAntialias()
public void setFontOptions(FontOptions fontOptions)
public FontOptions getFontOptions()
public void ellipse(double cx, double cy, double rx, double ry)
cx
- X co-ordinate of the center of ellipsecy
- Y co-ordinate of the center of ellipserx
- X radius of the ellipsery
- Y radius of the ellipse
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |