|
Multivalent API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectmultivalent.VObject
multivalent.Node
multivalent.INode
Internal nodes have children. To implement most protocols, pass protocol on to children. Superclass for all internal--that is, structural--nodes in the doc tree.
Bounding box contains border, padding, and content, but not margin, which is taken into account in (x,y) location.
Leaf,
Span| Field Summary | |
|---|---|
java.awt.Insets |
border
Border, with possible different widths on each side (counted in bounding box dimensions). |
static java.awt.Insets[] |
INSETS
Canonical Insets with equal bounds to use to save space over creating new Insets for these common cases. |
static java.awt.Insets |
INSETS_ZERO
Special name, points to INSETS[0]. |
java.awt.Insets |
margin
Transparent external space around bounding box (not part of bounding box width or height, as effects incorporated into bounding box (x,y) location). |
java.awt.Insets |
padding
Internal space inside border, with same background as content (counted in bounding box dimensions). |
| Fields inherited from class multivalent.Node |
|---|
align, ALIGN_INVALID, ATTR_ID, ATTR_SCRIPT, baseline, BASELINE, bbox, BOTH, BOTTOM, CENTER, CHAR, FILL, floats, INHERIT, JUSTIFY, LEFT, MAXNONSTRUCTDEPTH, MIDDLE, name_, NONE, observers_, parent_, PROBEWIDTH, RIGHT, sticky_, stickycnt_, TOP, valid_, valign |
| Fields inherited from class multivalent.VObject |
|---|
attr_ |
| Constructor Summary | |
|---|---|
INode(java.lang.String name,
java.util.Map<java.lang.String,java.lang.Object> attr,
INode parent)
|
|
| Method Summary | |
|---|---|
Node |
addCategory(Node n,
java.lang.String category)
Add child to correct category, as in UI panel or menu with groups. |
void |
appendChild(Node child)
Adds child to end of list of children. |
boolean |
breakAfter()
|
boolean |
breakBefore()
|
boolean |
checkRep()
Checks "representation invariant" (see MIT SE), and returns true iff object is valid, which should be always |
Node |
childAt(int num)
Returns child at given offset, 0 .. size()-1, inclusive. |
int |
childNum(Node n)
Returns sequence number node in list of children, -1 iff no such child. |
void |
clipboardNode(java.lang.StringBuffer txt)
To select structural region, select all children |
protected java.lang.Object |
clone()
Deep copy of Rectangle; observers and sticky set to null. |
boolean |
contains(Node n)
Passed node (null OK) somewhere in subtree? |
void |
dump(int level,
int maxlevel)
Dump more verbose than toString(). |
int |
dx()
Skip over border, padding to content area. |
int |
dy()
Skip over border, padding to content area. |
boolean |
eventBeforeAfter(java.awt.AWTEvent e,
java.awt.Point rel)
Adjust for bbox (which itself has been adjusted for margins), padding, border. |
boolean |
eventNode(java.awt.AWTEvent e,
java.awt.Point rel)
Internal nodes pass on to children. |
protected Node |
findDFS(java.lang.String searchname,
java.lang.String attrname,
java.lang.String attrval,
int level,
int maxlevel)
|
boolean |
formatBeforeAfter(int width,
int height,
Context cx)
Internal nodes might have a structural style LATER: externalize format to a behavior and choose with style sheet. |
boolean |
formatNode(int width,
int height,
Context cx)
Children report dimensions (width and height), parent places at (x,y). |
Node |
getElementById(java.lang.String elementId)
|
Node |
getFirstChild()
Returns first child, or null if no children. |
Leaf |
getFirstLeaf()
If first child is leaf, returns that. |
Node |
getLastChild()
Returns last child, or null if no children. |
Leaf |
getLastLeaf()
If last child is leaf, returns that. |
Node |
getNextSibling()
DOM2 -- childAt() more efficient. |
Node |
getPreviousSibling()
DOM2 -- childAt() more efficient. |
void |
insertChildAt(Node child,
int num)
|
boolean |
isStruct()
|
void |
markDirtySubtreeDown(boolean leavestoo)
Mark dirty all nodes in subtree (down tree only). |
void |
paintBeforeAfter(java.awt.Rectangle docclip,
Context cx)
Check to see subtree area within clipping region. |
void |
paintNode(java.awt.Rectangle docclip,
Context cx)
To paint internal node, paint all children. |
void |
removeAllChildren()
Faster than removing one at a time. |
void |
removeChild(Node child)
Removes child if it exists among list of children. |
Node |
removeChildAt(int num)
|
void |
setChildAt(Node child,
int num)
|
void |
setName(java.lang.String name)
Names of internal nodes are normalized to all-lowercase (but not interned). |
int |
size()
Number of addressable components in node: number of children in INode, number of letters in text leaf, zero for invisible nodes such as comments, and otherwise usually one (the default). |
Node |
structChildAt(int num)
Some nonstructural nodes (internal nodes with name==null) may be used to better balance trees for better performance. |
int |
structChildNum(Node n)
|
int |
structsize()
WARNING: This doesn't climb up to lowest structural parent, inconsistently with structChildNum |
| Methods inherited from class multivalent.Node |
|---|
addObserver, addSticky, addSticky, childNum, clipboardBeforeAfter, cmp, commonAncestor, commonAncestor, contains, deleteObserver, dump, dump, findBFS, findBFS, findBFS, findDFS, findDFS, findDFS, getAbsLocation, getActivesAt, getActivesAt, getActivesAt, getBbox, getBrowser, getDocument, getIScrollPane, getName, getNextLeaf, getNextNode, getNodeName, getObservers, getParentNode, getPrevLeaf, getPrevNode, getRelLocation, getRoot, getSticky, indexSticky, intersects, isLeaf, isValid, markDirty, markDirtySubtree, markDirtyTo, morphInto, reformat, remove, removeSticky, removeSticky, removeTidy, repaint, repaint, repaint, repaint, scrollTo, scrollTo, setParentNode, setValid, sizeSticky, spanChunky, spanChunky, structChildNum, toString |
| Methods inherited from class multivalent.VObject |
|---|
attrEntrySetIterator, attrKeysIterator, clearAttributes, getAttr, getAttr, getAttributes, getGlobal, getValue, hasAttributes, putAttr, removeAttr, setAttributes |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final java.awt.Insets[] INSETS
public static final java.awt.Insets INSETS_ZERO
public java.awt.Insets margin
public java.awt.Insets border
public java.awt.Insets padding
| Constructor Detail |
|---|
public INode(java.lang.String name,
java.util.Map<java.lang.String,java.lang.Object> attr,
INode parent)
| Method Detail |
|---|
protected java.lang.Object clone()
throws java.lang.CloneNotSupportedException
Node
clone in class Nodejava.lang.CloneNotSupportedExceptionpublic void setName(java.lang.String name)
setName in class Nodepublic final boolean isStruct()
isStruct in class Nodepublic int dx()
dx in class Nodepublic int dy()
dy in class Nodepublic boolean breakBefore()
breakBefore in class Nodepublic boolean breakAfter()
breakAfter in class Nodepublic final Leaf getFirstLeaf()
getFirstLeaf in class Nodepublic final Leaf getLastLeaf()
getLastLeaf in class Nodepublic final Node getFirstChild()
childAt(0).
public final Node getLastChild()
childAt(size()-1).
public int size()
Node
size in class Nodepublic int childNum(Node n)
public Node childAt(int num)
public Node getPreviousSibling()
public Node getNextSibling()
public void appendChild(Node child)
public Node addCategory(Node n,
java.lang.String category)
public void setChildAt(Node child,
int num)
public void insertChildAt(Node child,
int num)
public Node removeChildAt(int num)
public void removeChild(Node child)
public void removeAllChildren()
public boolean contains(Node n)
contains in class Nodepublic int structsize()
public int structChildNum(Node n)
public final Node structChildAt(int num)
public boolean formatBeforeAfter(int width,
int height,
Context cx)
formatBeforeAfter in class Nodewidth - of screen, or fraction thereof available to be taken by nodeheight - of screen, or fraction thereof available to be taken by node (largely ignored in HTML, which has infinitely long scroll, except in FRAME)Behavior
public boolean formatNode(int width,
int height,
Context cx)
formatNode in class NodeFixedI
public void paintBeforeAfter(java.awt.Rectangle docclip,
Context cx)
paintBeforeAfter in class Node
public void paintNode(java.awt.Rectangle docclip,
Context cx)
paintNode in class Nodepublic void clipboardNode(java.lang.StringBuffer txt)
clipboardNode in class Node
public boolean eventBeforeAfter(java.awt.AWTEvent e,
java.awt.Point rel)
eventBeforeAfter in class Node
public boolean eventNode(java.awt.AWTEvent e,
java.awt.Point rel)
eventNode in class NodeTreeEvent,
SemanticEventpublic void markDirtySubtreeDown(boolean leavestoo)
Node
markDirtySubtreeDown in class Nodepublic Node getElementById(java.lang.String elementId)
getElementById in class Node
protected Node findDFS(java.lang.String searchname,
java.lang.String attrname,
java.lang.String attrval,
int level,
int maxlevel)
findDFS in class Nodepublic boolean checkRep()
VObject
checkRep in class Node
public void dump(int level,
int maxlevel)
Node
dump in class Node
|
Multivalent API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||