|
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
An independent document, generally with content subtree, stylesheet,
URI (not URL),
Layers of behaviors that implementing genre- or document-specific functionality,
and document-wide variables.
Documents can contain other documents, as for a HTML FRAMESET.
The topmost containing document is the Root,
of which there is exactly one in a Browser.
Documents contain:
link to document-specific behaviors
URI, stylesheet,
global variables in addition to attributes,
primary media adaptor
| Field Summary | |
|---|---|
static java.lang.String |
ATTR_AUTHOR
Metadata: document author. |
static java.lang.String |
ATTR_GENRE
Document genre, such as "HTML" or "ManualPage". |
static java.lang.String |
ATTR_LOADING
Non-null while loading is in progress. |
static java.lang.String |
ATTR_PAGE
Attribute in Document giving current page number in a multipage document. |
static java.lang.String |
ATTR_PAGECOUNT
Attribute in Document giving number of pages in a multipage document. |
static java.lang.String |
ATTR_STOP
Non-null if loading has been aborted. |
static java.lang.String |
ATTR_TITLE
Metadata: document title. |
static java.lang.String |
ATTR_URI
Document URI. |
static java.lang.String |
MSG_BUILD
Request build of document, which comes after successful open. |
static java.lang.String |
MSG_CLOSE
Close current document, stopping loading if necessary, saving annotations and so on. |
static java.lang.String |
MSG_CURRENT
Announce document has taken the active one, taking the focus. |
static java.lang.String |
MSG_FORMATTED
Announce document has been formatted, which means all geometric posisions are valid. |
static java.lang.String |
MSG_OPEN
Open new document; if this is the a different point in the current document, a shortcut may bypass "openedDocument" |
static java.lang.String |
MSG_OPENED
Announce opening of document has finished, before it has been formatted (completely -- there may be incremental displays) |
static java.lang.String |
MSG_REDIRECTED
Announce a redirection has taken place. |
static java.lang.String |
MSG_REFORMAT
Request reformat of "current" document. |
static java.lang.String |
MSG_RELOAD
Create new browser window. |
static java.lang.String |
MSG_REPAINT
Request repaint of "current" document, which will invoke reformat if document layout is dirty. |
static java.lang.String |
MSG_STOP
Stop loading of current document. |
protected StyleSheet |
styleSheet_
|
java.net.URI |
uri
??? |
static java.lang.String |
VAR_HEADERS
Key to Map of HTTP headers (perhaps simulated if loading from file system). |
| 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 | |
|---|---|
Document(java.lang.String name,
java.util.Map<java.lang.String,java.lang.Object> attr,
INode parent)
|
|
Document(java.lang.String name,
java.util.Map<java.lang.String,java.lang.Object> attr,
INode parent,
Browser br)
|
|
| Method Summary | |
|---|---|
boolean |
checkRep()
Checks "representation invariant" (see MIT SE), and returns true iff object is valid, which should be always |
void |
clear()
Clean up state (globals, children, ...), Behavior.destroy() genre and document-specific behaviors, and recursively close sub-Documents. |
boolean |
eventNode(java.awt.AWTEvent e,
java.awt.Point rel)
On mouse click, set this document to the current one. |
boolean |
formatBeforeAfter(int width,
int height,
Context cx)
Documents have own StyleSheet and associated Context. |
boolean |
formatNode(int width,
int height,
Context cx)
If length of dimension set in characters or to dynamic (these mutually cancel each other out--last one set wins), use that to set corresponding bounding box dimension. |
Browser |
getBrowser()
Chains up parent links. |
Document |
getDocument()
End Node's chain up tree by returning this. |
Layer |
getLayer(java.lang.String name)
Convenience method for getLayers() plus Layer.getInstance(String). |
Layer |
getLayers()
Returns the topmost layer, which holds useful layers (system, genre, annotations, ...). |
MediaAdaptor |
getMediaAdaptor()
Returns (primary) media adaptor that created document tree. |
Root |
getRoot()
Chains up parent links. |
StyleSheet |
getStyleSheet()
|
java.net.URI |
getURI()
|
java.lang.Object |
getVar(java.lang.Object key)
|
INode |
getVisualLayer(java.lang.String name)
Deprecated. visual layers not special |
INode |
getVisualLayer(java.lang.String name,
java.lang.String classname)
|
void |
paintBeforeAfter(java.awt.Rectangle docclip,
Context cx)
Substitutes own StyleSheet and associated Context in place of one in prevailing Context. |
void |
paintNode(java.awt.Rectangle docclip,
Context cx)
Paints contents in scrolled, clipped Graphics2D. |
void |
putVar(java.lang.Object key,
java.lang.Object val)
|
void |
removeVar(java.lang.Object key)
|
void |
setMediaAdaptor(MediaAdaptor me)
|
void |
setParentNode(INode p)
Used by IScrollPane to point scrollbars at it without it pointing at scrollbar. |
void |
setStyleSheet(StyleSheet ss)
|
| 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, reformat, remove, removeSticky, removeSticky, removeTidy, repaint, 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 |
| Field Detail |
|---|
public static final java.lang.String MSG_OPEN
"openDocument": arg= HashMap null - same as reload
"openDocument": arg= String URI to open - translated into...
"openDocument": arg= URL URI to open - translated into...
"openDocument": arg= URI URI to open - translated into..., replacing the current document
"openDocument": arg= DocInfo URI, document to replace, and other details - final form of all "openDocument"'s
public static final java.lang.String MSG_OPENED
"openedDocument": arg= DocInfo data of document just opened
public static final java.lang.String MSG_BUILD
open.
"buildDocument": arg= Document instance
public static final java.lang.String MSG_CLOSE
"closeDocument": arg= HashMap attributes, in= INode root of tree, out=unused.
public static final java.lang.String MSG_RELOAD
"reloadDocument": arg= Node replace this document, or current document if null.
public static final java.lang.String MSG_REDIRECTED
"redirectedDocument": arg= URI of new address, as in MSG_OPEN
public static final java.lang.String MSG_STOP
"stopDocument": arg= HashMap attributes, in= INode root of tree, out=unused.
public static final java.lang.String MSG_FORMATTED
"formattedDocument": arg= Document instance.
public static final java.lang.String MSG_REFORMAT
"reloadDocument": arg= URI location of hub
public static final java.lang.String MSG_REPAINT
"repaintDocument": arg= URI location of hub
public static final java.lang.String MSG_CURRENT
"currentDocument": arg= Document instance.
Browser.setCurDocument(Document),
Constant Field Valuespublic static final java.lang.String VAR_HEADERS
Map of HTTP headers (perhaps simulated if loading from file system).
public static final java.lang.String ATTR_PAGE
Document giving current page number in a multipage document.
Pages are logically numbered starting from 1 to total-pages inclusive, regardless of "printed" page numbers.
Media adaptors translate between this and their internal numbering scheme.
public static final java.lang.String ATTR_PAGECOUNT
Document giving number of pages in a multipage document.
This is set by the media adaptor, if intrinsic to the document (as in DVI, PDF), or otherwise must be set in a hub.
public static final java.lang.String ATTR_AUTHOR
public static final java.lang.String ATTR_TITLE
public static final java.lang.String ATTR_URI
public static final java.lang.String ATTR_GENRE
public static final java.lang.String ATTR_LOADING
public static final java.lang.String ATTR_STOP
public java.net.URI uri
protected StyleSheet styleSheet_
| Constructor Detail |
|---|
public Document(java.lang.String name,
java.util.Map<java.lang.String,java.lang.Object> attr,
INode parent)
public Document(java.lang.String name,
java.util.Map<java.lang.String,java.lang.Object> attr,
INode parent,
Browser br)
| Method Detail |
|---|
public void clear()
Behavior.destroy() genre and document-specific behaviors, and recursively close sub-Documents.
Whatever saving needs to be done should have already taken place.
public void setParentNode(INode p)
Node
setParentNode in class Nodepublic Layer getLayers()
public Browser getBrowser()
Node
getBrowser in class Nodepublic Root getRoot()
Node
getRoot in class Nodepublic java.net.URI getURI()
public Document getDocument()
Node's chain up tree by returning this.
getDocument in class Nodepublic Layer getLayer(java.lang.String name)
getLayers() plus Layer.getInstance(String).
public StyleSheet getStyleSheet()
public void setStyleSheet(StyleSheet ss)
public MediaAdaptor getMediaAdaptor()
public void setMediaAdaptor(MediaAdaptor me)
public final java.lang.Object getVar(java.lang.Object key)
public final void putVar(java.lang.Object key,
java.lang.Object val)
public final void removeVar(java.lang.Object key)
public boolean formatBeforeAfter(int width,
int height,
Context cx)
formatBeforeAfter in class INodewidth - 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)
IScrollPaneIScrollPane.MSG_FORMATTED.
formatNode in class IScrollPaneFixedI
public void paintBeforeAfter(java.awt.Rectangle docclip,
Context cx)
StyleSheet and associated Context in place of one in prevailing Context.
paintBeforeAfter in class IScrollPane
public void paintNode(java.awt.Rectangle docclip,
Context cx)
IScrollPaneGraphics2D.
paintNode in class IScrollPane
public boolean eventNode(java.awt.AWTEvent e,
java.awt.Point rel)
eventNode in class IScrollPaneTreeEvent,
SemanticEventpublic INode getVisualLayer(java.lang.String name)
public INode getVisualLayer(java.lang.String name,
java.lang.String classname)
public boolean checkRep()
VObject
checkRep in class IScrollPane
|
Multivalent API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||