|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectFractal.LSystem2Renderer
public abstract class LSystem2Renderer
Base class for rendering an LSystem. Extend and override drawLine to render to a particular context, calling setDimension and render beforehand
Constructor Summary | |
---|---|
LSystem2Renderer(java.lang.String axiom,
java.lang.String grammar,
int depth,
float angle)
Create a new renderable LSystem |
Method Summary | |
---|---|
protected abstract void |
drawLine(java.lang.Object user,
int x,
int y,
int u,
int v)
|
java.lang.String |
getDerivedGrammar()
Get the grammar expanded to the specified depth |
void |
render(java.lang.Object user)
Render the LSystem, calls on drawLine to do actual drawing |
void |
setDimension(float width,
float height)
Set the width and hight to scale the render to. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LSystem2Renderer(java.lang.String axiom, java.lang.String grammar, int depth, float angle)
grammar
- The grammar of the LSystemdepth
- The recursive depth of the grammarangle
- The angle distance each turn should make, in degreesMethod Detail |
---|
public void setDimension(float width, float height)
width
- height
- public void render(java.lang.Object user)
user
- User object that is passed to drawLineprotected abstract void drawLine(java.lang.Object user, int x, int y, int u, int v)
public java.lang.String getDerivedGrammar()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |