|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectdata.Group
This class represents a group of Shapes, with the possibility to
contain subgroups (which can contain subgroups and shapes, etc.).
One could argue that Groups can replace Shapes,
grouping Curves instead of Shapes, but if I ever were to
expand this program, having Shapes could be useful (for example when
ControlPoints should be linked).
| Field Summary | |
protected ArrayList |
grouplist
The List of Groups in this Group. |
protected String |
name
The name of this Group. |
protected ArrayList |
shapelist
The List of Shapes in this Group. |
protected int |
x
The horizontal position of this Group. |
protected int |
y
The vertical position of this Group. |
| Constructor Summary | |
Group(String name,
int x,
int y)
Constructs a new Group with the given attributes. |
|
| Method Summary | |
void |
addGroup(Group group)
Adds the given Group to this Group. |
void |
addShape(Shape shape)
Adds the given Shape to this Group. |
Group |
getGroup(int index)
Returns the Group at index. |
String |
getName()
Returns the name of this Group. |
int |
getNumberOfGroups()
Returns the number of Groups in this Group. |
int |
getNumberOfShapes()
Returns the number of Shapes in this Group. |
Shape |
getShape(int index)
Returns the Shape at index. |
int |
getX()
Returns the horizontal position of this Group. |
int |
getY()
Returns the vertical position of this Group. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected String name
Group.
protected int x
Group.
protected int y
Group.
protected ArrayList shapelist
List of Shapes in this Group.
protected ArrayList grouplist
List of Groups in this Group.
| Constructor Detail |
public Group(String name,
int x,
int y)
Group with the given attributes.
name - The name of this Group.x - The horizontal position of this Group.y - The vertical position of this Group.| Method Detail |
public String getName()
Group.
Group.public int getX()
Group.
Group.public int getY()
Group.
Group.public Shape getShape(int index)
Shape at index.
index - The index the Shape is at.
Shape at index.public void addShape(Shape shape)
Shape to this Group.
shape - The Shape to be added. May not be null.public int getNumberOfShapes()
Shapes in this Group.
Shapes in this Group.public Group getGroup(int index)
Group at index.
index - The index the Group is at.
Group at index.public void addGroup(Group group)
Group to this Group.
group - The Group to be added. May not be null.public int getNumberOfGroups()
Groups in this Group.
Groups in this Group.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||