|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ignotus.aifile.DisplayComponent
com.ignotus.aifile.GroupComponent
public class GroupComponent
Groups together geometry (BezShape
),
text (PointText
) and nested groups within a layer or
another group. Components in a group are displayed and written to file with the most recently
added component first (last in first out).
Constructor Summary | |
---|---|
GroupComponent(PApplet parent)
|
Method Summary | |
---|---|
void |
accept(ComponentVisitor visitor)
Accepts a ComponentVisitor that traverses a document structure tree. |
void |
accept(ComponentVisitor visitor,
boolean order)
Accepts a ComponentVisitor that traverses a document structure tree in preorder or postorder. |
void |
add(ArrayList<? extends DisplayComponent> comps)
Adds all components in a list to this component |
void |
add(DisplayComponent component)
Adds a component to children of this component. |
void |
draw()
Draws geometry or text to the Processing window. |
boolean |
isTerminal()
|
void |
transform(Matrix3 matx)
Transforms geometry of shapes and location of text using the supplied matrix. |
void |
write(PrintWriter pw)
Writes an Adobe Illustrator 7.0 file format encoding structure, geometry and text. |
Methods inherited from class com.ignotus.aifile.DisplayComponent |
---|
children, get, hide, id, isLocked, isVisible, iterator, parentComponent, remove, setLocked, setParentComponent, setVisible, show |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GroupComponent(PApplet parent)
parent
- PApplet used for calls to the Processing environment, notably for drawingMethod Detail |
---|
public void add(DisplayComponent component)
add
in class DisplayComponent
component
- DisplayComponent to add to this component's childrenpublic void add(ArrayList<? extends DisplayComponent> comps)
add
in class DisplayComponent
comps
- an ArrayList of DisplayComponentspublic void draw()
DisplayComponent
draw
in class DisplayComponent
public boolean isTerminal()
isTerminal
in class DisplayComponent
public void write(PrintWriter pw)
DisplayComponent
write
in class DisplayComponent
pw
- a PrintWriter for file output.public void transform(Matrix3 matx)
DisplayComponent
transform
in class DisplayComponent
matx
- a Matrix3 that encapsulates an affine geometric transform.public void accept(ComponentVisitor visitor)
Visitable
When called from an object that implements the Visitable
interface:
accept( visitor )
on all its children
The reference is passed back to the visitor through a method of the form
visitor.visit<ComponentClassName>( this );
See ComponentVisitor
The order of steps 1 and 2 determines if traversal of the composite structure is preorder or postorder. As shown above, it's preorder. Depending on what you want to do, one traversal may be better suited than the other. Preorder visits parents first, postorder visits children first.
visitor
- a ComponentVisitor
public void accept(ComponentVisitor visitor, boolean order)
Visitable
visitor
- a ComponentVisitor
order
- boolean to determine if traversal is preorder or postorder
accept( visitor )
should implement the default order of traversal,
accept( visitor, <false>
) should implement the other order.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |