| 
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.paulhertz.aifile.DisplayComponent
net.paulhertz.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 used for calls to the Processing environment is obtained from IgnoCodeLib, which must be correctly initialized in setup. | 
|
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.  | 
 void | 
draw(PGraphics pg)
Draws a component to a supplied PGraphics.  | 
 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 net.paulhertz.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()
IgnoCodeLib, which must be correctly initialized in setup. 
 If IgnoCodeLib does not have a reference to a PApplet, it throws a NullPointerException.
public GroupComponent(PApplet parent)
parent - PApplet used for calls to the Processing environment, notably for drawing| Method Detail | 
|---|
public void add(DisplayComponent component)
add in class DisplayComponentcomponent - DisplayComponent to add to this component's childrenpublic void add(ArrayList<? extends DisplayComponent> comps)
add in class DisplayComponentcomps - an ArrayList of DisplayComponentspublic void draw()
DisplayComponent
draw in class DisplayComponentpublic void draw(PGraphics pg)
DisplayComponent
draw in class DisplayComponentpg - a PGraphics instancepublic boolean isTerminal()
isTerminal in class DisplayComponentpublic void write(PrintWriter pw)
DisplayComponent
write in class DisplayComponentpw - a PrintWriter for file output.public void transform(Matrix3 matx)
DisplayComponent
transform in class DisplayComponentmatx - 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 ComponentVisitororder - 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 | ||||||||