| 
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.paulhertz.aifile.DisplayComponent
public abstract class DisplayComponent
The base class for all components. Do not invoke this class directly. Components form a tree structure with the 
 DocumentComponent at the top. A document may have several layers 
 (LayerComponent). Each layer can contain
 shapes (BezShape), text (PointText) or 
 groups (GroupComponent). The GroupComponent can contain
 shapes or text or nested groups. 
 
The draw, write, and transform commands all cascade down the tree. Thus a draw command given to a document, layer, or group will eventually reach all the children of that component, and cause them to draw their geometry or text to the screen. Similarly, the write command from the document level will write out a complete Adobe Illustrator file. Transform executed at any level, or on terminal components such as BezShape and PointText, will execute a supplied geometric transform.
| Constructor Summary | |
|---|---|
DisplayComponent()
 | 
|
| Method Summary | |
|---|---|
abstract  void | 
add(ArrayList<? extends DisplayComponent> comps)
Adds all components in a list to this component, throws an UnsupportedOperationException if component is terminal. | 
abstract  void | 
add(DisplayComponent component)
Adds a component to children of this component, throws an UnsupportedOperationException if component is terminal. | 
 List<DisplayComponent> | 
children()
 | 
abstract  void | 
draw()
Draws geometry or text to the Processing window.  | 
abstract  void | 
draw(PGraphics pg)
Draws a component to a supplied PGraphics.  | 
 DisplayComponent | 
get(int index)
Returns the component at index from the children of this component, throws an UnsupportedOperationException if component is terminal. | 
 void | 
hide()
Sets the isVisible attribute of this component to true. | 
 int | 
id()
 | 
 boolean | 
isLocked()
 | 
abstract  boolean | 
isTerminal()
 | 
 boolean | 
isVisible()
 | 
 Iterator<DisplayComponent> | 
iterator()
Returns an iterator over children, throws an UnsupportedOperationException if component is terminal. | 
 DisplayComponent | 
parentComponent()
 | 
 boolean | 
remove(DisplayComponent component)
Removes a component from children of this component, throws an UnsupportedOperationException if component is terminal. | 
 void | 
setLocked(boolean isLocked)
 | 
 void | 
setParentComponent(DisplayComponent newParentComponent)
Sets the parent component of this component to the supplied component.  | 
 void | 
setVisible(boolean isVisible)
 | 
 void | 
show()
Sets the isVisible attribute of this component to true. | 
abstract  void | 
transform(Matrix3 matx)
Transforms geometry of shapes and location of text using the supplied matrix.  | 
abstract  void | 
write(PrintWriter pw)
Writes an Adobe Illustrator 7.0 file format encoding structure, geometry and text.  | 
| Methods inherited from class java.lang.Object | 
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Methods inherited from interface net.paulhertz.aifile.Visitable | 
|---|
accept, accept | 
| Constructor Detail | 
|---|
public DisplayComponent()
| Method Detail | 
|---|
public abstract void add(DisplayComponent component)
UnsupportedOperationException if component is terminal.
component - DisplayComponent to add to this component's childrenpublic abstract void add(ArrayList<? extends DisplayComponent> comps)
UnsupportedOperationException if component is terminal.
comps - an ArrayList of DisplayComponentspublic boolean remove(DisplayComponent component)
UnsupportedOperationException if component is terminal.
component - DisplayComponent to remove from this component's children
public DisplayComponent get(int index)
UnsupportedOperationException if component is terminal.
 Throws an IndexOutOfBoundsException 
 if index is out of range (index < 0 || index >= size).
index - index to component
public Iterator<DisplayComponent> iterator()
UnsupportedOperationException if component is terminal.
public DisplayComponent parentComponent()
public void setParentComponent(DisplayComponent newParentComponent)
newParentComponent - component to set as parent of this component.public List<DisplayComponent> children()
public int id()
public abstract boolean isTerminal()
public boolean isLocked()
public void setLocked(boolean isLocked)
isLocked - the isLocked to setpublic boolean isVisible()
public void setVisible(boolean isVisible)
isVisible - the isVisible to setpublic void show()
isVisible attribute of this component to true. draw() command will execute.
public void hide()
isVisible attribute of this component to true. draw() command will not execute.
 write() command will bracket component as not visible, with subsequent components visible.
public abstract void draw()
public abstract void draw(PGraphics pg)
pg - a PGraphics instancepublic abstract void write(PrintWriter pw)
pw - a PrintWriter for file output.public abstract void transform(Matrix3 matx)
matx - a Matrix3 that encapsulates an affine geometric transform.
  | 
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||