org.jrabbit.base.graphics.skins.primitive
Class SquareSkin

java.lang.Object
  extended by org.jrabbit.base.graphics.skins.primitive.PrimitiveSkin
      extended by org.jrabbit.base.graphics.skins.primitive.SquareSkin
All Implemented Interfaces:
Renderable, Skin, Dimensioned, Vertexed

public class SquareSkin
extends PrimitiveSkin

A CircleSkin renders and contains geometric data approximating a square. To make this skin approximate a rectangle of any particular dimensions, simply scale is x and y dimensions unevenly.

Author:
Chris Molini

Field Summary
private static float[][] SQUARE_VERTICES
          Pre-calculated vertex data describing a square of side length 1.
 
Constructor Summary
SquareSkin()
           
 
Method Summary
 void render()
          SquareSkin delegates rendering to PrimitivePainter's renderRectangle() method.
 float[][] vertices()
          Accesses geometric data representing a square.
 
Methods inherited from class org.jrabbit.base.graphics.skins.primitive.PrimitiveSkin
height, width
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SQUARE_VERTICES

private static final float[][] SQUARE_VERTICES
Pre-calculated vertex data describing a square of side length 1.

Constructor Detail

SquareSkin

public SquareSkin()
Method Detail

render

public void render()
SquareSkin delegates rendering to PrimitivePainter's renderRectangle() method.


vertices

public float[][] vertices()
Accesses geometric data representing a square. The described square has a width and height of 1.

Returns:
Vertex data approximating a square.