|
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
multivalent.IScrollPane
multivalent.Document
multivalent.node.Root
Document
s can contain other documents, and this is the topmost instance.
Within the Root are subdocuments corresponding to the user interface and content.
Each Root corresponds to exactly one Browser
and vice-versa.
All Documents have shared variables; as the topmost Document, Root holds Browser-wide variables.
Browser
Field Summary |
---|
Fields inherited from class multivalent.Document |
---|
ATTR_AUTHOR, ATTR_GENRE, ATTR_LOADING, ATTR_PAGE, ATTR_PAGECOUNT, ATTR_STOP, ATTR_TITLE, ATTR_URI, MSG_BUILD, MSG_CLOSE, MSG_CURRENT, MSG_FORMATTED, MSG_OPEN, MSG_OPENED, MSG_REDIRECTED, MSG_REFORMAT, MSG_RELOAD, MSG_REPAINT, MSG_STOP, styleSheet_, uri, VAR_HEADERS |
Fields inherited from class multivalent.IScrollPane |
---|
editable, hchars_, ibbox, MSG_SCROLL_TO, wchars_ |
Fields inherited from class multivalent.INode |
---|
border, INSETS, INSETS_ZERO, margin, padding |
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 | |
---|---|
Root(java.util.Map<java.lang.String,java.lang.Object> attr,
Browser br)
|
Method Summary | |
---|---|
boolean |
checkRep()
Checks "representation invariant" (see MIT SE), and returns true iff object is valid, which should be always |
boolean |
formatBeforeAfter(int width,
int height,
Context cx)
Takes width and height from containing Browser Window. |
Root |
getRoot()
Ends chain up tree, returning self. |
void |
reformat(Node dirty)
High performance reformatting of subtree. |
void |
repaint(long ms,
int x,
int y,
int w,
int h)
Ends chain up tree and calls redraws in Browser/Canvas. |
Methods inherited from class multivalent.Document |
---|
clear, eventNode, formatNode, getBrowser, getDocument, getLayer, getLayers, getMediaAdaptor, getStyleSheet, getURI, getVar, getVisualLayer, getVisualLayer, paintBeforeAfter, paintNode, putVar, removeVar, setMediaAdaptor, setParentNode, setStyleSheet |
Methods inherited from class multivalent.IScrollPane |
---|
dump, dx, dy, getHsb, getIScrollPane, getVsb, scrollBy, scrollTo, scrollTo, setScrollbarShowPolicy, setSizeChars |
Methods inherited from class multivalent.INode |
---|
addCategory, appendChild, breakAfter, breakBefore, childAt, childNum, clipboardNode, clone, contains, eventBeforeAfter, findDFS, getElementById, getFirstChild, getFirstLeaf, getLastChild, getLastLeaf, getNextSibling, getPreviousSibling, insertChildAt, isStruct, markDirtySubtreeDown, removeAllChildren, removeChild, removeChildAt, setChildAt, setName, size, structChildAt, structChildNum, structsize |
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, getName, getNextLeaf, getNextNode, getNodeName, getObservers, getParentNode, getPrevLeaf, getPrevNode, getRelLocation, getSticky, indexSticky, intersects, isLeaf, isValid, markDirty, markDirtySubtree, markDirtyTo, morphInto, remove, removeSticky, removeSticky, removeTidy, repaint, repaint, repaint, scrollTo, scrollTo, 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 |
Constructor Detail |
---|
public Root(java.util.Map<java.lang.String,java.lang.Object> attr, Browser br)
Method Detail |
---|
public Root getRoot()
getRoot
in class Document
public void repaint(long ms, int x, int y, int w, int h)
repaint
in class Node
public boolean formatBeforeAfter(int width, int height, Context cx)
formatBeforeAfter
in class Document
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 void reformat(Node dirty)
Node
However some applications, such as interactive editing and the display of status messages, need the best possible performance. If the range of changes can be bounded in some subtree, such that if the dimensions (width and height) of the subtree remain the same after reformatting, then reformatting can be speeded up. This rules out floats and HTML tables that compute cell widths based on the needs of their contents. (If the new dimensions are not the same, then fall back to the above guaranteed correct but possibly slower reformatting.)
Subclasses override this method for correctness for that node or for greater performance.
An HTML table may compute cell widths based on the relative needs of cell contents,
and so for correctness, in general, needs a complete reformat of the table.
IParaBox
can improve performance by skipping over
previous words in the paragraph, and stop reformatting if the change fits on the same line.
To use, first Node.setValid(boolean)
with false
on node that contains all the changes,
then make changes in the subtree, and then invoke this method on that node.
reformat
in class Node
public boolean checkRep()
VObject
checkRep
in class Document
|
Multivalent API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |