| Constructor and Description |
|---|
WebGraphics(com.google.gwt.canvas.dom.client.Context2d context) |
WebGraphics(com.google.gwt.canvas.dom.client.Context2d context,
Component component) |
| Modifier and Type | Method and Description |
|---|---|
void |
clearRect(int x,
int y,
int width,
int height)
Clears the specified rectangle by filling it with the background color of the current drawing
surface.
|
void |
clipRect(int x,
int y,
int width,
int height)
Intersects the current clip with the specified rectangle.
|
void |
draw(Shape shape)
Strokes a shape
|
void |
drawChars(char[] data,
int offset,
int length,
int x,
int y)
Draws the text given by the specified character array, using this graphics context's current
font and color.
|
void |
drawLine(double x,
double y,
double x2,
double y2) |
void |
drawString(String str,
int x,
int y)
Draws the text given by the specified string, using this graphics context's current font and
color.
|
void |
fill(Shape shape)
Fills a shape
|
void |
forceRepaint()
Forces a Repaint of the Component
|
com.google.gwt.canvas.dom.client.Context2d |
getContext2d() |
void |
setClip(int x,
int y,
int width,
int height)
Sets the current clip to the rectangle specified by the given coordinates.
|
void |
setClip(Shape clip)
Sets the current clipping area to an arbitrary clip shape.
|
void |
setColor(Color color)
Sets the Color to Fill/Stroke
|
void |
setFillColor(Color color) |
void |
setStroke(BasicStroke stroke)
sets the line style
|
void |
translate(int x,
int y) |
public WebGraphics(com.google.gwt.canvas.dom.client.Context2d context)
public WebGraphics(com.google.gwt.canvas.dom.client.Context2d context,
Component component)
public void forceRepaint()
GraphicsforceRepaint in interface Graphicspublic com.google.gwt.canvas.dom.client.Context2d getContext2d()
getContext2d in interface Graphicspublic void setColor(Color color)
Graphicspublic void setFillColor(Color color)
setFillColor in interface Graphicspublic void setStroke(BasicStroke stroke)
Graphicspublic void clipRect(int x,
int y,
int width,
int height)
GraphicssetClip(null), the specified rectangle becomes the new clip. This method sets the
user clip, which is independent of the clipping associated with device bounds and window
visibility. This method can only be used to make the current clip smaller. To set the current
clip larger, use any of the setClip methods. Rendering operations have no effect outside of the
clipping area.clipRect in interface Graphicsx - the x coordinate of the rectangle to intersect the clip withy - the y coordinate of the rectangle to intersect the clip withwidth - the width of the rectangle to intersect the clip withheight - the height of the rectangle to intersect the clip withGraphics.setClip(int, int, int, int),
Graphics.setClip(Shape)public void setClip(int x,
int y,
int width,
int height)
Graphicspublic void setClip(Shape clip)
GraphicsShape interface can be used to set the clip. The only Shape objects
that are guaranteed to be supported are Shape objects that are obtained via the
getClip method and via Rectangle objects. This method sets the user
clip, which is independent of the clipping associated with device bounds and window visibility.public void clearRect(int x,
int y,
int width,
int height)
Graphics
Beginning with Java 1.1, the background color of offscreen images may be system dependent.
Applications should use setColor followed by fillRect to ensure that
an offscreen image is cleared to a specific color.
public void drawString(String str, int x, int y)
GraphicsdrawString in interface Graphicsstr - the string to be drawn.x - the x coordinate.y - the y coordinate.public void drawChars(char[] data,
int offset,
int length,
int x,
int y)
GraphicsCopyright © 2015 levigo. All Rights Reserved.