|
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
An internal node that scrolls its content as necessary.
Dimensions are independent of its children's.
Therefore, unlike other Nodes, dimensions should be set externally,
either directly in pixels on bbox or in characters with setSizeChars(int,int)
.
Otherwise, dimensions take all available space.
Does not lay out children, so should have single child, and perhaps visual layers as well. Methods can scroll to (x,y) position or to passed Node.
Contents are formatted on demand, at the first call to paint
.
Thus, the reformatting required by any amount of editing is batched.
On the other hand, if any part of the node is to be painted, it must be entirely formatted;
the scrollbars, for instance, require this to visually indicate the percentage of the document shown.
LATER
Field Summary | |
---|---|
boolean |
editable
Is content editable? |
protected int |
hchars_
|
java.awt.Rectangle |
ibbox
Bounding box of content. |
static java.lang.String |
MSG_FORMATTED
Report that contents of pane have been formatted. |
static java.lang.String |
MSG_SCROLL_TO
Scroll document to point that shows arg. |
protected int |
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 | |
---|---|
IScrollPane(java.lang.String name,
java.util.Map<java.lang.String,java.lang.Object> attr,
INode parent)
|
Method Summary | |
---|---|
boolean |
checkRep()
Checks "representation invariant" (see MIT SE), and returns true iff object is valid, which should be always |
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 |
eventNode(java.awt.AWTEvent e,
java.awt.Point rel)
Internal nodes pass on to children. |
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. |
VScrollbar |
getHsb()
|
IScrollPane |
getIScrollPane()
Chains up parent links. |
VScrollbar |
getVsb()
Scrollbars, which uncharacteristically aren't reachable by walking the tree. |
void |
paintBeforeAfter(java.awt.Rectangle docclip,
Context cx)
If IScrollPane not valid when needs to be painted, format it now. |
void |
paintNode(java.awt.Rectangle docclip,
Context cx)
Paints contents in scrolled, clipped Graphics2D . |
void |
scrollBy(int dx,
int dy)
Scroll by a delta x and y. |
void |
scrollTo(int x,
int y)
Scroll to an absolute x and y. |
void |
scrollTo(Node node,
int xoff,
int yoff,
boolean pickplace)
Pickplace option described in VScrollbar. |
void |
setScrollbarShowPolicy(byte policy)
Convenience method to set both scrollbars to same VScrollbar policy. |
void |
setSizeChars(int widthchars,
int heightchars)
Compute dimensions from number of characters of prevailing font. |
Methods inherited from class multivalent.INode |
---|
addCategory, appendChild, breakAfter, breakBefore, childAt, childNum, clipboardNode, clone, contains, eventBeforeAfter, findDFS, formatBeforeAfter, 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, getBrowser, getDocument, 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.lang.String MSG_SCROLL_TO
"scrollTo": arg= Span
start-of-span-if-set
"scrollTo": arg= Node
Node
"scrollTo": arg= Integer
absolute-position, in= Node
node in tree (usually IScrollPane or Document)
"scrollTo": arg= String
name-of-anchor, in= Node
node in tree (usually IScrollPane or Document)
public static final java.lang.String MSG_FORMATTED
"formattedPane": arg= IScrollPane
instance
public java.awt.Rectangle ibbox
public boolean editable
protected int wchars_
protected int hchars_
Constructor Detail |
---|
public IScrollPane(java.lang.String name, java.util.Map<java.lang.String,java.lang.Object> attr, INode parent)
Method Detail |
---|
public IScrollPane getIScrollPane()
Node
getIScrollPane
in class Node
public int dx()
INode
dx
in class INode
public int dy()
INode
dy
in class INode
public VScrollbar getVsb()
public VScrollbar getHsb()
public void setScrollbarShowPolicy(byte policy)
VScrollbar
policy.
Access scrollbars individually to set to different policies.
public void setSizeChars(int widthchars, int heightchars)
public boolean formatNode(int width, int height, Context cx)
MSG_FORMATTED
.
formatNode
in class INode
FixedI
public void paintBeforeAfter(java.awt.Rectangle docclip, Context cx)
paintBeforeAfter
in class INode
public void paintNode(java.awt.Rectangle docclip, Context cx)
Graphics2D
.
paintNode
in class INode
public boolean eventNode(java.awt.AWTEvent e, java.awt.Point rel)
INode
eventNode
in class INode
TreeEvent
,
SemanticEvent
public void scrollBy(int dx, int dy)
public void scrollTo(int x, int y)
public void scrollTo(Node node, int xoff, int yoff, boolean pickplace)
VScrollbar
public boolean checkRep()
VObject
checkRep
in class INode
public void dump(int level, int maxlevel)
Node
dump
in class INode
|
Multivalent API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |