public class PjPythagoreanTree extends PjProject
HAS_BOUNDARY_PANEL, HAS_CONFIG_PANEL, HAS_INFO_PANEL, HAS_LABEL_PANEL, HAS_MATERIAL_PANEL, HAS_TEXTURE_PANEL, HAS_VECTOR_PANEL, INSPECTOR_INFO, INSPECTOR_INFO_EXT, IS_DELETED, IS_FIXED, IS_FOCUSSED, IS_PICKED, IS_SELECTED, IS_USED, NUM_TAGS
Constructor and Description |
---|
PjPythagoreanTree()
Creates a new instance of PjPythagoreanTree
|
Modifier and Type | Method and Description |
---|---|
int |
getAge()
Returns the age of the tree which is the number of consecutive branches.
|
void |
init()
Initialization.
|
boolean |
isEnabledRightTriangle()
Returns true if the triangle above trunk is kept right.
|
boolean |
isEnabledSquareTrunk()
Returns true if the trunk is kept square.
|
void |
pickVertex(PgGeometryIf geom,
int picked,
PdVector pickedVertex)
Drags a picked vertex of m_trunk.
|
void |
reset()
Reset project to initial state by calling project.init().
|
void |
setAge(int age)
Sets the age of the tree which is the number of consecutive branches.
|
void |
setEnabledRightTriangle(boolean bRightTriangle)
Determines if the triangle above trunk is a right triangle.
|
void |
setEnabledSquareTrunk(boolean bSquareTrunk)
Determines if the trunk should be a square.
|
void |
start()
Initializes display, geometries.
|
boolean |
update(java.lang.Object event)
Update the class whenever a child has changed.
|
addDisplay, addGeometry, addGeometry, dispose, dragDisplay, dragInitial, dragVertex, fitDisplays, getAnimation, getDisplay, getDisplays, getGeometry, getGeometry, getNumGeometries, getParameter, getViewer, hasAnimation, hasDisplay, isEnabledAutoFit, markVertices, pickDisplay, pickInitial, removeDisplay, removeGeometries, removeGeometry, selectDisplay, selectGeometry, setAnimation, setBackColor, setBorderType, setDisplay, setEnabledAutoFit, setGeometry, setParameter, setTime, setViewer, stop, unmarkVertices
addInspector, addUpdateListener, assureInspector, clearTag, clone, clone, clone, copy, getFather, getInfoPanel, getInspector, getName, getNumObjects, getSymbol, hasInspector, hasTag, hasUpdateListener, instanceOf, instanceOf, newInspector, newInspector, removeInspector, removeInspector, removeUpdateListener, setName, setParent, setSymbol, setTag, toString, updatePanels
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
getName
getName
public PjPythagoreanTree()
public void start()
start
in class PjProject
PvViewerIf.start()
,
PjProject.isEnabledAutoFit()
public void reset()
public boolean update(java.lang.Object event)
update
in interface PsUpdateIf
update
in class PsObject
event
- carries a lot of informationPsObject.setParent(PsUpdateIf)
,
PsObject.getFather()
,
PsObject.addUpdateListener(PsUpdateIf)
public void pickVertex(PgGeometryIf geom, int picked, PdVector pickedVertex)
pickVertex
in interface PvPickListenerIf
pickVertex
in class PjProject
geom
- Picked geometry on which vertex liespicked
- Index of picked vertex in vertex array of geometrypickedVertex
- 3d coordinates of vertex positionPvPickListenerIf
public int getAge()
public void setAge(int age)
age
- New age of the tree.public boolean isEnabledRightTriangle()
true
if the triangle is kept right.public void setEnabledRightTriangle(boolean bRightTriangle)
bRightTriangle
- use right triangle above trunkpublic boolean isEnabledSquareTrunk()
true
if the rectangle is kept square.public void setEnabledSquareTrunk(boolean bSquareTrunk)
bSquareTrunk
- use square trunk"