org.gicentre.utils.gui
Interface Drawable


public interface Drawable

Defines the minimum functionality for a renderer to draw graphic primitives.

Version:
3.3, 15th January, 2012.
Author:
Jo Wood, giCentre, City University London.

Method Summary
 void ellipse(float x, float y, float w, float h)
          Should draw an ellipse using the given location and dimensions.
 void line(float x1, float y1, float x2, float y2)
          Should draw a 2D line between the given coordinate pairs.
 void point(float x, float y)
          Should draw a 2D point at the given coordinates.
 void polyLine(float[] xCoords, float[] yCoords)
          Should draw a complex line that links the given coordinates.
 void rect(float x, float y, float w, float h)
          Should draw a rectangle using the given location and dimensions.
 void shape(float[] xCoords, float[] yCoords)
          Should draw a closed polygon shape based on the given arrays of vertices.
 void triangle(float x1, float y1, float x2, float y2, float x3, float y3)
          Should draw a triangle through the three pairs of coordinates.
 

Method Detail

point

void point(float x,
           float y)
Should draw a 2D point at the given coordinates.

Parameters:
x - x coordinate of the point.
y - y coordinate of the point.

line

void line(float x1,
          float y1,
          float x2,
          float y2)
Should draw a 2D line between the given coordinate pairs.

Parameters:
x1 - x coordinate of the start of the line.
y1 - y coordinate of the start of the line.
x2 - x coordinate of the end of the line.
y2 - y coordinate of the end of the line.

rect

void rect(float x,
          float y,
          float w,
          float h)
Should draw a rectangle using the given location and dimensions. By default the x,y coordinates will be the top left of the rectangle, but the meanings of these parameters should be able to be changed with Processing's rectMode() command.

Parameters:
x - x coordinate of the rectangle position
y - y coordinate of the rectangle position.
w - Width of the rectangle (but see modifications possible with rectMode())
h - Height of the rectangle (but see modifications possible with rectMode())

ellipse

void ellipse(float x,
             float y,
             float w,
             float h)
Should draw an ellipse using the given location and dimensions. By default the x,y coordinates will be centre of the ellipse, but the meanings of these parameters should be able to be changed with Processing's ellipseMode() command.

Parameters:
x - x coordinate of the ellipse's position
y - y coordinate of the ellipse's position.
w - Width of the ellipse (but see modifications possible with ellipseMode())
h - Height of the ellipse (but see modifications possible with ellipseMode())

triangle

void triangle(float x1,
              float y1,
              float x2,
              float y2,
              float x3,
              float y3)
Should draw a triangle through the three pairs of coordinates.

Parameters:
x1 - x coordinate of the first triangle vertex.
y1 - y coordinate of the first triangle vertex.
x2 - x coordinate of the second triangle vertex.
y2 - y coordinate of the second triangle vertex.
x3 - x coordinate of the third triangle vertex.
y3 - y coordinate of the third triangle vertex.

polyLine

void polyLine(float[] xCoords,
              float[] yCoords)
Should draw a complex line that links the given coordinates.

Parameters:
xCoords - x coordinates of the line.
yCoords - y coordinates of the line.

shape

void shape(float[] xCoords,
           float[] yCoords)
Should draw a closed polygon shape based on the given arrays of vertices.

Parameters:
xCoords - x coordinates of the shape.
yCoords - y coordinates of the shape.


giCentre Utilities V.3.3, API documentation generated 6th April, 2013