|
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.Leaf
Leaf nodes are words of text, XDOC words, images, and so on. Many media adaptors subclass Leaf for their own type of nodes.
formatNode(int, int, Context)
and paintNode(Rectangle, Context)
.
subelement()
, subelementHit(Point)
.
cut(int, Leaf,int)
, copy(int, Leaf,int)
, paste(int)
, split(int)
, delete(int, Leaf,int)
, insert(int, String, INode)
).
Field Summary |
---|
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 | |
---|---|
Leaf(java.lang.String name,
java.util.Map<java.lang.String,java.lang.Object> attrs,
INode parent)
In most cases a Leaf's attributes are null, as in a word of text, but image nodes have attributes. |
Method Summary | |
---|---|
void |
append(Leaf l)
Append leaf to the end of this one, adjusting content, spans, and so on. |
boolean |
checkRep()
Checks "representation invariant" (see MIT SE), and returns true iff object is valid, which should be always |
void |
clipboardBeforeAfter(java.lang.StringBuffer txt,
int start,
int end)
|
void |
clipboardNode(java.lang.StringBuffer sb)
To build up selection, pass a StringBuffer to media-specific leaves, which fill it as appropriate for that medium. |
java.lang.String |
copy(int startoff,
Leaf endn,
int endoff)
|
java.lang.String |
cut(int startoff,
Leaf endn,
int endoff)
|
void |
delete(int startoff,
Leaf endn,
int endoff)
|
int |
dx()
X-coordinate transformation needed when entering this node's relative coordinate system. |
int |
dy()
Y-coordinate transformation needed when entering this node's relative coordinate system. |
java.lang.String |
eatme(int startoff,
Leaf endn,
int endoff)
|
boolean |
eventBeforeAfter(java.awt.AWTEvent e,
java.awt.Point rel)
Point can be null when it's a semantic event sent to tree nodes. |
boolean |
eventNode(java.awt.AWTEvent e,
java.awt.Point rel)
unless overridden, leaves see if owner is interested |
boolean |
formatBeforeAfter(int width,
int height,
Context cx)
In the depth-first tree traversal to format tree, Before and after methods of behavior observers invoked here; actual formatting passed on to formatNode(). |
boolean |
formatNode(int width,
int height,
Context cx)
Handles span transitions on node and elided portions. |
boolean |
formatNodeContent(Context cx,
int start,
int end)
|
Leaf |
getFirstLeaf()
|
Leaf |
getLastLeaf()
|
void |
insert(int startoff,
char ch,
INode bounds)
Insert character at point. |
void |
insert(int startoff,
java.lang.String txt,
INode bounds)
Insert string of possibly many words at point. |
boolean |
isLeaf()
|
int |
lengthTo(int starti,
Leaf endn,
int endi)
|
void |
markDirtySubtreeDown(boolean leavestoo)
Mark dirty all nodes in subtree (down tree only). |
java.awt.Point |
offset2rel(int offset)
Given an offset into a Leaf, return corresponding subcomponent geometric point. |
void |
paintBeforeAfter(java.awt.Rectangle docclip,
Context cx)
The logical size of the node. |
void |
paintNode(java.awt.Rectangle docclip,
Context cx)
Call paintNodeContent with longest range of unchanged Context. |
boolean |
paintNodeContent(Context cx,
int start,
int end)
|
void |
paste(int startoff)
|
void |
paste(java.lang.String txt,
int startoff)
|
void |
removeTidy(INode root)
Remove node from tree tidily: don't leave behind empty INode, recursively up to root, and brush span transitions to the size ( Span.stretch(Leaf, INode) ). |
void |
setName(java.lang.String name)
|
void |
split(int off)
Split this node into two nodes starting at same position under current parent, and handling content, spans, and so on. |
protected void |
subelement()
|
void |
subelementCalc(Context cx)
Media leaves override this to map an (x,y) point into an internal location. |
int |
subelementHit(java.awt.Point rel)
Given a geometric point within the leaf, return index of corresponding subcomponent (e.g., letter within word). |
Methods inherited from class multivalent.Node |
---|
addObserver, addSticky, addSticky, breakAfter, breakBefore, childNum, clipboardBeforeAfter, clone, cmp, commonAncestor, commonAncestor, contains, contains, deleteObserver, dump, dump, dump, findBFS, findBFS, findBFS, findDFS, findDFS, findDFS, findDFS, getAbsLocation, getActivesAt, getActivesAt, getActivesAt, getBbox, getBrowser, getDocument, getElementById, getIScrollPane, getName, getNextLeaf, getNextNode, getNodeName, getObservers, getParentNode, getPrevLeaf, getPrevNode, getRelLocation, getRoot, getSticky, indexSticky, intersects, isStruct, isValid, markDirty, markDirtySubtree, markDirtyTo, morphInto, reformat, remove, removeSticky, removeSticky, repaint, repaint, repaint, repaint, scrollTo, scrollTo, setParentNode, setValid, size, 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 |
Constructor Detail |
---|
public Leaf(java.lang.String name, java.util.Map<java.lang.String,java.lang.Object> attrs, INode parent)
Method Detail |
---|
public void setName(java.lang.String name)
setName
in class Node
public final boolean isLeaf()
isLeaf
in class Node
public int dx()
Node
dx
in class Node
public int dy()
Node
dy
in class Node
public final Leaf getFirstLeaf()
getFirstLeaf
in class Node
public final Leaf getLastLeaf()
getLastLeaf
in class Node
public boolean formatBeforeAfter(int width, int height, Context cx)
Node
formatBeforeAfter
in class Node
width
- 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 Node
public boolean formatNodeContent(Context cx, int start, int end)
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 Node
public boolean paintNodeContent(Context cx, int start, int end)
protected void subelement()
public int subelementHit(java.awt.Point rel)
public java.awt.Point offset2rel(int offset)
public void subelementCalc(Context cx)
public void clipboardNode(java.lang.StringBuffer sb)
Node
clipboardNode
in class Node
public void clipboardBeforeAfter(java.lang.StringBuffer txt, int start, int end)
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 Node
TreeEvent
,
SemanticEvent
public void removeTidy(INode root)
Span.stretch(Leaf, INode)
).
removeTidy
in class Node
Node.remove()
public void markDirtySubtreeDown(boolean leavestoo)
Node
markDirtySubtreeDown
in class Node
public int lengthTo(int starti, Leaf endn, int endi)
public void insert(int startoff, char ch, INode bounds)
public void insert(int startoff, java.lang.String txt, INode bounds)
public void append(Leaf l)
public void split(int off)
public void delete(int startoff, Leaf endn, int endoff)
public java.lang.String cut(int startoff, Leaf endn, int endoff)
public java.lang.String eatme(int startoff, Leaf endn, int endoff)
public java.lang.String copy(int startoff, Leaf endn, int endoff)
public void paste(int startoff)
public void paste(java.lang.String txt, int startoff)
public boolean checkRep()
VObject
checkRep
in class Node
|
Multivalent API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |