|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnodebox.graphics.AbstractGraphicsContext
nodebox.graphics.CanvasContext
public class CanvasContext
| Nested Class Summary | |
|---|---|
static class |
CanvasContext.ImageMode
|
| Nested classes/interfaces inherited from interface nodebox.graphics.GraphicsContext |
|---|
GraphicsContext.ArrowType, GraphicsContext.EllipseMode, GraphicsContext.RectMode, GraphicsContext.VarType |
| Field Summary | |
|---|---|
static double |
DEFAULT_HEIGHT
|
static double |
DEFAULT_WIDTH
|
protected CanvasContext.ImageMode |
imageMode
|
| Fields inherited from class nodebox.graphics.AbstractGraphicsContext |
|---|
align, autoClosePath, colorMode, colorRange, ellipseMode, fillColor, fontName, fontSize, lineHeight, path, pathClosed, rectMode, strokeColor, strokeWidth, transform, transformMode, transformStack |
| Fields inherited from interface nodebox.graphics.GraphicsContext |
|---|
BOOLEAN, CENTER, cm, CMYK, CORNER, CORNERS, FONT, FORTYFIVE, HSB, inch, JUSTIFY, LEFT, mm, NORMAL, NUMBER, RADIUS, RGB, RIGHT, TEXT |
| Constructor Summary | |
|---|---|
CanvasContext()
|
|
CanvasContext(Canvas canvas)
|
|
| Method Summary | |
|---|---|
protected void |
addImage(Image i)
|
protected void |
addPath(Path p)
|
protected void |
addText(Text t)
|
Color |
background()
Get the current background color. |
Color |
background(Color c)
Set the current background color to the given color. |
Color |
background(double x)
Set the current background color to given grayscale value. |
Color |
background(double x,
double y)
Set the current background color to given grayscale and alpha value. |
Color |
background(double x,
double y,
double z)
Set the current background color to the given R/G/B value. |
Color |
background(double x,
double y,
double z,
double a)
Set the current background color to the given R/G/B/A value. |
void |
draw(Grob grob)
The draw method doesn't actually draw anything, but rather appends grobs to the canvas. |
Canvas |
getCanvas()
|
double |
getHeight()
|
double |
getHEIGHT()
|
double |
getWidth()
|
double |
getWIDTH()
|
Image |
image(BufferedImage img,
double x,
double y,
double width,
double height,
double alpha,
boolean draw)
|
Image |
image(Image img,
double x,
double y,
double width,
double height,
double alpha,
boolean draw)
|
Image |
image(String path,
double x,
double y)
|
Image |
image(String path,
double x,
double y,
double width)
|
Image |
image(String path,
double x,
double y,
double width,
double height)
|
Image |
image(String path,
double x,
double y,
double width,
double height,
boolean draw)
|
Image |
image(String path,
double x,
double y,
double width,
double height,
double alpha)
|
Image |
image(String path,
double x,
double y,
double width,
double height,
double alpha,
boolean draw)
|
CanvasContext.ImageMode |
imagemode()
|
CanvasContext.ImageMode |
imagemode(CanvasContext.ImageMode m)
|
Size |
imagesize(BufferedImage img)
|
Size |
imagesize(Image img)
|
Size |
imagesize(String path)
|
protected void |
inheritFromContext(Image i)
|
void |
nobackground()
|
void |
resetContext()
|
void |
resetContext(boolean resetBackground)
|
void |
size(double width,
double height)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final double DEFAULT_WIDTH
public static final double DEFAULT_HEIGHT
protected CanvasContext.ImageMode imageMode
| Constructor Detail |
|---|
public CanvasContext()
public CanvasContext(Canvas canvas)
| Method Detail |
|---|
public void resetContext()
resetContext in class AbstractGraphicsContextpublic void resetContext(boolean resetBackground)
public CanvasContext.ImageMode imagemode()
public CanvasContext.ImageMode imagemode(CanvasContext.ImageMode m)
public void size(double width,
double height)
public double getWidth()
public double getHeight()
public double getWIDTH()
public double getHEIGHT()
public Color background()
public Color background(double x)
x - the gray component.
public Color background(double x,
double y)
x - the grayscale value.y - the alpha value.
public Color background(double x,
double y,
double z)
x - the red component.y - the green component.z - the blue component.
public Color background(double x,
double y,
double z,
double a)
x - the red component.y - the green component.z - the blue component.a - the alpha component.
public Color background(Color c)
c - the color object.
public void nobackground()
public Canvas getCanvas()
public Image image(String path,
double x,
double y)
image in interface GraphicsContextimage in class AbstractGraphicsContext
public Image image(String path,
double x,
double y,
double width)
image in interface GraphicsContextimage in class AbstractGraphicsContext
public Image image(String path,
double x,
double y,
double width,
double height)
image in interface GraphicsContextimage in class AbstractGraphicsContext
public Image image(String path,
double x,
double y,
double width,
double height,
double alpha)
image in interface GraphicsContextimage in class AbstractGraphicsContext
public Image image(String path,
double x,
double y,
double width,
double height,
boolean draw)
image in interface GraphicsContextimage in class AbstractGraphicsContext
public Image image(String path,
double x,
double y,
double width,
double height,
double alpha,
boolean draw)
image in interface GraphicsContextimage in class AbstractGraphicsContext
public Image image(Image img,
double x,
double y,
double width,
double height,
double alpha,
boolean draw)
image in interface GraphicsContextimage in class AbstractGraphicsContext
public Image image(BufferedImage img,
double x,
double y,
double width,
double height,
double alpha,
boolean draw)
image in interface GraphicsContextimage in class AbstractGraphicsContextpublic Size imagesize(String path)
imagesize in interface GraphicsContextimagesize in class AbstractGraphicsContextpublic Size imagesize(Image img)
imagesize in interface GraphicsContextimagesize in class AbstractGraphicsContextpublic Size imagesize(BufferedImage img)
imagesize in interface GraphicsContextimagesize in class AbstractGraphicsContextpublic void draw(Grob grob)
draw in interface GraphicsContextdraw in class AbstractGraphicsContextgrob - the grob to append to the canvasprotected void addPath(Path p)
addPath in class AbstractGraphicsContextprotected void addText(Text t)
addText in class AbstractGraphicsContextprotected void addImage(Image i)
protected void inheritFromContext(Image i)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||