|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object edu.byu.phun.PropertyContainer edu.byu.phun.Obj3D edu.byu.phun.GroupObj
public class GroupObj
This is a group of parts. There can be any number of parts. Each part can be accessed by its name or the parts can be extracted by index.
Constructor Summary | |
---|---|
GroupObj()
This creates an empty group object that has no parts. |
Method Summary | |
---|---|
void |
addPart(Obj3D obj)
This will add a new part to the end of this group. |
Obj3D |
getPart(int index)
This will retrieve a given part from the group based upon its index. |
Obj3D |
getPart(java.lang.String name)
Every object can have a name ( Obj3D.setName(String) ). |
int |
nParts()
Returns the number of parts that have been added to this group. |
java.lang.String[] |
partNames()
For all parts that have names, this will return an array of those names. |
void |
removePart(int index)
This will remove the part at the specified index. |
void |
removePart(java.lang.String name)
Every object can have a name ( Obj3D.setName(String) ). |
void |
setColor(double red,
double green,
double blue)
This sets the color of the object. |
void |
setPart(int index,
Obj3D child)
This will change the part at the specified index. |
Methods inherited from class edu.byu.phun.Obj3D |
---|
getBounds, getColor, getLocation, getName, getRotX, getRotY, getRotZ, getScaleX, getScaleY, getScaleZ, getShininess, setColor, setLocation, setLocation, setName, setRotX, setRotY, setRotZ, setScale, setScale, setScaleX, setScaleY, setScaleZ, setShininess, toString |
Methods inherited from class edu.byu.phun.PropertyContainer |
---|
getPropertyC, getPropertyD, getPropertyP, getPropertyS, propertyIsColor, propertyIsDouble, propertyIsPoint, propertyIsSettable, propertyIsString, propertyNames, setProperty, setProperty |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public GroupObj()
Method Detail |
---|
public Obj3D getPart(int index)
index
- must be between 0 and nParts()
-1.
public void setPart(int index, Obj3D child)
index
- must be between 0 and nParts()
-1.child
- the new child object to be placed at the
specified index.public int nParts()
public Obj3D getPart(java.lang.String name)
Obj3D.setName(String)
).
This will retrieve the object that has the specified name.
name
- the name of the object to be removed. Names are not case
sensitive.
public void removePart(int index)
index
- must be between 0 and nParts()
-1.public void removePart(java.lang.String name)
Obj3D.setName(String)
).
This will remove the part with the specified name. If there
is no such part, then this does nothing.
name
- The name of the part to be removed.
Names are not case sensitive.public void addPart(Obj3D obj)
obj
- the part to be added.public java.lang.String[] partNames()
public void setColor(double red, double green, double blue)
Obj3D
Examples.
setColor
in class Obj3D
red
- the red componentgreen
- the green componentblue
- the blue componentObj3D.setColor(double, double, double)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |