multivalent
public class Document extends IScrollPane
java.net.URI URI
(not java.net.URL 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.
Document
s contain:
link
to document-specific behaviors
URI
, stylesheet
,
global variables
in addition to attributes,
primarymedia adaptor
Version: $Revision: 1.8 $ $Date: 2003/06/02 05:04:14 $
Field Summary | |
---|---|
static String | ATTR_AUTHOR Document author. |
static String | ATTR_GENRE Document genre, such as "HTML" or "ManualPage". |
static String | ATTR_LOADING Non-null while loading is in progress. |
static String | ATTR_PAGE
Attribute in Document giving current page number in a multipage document.
|
static String | ATTR_PAGECOUNT
Attribute in Document giving number of pages in a multipage document.
|
static String | ATTR_STOP
Non-null if loading has been aborted.
|
static String | ATTR_TITLE Document title. |
static String | ATTR_URI Document URI. |
static String | MSG_BUILD
Request build of document, which comes after successful open .
|
static String | MSG_CLOSE
Close current document,
stopping loading if necessary, saving annotations and so on.
|
static String | MSG_CURRENT
Announce document has taken the active one, taking the focus.
|
static String | MSG_FORMATTED
Announce document has been formatted, which means all geometric posisions are valid.
|
static String | MSG_OPEN
Open new document; if this is the a different point in the current document, a shortcut may bypass "openedDocument" |
static String | MSG_OPENED
Announce opening of document has finished, before it has been formatted (completely -- there may be incremental displays) |
static String | MSG_REDIRECTED
Announce a redirection has taken place.
|
static String | MSG_REFORMAT
Request reformat of "current" document.
|
static String | MSG_RELOAD
Create new browser window.
|
static String | MSG_REPAINT
Request repaint of "current" document, which will invoke reformat if document layout is dirty.
|
static String | MSG_STOP
Stop loading of current document.
|
protected StyleSheet | styleSheet_ |
URI | uri
??? |
static String | VAR_HEADERS Key to java.util.Map of HTTP headers (perhaps simulated if loading from file system). |
Constructor Summary | |
---|---|
Document(String name, Map<String,Object> attr, INode parent) | |
Document(String name, Map<String,Object> attr, INode parent, Browser br) |
Method Summary | |
---|---|
boolean | checkRep() |
void | clear() |
boolean | eventNode(AWTEvent e, 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) |
Browser | getBrowser() |
Document | getDocument() End Node's chain up tree by returning this. |
Layer | getLayer(String name) Convenience method for getLayers plus getInstance. |
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() |
StyleSheet | getStyleSheet() |
URI | getURI() |
Object | getVar(Object key) |
INode | getVisualLayer(String name)
Returns visual layer of passed name, creating if necessary |
INode | getVisualLayer(String name, String classname) |
void | paintBeforeAfter(Rectangle docclip, Context cx) |
void | paintNode(Rectangle docclip, Context cx) |
void | putVar(Object key, Object val) |
void | removeVar(Object key) |
void | setMediaAdaptor(MediaAdaptor me) |
void | setParentNode(INode p) |
void | setStyleSheet(StyleSheet ss) |
open
.
"buildDocument": arg= Document instance
"closeDocument": arg= java.util.HashMap attributes, in= INode root of tree, out=unused.
"currentDocument": arg= Document instance.
See Also: setCurDocument
"formattedDocument": arg= Document instance.
"openDocument": arg= java.util.HashMap null - same as reload
"openDocument": arg= java.lang.String URI to open - translated into...
"openDocument": arg= java.net.URL URI to open - translated into...
"openDocument": arg= java.net.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
"openedDocument": arg= DocInfo data of document just opened
"redirectedDocument": arg= URI of new address, as in MSG_OPEN
"reloadDocument": arg= java.net.URI location of hub
"reloadDocument": arg= Node replace this document, or current document if null.
"repaintDocument": arg= java.net.URI location of hub
"stopDocument": arg= java.util.HashMap attributes, in= INode root of tree, out=unused.
Deprecated: visual layers not special
Returns visual layer of passed name, creating if necessary. Maybe move this to IScrollPane.