nodebox.graphics
Interface GraphicsContext

All Known Implementing Classes:
AbstractGraphicsContext, CanvasContext, GeometryContext

public interface GraphicsContext


Nested Class Summary
static class GraphicsContext.ArrowType
           
static class GraphicsContext.EllipseMode
           
static class GraphicsContext.RectMode
           
static class GraphicsContext.VarType
           
 
Field Summary
static String BOOLEAN
           
static String CENTER
           
static double cm
           
static String CMYK
           
static String CORNER
           
static String CORNERS
           
static String FONT
           
static String FORTYFIVE
           
static String HSB
           
static double inch
           
static String JUSTIFY
           
static String LEFT
           
static double mm
           
static String NORMAL
           
static String NUMBER
           
static String RADIUS
           
static String RGB
           
static String RIGHT
           
static String TEXT
           
 
Method Summary
 Text.Align align()
           
 Text.Align align(int align)
           
 Text.Align align(String align)
           
 Text.Align align(Text.Align align)
           
 Path arrow(double x, double y)
           
 Path arrow(double x, double y, double width)
           
 Path arrow(double x, double y, double width, boolean draw)
           
 Path arrow(double x, double y, double width, GraphicsContext.ArrowType type)
           
 Path arrow(double x, double y, double width, GraphicsContext.ArrowType type, boolean draw)
           
 Path arrow(double x, double y, double width, int type)
           
 Path arrow(double x, double y, double width, int type, boolean draw)
           
 Path arrow(double x, double y, double width, String type)
           
 Path arrow(double x, double y, double width, String type, boolean draw)
           
 Path arrow(double x, double y, GraphicsContext.ArrowType type)
           
 Path arrow(double x, double y, int type)
           
 Path arrow(double x, double y, String type)
           
 boolean autoclosepath()
           
 boolean autoclosepath(boolean c)
           
 void beginclip(Path p)
           
 void beginpath()
           
 void beginpath(double x, double y)
           
 Object choice(List objects)
           
 void closepath()
           
 Color color()
          Create an empty (black) color object.
 Color color(Color c)
          Create a new color with the the given color.
 Color color(double x)
          Create a new color with the given grayscale value.
 Color color(double x, double y)
          Create a new color with the given grayscale and alpha value.
 Color color(double x, double y, double z)
          Create a new color with the the given R/G/B value.
 Color color(double x, double y, double z, double a)
          Create a new color with the the given R/G/B/A value.
 Color.Mode colormode()
           
 Color.Mode colormode(Color.Mode mode)
           
 Color.Mode colormode(Color.Mode mode, double range)
           
 Color.Mode colormode(int mode)
           
 Color.Mode colormode(int mode, double range)
           
 Color.Mode colormode(String mode)
           
 Color.Mode colormode(String mode, double range)
           
 double colorrange()
           
 double colorrange(double range)
           
 void curveto(double x1, double y1, double x2, double y2, double x3, double y3)
           
 void draw(Grob g)
           
 void drawpath(Iterable<Point> points)
           
 void drawpath(Path path)
           
 Path ellipse(double x, double y, double width, double height)
           
 Path ellipse(double x, double y, double width, double height, boolean draw)
           
 GraphicsContext.EllipseMode ellipsemode()
           
 GraphicsContext.EllipseMode ellipsemode(GraphicsContext.EllipseMode m)
           
 GraphicsContext.EllipseMode ellipsemode(int m)
           
 GraphicsContext.EllipseMode ellipsemode(String m)
           
 void endclip()
           
 Path endpath()
           
 Path endpath(boolean draw)
           
 Color fill()
          Get the current fill color.
 Color fill(Color c)
          Set the current fill color to the given color.
 Color fill(double x)
          Set the current fill color to given grayscale value.
 Color fill(double x, double y)
          Set the current fill color to given grayscale and alpha value.
 Color fill(double x, double y, double z)
          Set the current fill color to the given R/G/B value.
 Color fill(double x, double y, double z, double a)
          Set the current fill color to the given R/G/B/A value.
 Path findpath(List<Point> points)
           
 Path findpath(List<Point> points, double curvature)
           
 Object findVar(String name)
           
 String font()
           
 String font(String fontName)
           
 String font(String fontName, double fontSize)
           
 double fontsize()
           
 double fontsize(double s)
           
 Iterator<Point> grid(int columns, int rows)
           
 Iterator<Point> grid(int columns, int rows, double columnSize, double rowSize)
           
 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)
           
 Size imagesize(BufferedImage img)
           
 Size imagesize(Image img)
           
 Size imagesize(String path)
           
 Path line(double x1, double y1, double x2, double y2)
           
 Path line(double x1, double y1, double x2, double y2, boolean draw)
           
 double lineheight()
           
 double lineheight(double lineHeight)
           
 void lineto(double x, double y)
           
 void moveto(double x, double y)
           
 void nofill()
          Turn off the fill color.
 void nostroke()
          Turn off the stroke color.
 String outputmode()
           
 String outputmode(String mode)
           
 Path oval(double x, double y, double width, double height)
           
 Path oval(double x, double y, double width, double height, boolean draw)
           
 void pop()
           
 void push()
           
 double random()
           
 double random(double max)
           
 double random(double min, double max)
           
 long random(int max)
           
 long random(int min, int max)
           
 Path rect(double x, double y, double width, double height)
           
 Path rect(double x, double y, double width, double height, double roundness)
           
 Path rect(double x, double y, double width, double height, double rx, double ry)
           
 Path rect(Rect r)
           
 Path rect(Rect r, double roundness)
           
 GraphicsContext.RectMode rectmode()
           
 GraphicsContext.RectMode rectmode(GraphicsContext.RectMode m)
           
 GraphicsContext.RectMode rectmode(int m)
           
 GraphicsContext.RectMode rectmode(String m)
           
 void reset()
           
 void rotate(double r)
           
 void scale(double scale)
           
 void scale(double sx, double sy)
           
 void skew(double skew)
           
 void skew(double kx, double ky)
           
 Path star(double cx, double cy)
           
 Path star(double cx, double cy, int points)
           
 Path star(double cx, double cy, int points, double outer)
           
 Path star(double cx, double cy, int points, double outer, double inner)
           
 Path star(double cx, double cy, int points, double outer, double inner, boolean draw)
           
 Color stroke()
          Get the current stroke color.
 Color stroke(Color c)
          Set the current stroke color to the given color.
 Color stroke(double x)
          Set the current stroke color to given grayscale value.
 Color stroke(double x, double y)
          Set the current stroke color to given grayscale and alpha value.
 Color stroke(double x, double y, double z)
          Set the current stroke color to the given R/G/B value.
 Color stroke(double x, double y, double z, double a)
          Set the current stroke color to the given R/G/B/A value.
 double strokewidth()
           
 double strokewidth(double w)
           
 Text text(String text, double x, double y)
           
 Text text(String text, double x, double y, double width)
           
 Text text(String text, double x, double y, double width, double height)
           
 Text text(String text, double x, double y, double width, double height, boolean draw)
           
 double textheight(String text)
           
 double textheight(String text, double width)
           
 Rect textmetrics(String text)
           
 Rect textmetrics(String text, double width)
           
 Rect textmetrics(String text, double width, double height)
           
 Path textpath(String text, double x, double y)
           
 Path textpath(String text, double x, double y, double width)
           
 Path textpath(String text, double x, double y, double width, double height)
           
 double textwidth(String text)
           
 double textwidth(String text, double width)
           
 Transform.Mode transform()
           
 Transform.Mode transform(int mode)
           
 Transform.Mode transform(String mode)
           
 Transform.Mode transform(Transform.Mode mode)
           
 void translate(double tx, double ty)
           
 void var(String name, GraphicsContext.VarType type)
           
 void var(String name, GraphicsContext.VarType type, Object value)
           
 void var(String name, GraphicsContext.VarType type, Object value, double min, double max)
           
 void var(String name, int type)
           
 void var(String name, int type, Object value)
           
 void var(String name, int type, Object value, double min, double max)
           
 void var(String name, String type)
           
 void var(String name, String type, Object value)
           
 void var(String name, String type, Object value, double min, double max)
           
 

Field Detail

inch

static final double inch
See Also:
Constant Field Values

cm

static final double cm
See Also:
Constant Field Values

mm

static final double mm
See Also:
Constant Field Values

CORNER

static final String CORNER
See Also:
Constant Field Values

CENTER

static final String CENTER
See Also:
Constant Field Values

CORNERS

static final String CORNERS
See Also:
Constant Field Values

RADIUS

static final String RADIUS
See Also:
Constant Field Values

LEFT

static final String LEFT
See Also:
Constant Field Values

RIGHT

static final String RIGHT
See Also:
Constant Field Values

JUSTIFY

static final String JUSTIFY
See Also:
Constant Field Values

RGB

static final String RGB
See Also:
Constant Field Values

HSB

static final String HSB
See Also:
Constant Field Values

CMYK

static final String CMYK
See Also:
Constant Field Values

NUMBER

static final String NUMBER
See Also:
Constant Field Values

TEXT

static final String TEXT
See Also:
Constant Field Values

BOOLEAN

static final String BOOLEAN
See Also:
Constant Field Values

FONT

static final String FONT
See Also:
Constant Field Values

NORMAL

static final String NORMAL
See Also:
Constant Field Values

FORTYFIVE

static final String FORTYFIVE
See Also:
Constant Field Values
Method Detail

rectmode

GraphicsContext.RectMode rectmode()

rectmode

GraphicsContext.RectMode rectmode(GraphicsContext.RectMode m)

rectmode

GraphicsContext.RectMode rectmode(String m)

rectmode

GraphicsContext.RectMode rectmode(int m)

rect

Path rect(Rect r)

rect

Path rect(double x,
          double y,
          double width,
          double height)

rect

Path rect(Rect r,
          double roundness)

rect

Path rect(double x,
          double y,
          double width,
          double height,
          double roundness)

rect

Path rect(double x,
          double y,
          double width,
          double height,
          double rx,
          double ry)

ellipsemode

GraphicsContext.EllipseMode ellipsemode()

ellipsemode

GraphicsContext.EllipseMode ellipsemode(GraphicsContext.EllipseMode m)

ellipsemode

GraphicsContext.EllipseMode ellipsemode(String m)

ellipsemode

GraphicsContext.EllipseMode ellipsemode(int m)

oval

Path oval(double x,
          double y,
          double width,
          double height)

oval

Path oval(double x,
          double y,
          double width,
          double height,
          boolean draw)

ellipse

Path ellipse(double x,
             double y,
             double width,
             double height)

ellipse

Path ellipse(double x,
             double y,
             double width,
             double height,
             boolean draw)

line

Path line(double x1,
          double y1,
          double x2,
          double y2)

line

Path line(double x1,
          double y1,
          double x2,
          double y2,
          boolean draw)

star

Path star(double cx,
          double cy)

star

Path star(double cx,
          double cy,
          int points)

star

Path star(double cx,
          double cy,
          int points,
          double outer)

star

Path star(double cx,
          double cy,
          int points,
          double outer,
          double inner)

star

Path star(double cx,
          double cy,
          int points,
          double outer,
          double inner,
          boolean draw)

arrow

Path arrow(double x,
           double y)

arrow

Path arrow(double x,
           double y,
           GraphicsContext.ArrowType type)

arrow

Path arrow(double x,
           double y,
           String type)

arrow

Path arrow(double x,
           double y,
           int type)

arrow

Path arrow(double x,
           double y,
           double width)

arrow

Path arrow(double x,
           double y,
           double width,
           boolean draw)

arrow

Path arrow(double x,
           double y,
           double width,
           GraphicsContext.ArrowType type)

arrow

Path arrow(double x,
           double y,
           double width,
           String type)

arrow

Path arrow(double x,
           double y,
           double width,
           int type)

arrow

Path arrow(double x,
           double y,
           double width,
           GraphicsContext.ArrowType type,
           boolean draw)

arrow

Path arrow(double x,
           double y,
           double width,
           String type,
           boolean draw)

arrow

Path arrow(double x,
           double y,
           double width,
           int type,
           boolean draw)

beginpath

void beginpath()

beginpath

void beginpath(double x,
               double y)

moveto

void moveto(double x,
            double y)

lineto

void lineto(double x,
            double y)

curveto

void curveto(double x1,
             double y1,
             double x2,
             double y2,
             double x3,
             double y3)

closepath

void closepath()

endpath

Path endpath()

endpath

Path endpath(boolean draw)

drawpath

void drawpath(Path path)

drawpath

void drawpath(Iterable<Point> points)

autoclosepath

boolean autoclosepath()

autoclosepath

boolean autoclosepath(boolean c)

findpath

Path findpath(List<Point> points)

findpath

Path findpath(List<Point> points,
              double curvature)

beginclip

void beginclip(Path p)

endclip

void endclip()

transform

Transform.Mode transform()

transform

Transform.Mode transform(Transform.Mode mode)

transform

Transform.Mode transform(int mode)

transform

Transform.Mode transform(String mode)

push

void push()

pop

void pop()

reset

void reset()

translate

void translate(double tx,
               double ty)

rotate

void rotate(double r)

scale

void scale(double scale)

scale

void scale(double sx,
           double sy)

skew

void skew(double skew)

skew

void skew(double kx,
          double ky)

outputmode

String outputmode()

outputmode

String outputmode(String mode)

colormode

Color.Mode colormode()

colormode

Color.Mode colormode(Color.Mode mode)

colormode

Color.Mode colormode(Color.Mode mode,
                     double range)

colormode

Color.Mode colormode(String mode)

colormode

Color.Mode colormode(String mode,
                     double range)

colormode

Color.Mode colormode(int mode)

colormode

Color.Mode colormode(int mode,
                     double range)

colorrange

double colorrange()

colorrange

double colorrange(double range)

color

Color color()
Create an empty (black) color object.

Returns:
the new color.

color

Color color(double x)
Create a new color with the given grayscale value.

Parameters:
x - the gray component.
Returns:
the new color.

color

Color color(double x,
            double y)
Create a new color with the given grayscale and alpha value.

Parameters:
x - the grayscale value.
y - the alpha value.
Returns:
the new color.

color

Color color(double x,
            double y,
            double z)
Create a new color with the the given R/G/B value.

Parameters:
x - the red component.
y - the green component.
z - the blue component.
Returns:
the new color.

color

Color color(double x,
            double y,
            double z,
            double a)
Create a new color with the the given R/G/B/A value.

Parameters:
x - the red component.
y - the green component.
z - the blue component.
a - the alpha component.
Returns:
the new color.

color

Color color(Color c)
Create a new color with the the given color.

The color object is cloned; you can change the original afterwards. If the color object is null, the new color is turned off (same as nocolor).

Parameters:
c - the color object.
Returns:
the new color.

fill

Color fill()
Get the current fill color.

Returns:
the current fill color.

fill

Color fill(double x)
Set the current fill color to given grayscale value.

Parameters:
x - the gray component.
Returns:
the current fill color.

fill

Color fill(double x,
           double y)
Set the current fill color to given grayscale and alpha value.

Parameters:
x - the grayscale value.
y - the alpha value.
Returns:
the current fill color.

fill

Color fill(double x,
           double y,
           double z)
Set the current fill color to the given R/G/B value.

Parameters:
x - the red component.
y - the green component.
z - the blue component.
Returns:
the current fill color.

fill

Color fill(double x,
           double y,
           double z,
           double a)
Set the current fill color to the given R/G/B/A value.

Parameters:
x - the red component.
y - the green component.
z - the blue component.
a - the alpha component.
Returns:
the current fill color.

fill

Color fill(Color c)
Set the current fill color to the given color.

The color object is cloned; you can change the original afterwards. If the color object is null, the current fill color is turned off (same as nofill).

Parameters:
c - the color object.
Returns:
the current fill color.

nofill

void nofill()
Turn off the fill color.


stroke

Color stroke()
Get the current stroke color.

Returns:
the current stroke color.

stroke

Color stroke(double x)
Set the current stroke color to given grayscale value.

Parameters:
x - the gray component.
Returns:
the current stroke color.

stroke

Color stroke(double x,
             double y)
Set the current stroke color to given grayscale and alpha value.

Parameters:
x - the grayscale value.
y - the alpha value.
Returns:
the current stroke color.

stroke

Color stroke(double x,
             double y,
             double z)
Set the current stroke color to the given R/G/B value.

Parameters:
x - the red component.
y - the green component.
z - the blue component.
Returns:
the current stroke color.

stroke

Color stroke(double x,
             double y,
             double z,
             double a)
Set the current stroke color to the given R/G/B/A value.

Parameters:
x - the red component.
y - the green component.
z - the blue component.
a - the alpha component.
Returns:
the current stroke color.

stroke

Color stroke(Color c)
Set the current stroke color to the given color.

The color object is cloned; you can change the original afterwards. If the color object is null, the current stroke color is turned off (same as nostroke).

Parameters:
c - the color object.
Returns:
the current stroke color.

nostroke

void nostroke()
Turn off the stroke color.


strokewidth

double strokewidth()

strokewidth

double strokewidth(double w)

font

String font()

font

String font(String fontName)

font

String font(String fontName,
            double fontSize)

fontsize

double fontsize()

fontsize

double fontsize(double s)

lineheight

double lineheight()

lineheight

double lineheight(double lineHeight)

align

Text.Align align()

align

Text.Align align(Text.Align align)

align

Text.Align align(String align)

align

Text.Align align(int align)

image

Image image(String path,
            double x,
            double y)

image

Image image(String path,
            double x,
            double y,
            double width)

image

Image image(String path,
            double x,
            double y,
            double width,
            double height)

image

Image image(String path,
            double x,
            double y,
            double width,
            double height,
            double alpha)

image

Image image(String path,
            double x,
            double y,
            double width,
            double height,
            boolean draw)

image

Image image(String path,
            double x,
            double y,
            double width,
            double height,
            double alpha,
            boolean draw)

image

Image image(Image img,
            double x,
            double y,
            double width,
            double height,
            double alpha,
            boolean draw)

image

Image image(BufferedImage img,
            double x,
            double y,
            double width,
            double height,
            double alpha,
            boolean draw)

imagesize

Size imagesize(String path)

imagesize

Size imagesize(Image img)

imagesize

Size imagesize(BufferedImage img)

text

Text text(String text,
          double x,
          double y)

text

Text text(String text,
          double x,
          double y,
          double width)

text

Text text(String text,
          double x,
          double y,
          double width,
          double height)

text

Text text(String text,
          double x,
          double y,
          double width,
          double height,
          boolean draw)

textpath

Path textpath(String text,
              double x,
              double y)

textpath

Path textpath(String text,
              double x,
              double y,
              double width)

textpath

Path textpath(String text,
              double x,
              double y,
              double width,
              double height)

textmetrics

Rect textmetrics(String text)

textmetrics

Rect textmetrics(String text,
                 double width)

textmetrics

Rect textmetrics(String text,
                 double width,
                 double height)

textwidth

double textwidth(String text)

textwidth

double textwidth(String text,
                 double width)

textheight

double textheight(String text)

textheight

double textheight(String text,
                  double width)

var

void var(String name,
         GraphicsContext.VarType type)

var

void var(String name,
         String type)

var

void var(String name,
         int type)

var

void var(String name,
         GraphicsContext.VarType type,
         Object value)

var

void var(String name,
         String type,
         Object value)

var

void var(String name,
         int type,
         Object value)

var

void var(String name,
         GraphicsContext.VarType type,
         Object value,
         double min,
         double max)

var

void var(String name,
         String type,
         Object value,
         double min,
         double max)

var

void var(String name,
         int type,
         Object value,
         double min,
         double max)

findVar

Object findVar(String name)

random

double random()

random

long random(int max)

random

long random(int min,
            int max)

random

double random(double max)

random

double random(double min,
              double max)

choice

Object choice(List objects)

grid

Iterator<Point> grid(int columns,
                     int rows)

grid

Iterator<Point> grid(int columns,
                     int rows,
                     double columnSize,
                     double rowSize)

draw

void draw(Grob g)


Copyright © 2013. All Rights Reserved.