multivalent

Class IScrollPane

public class IScrollPane extends INode

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 IScrollPane. 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

Version: $Revision: 1.9 $ $Date: 2003/02/14 02:07:10 $

Field Summary
booleaneditable
Is content editable?
protected inthchars_
Rectangleibbox
Bounding box of content.
static StringMSG_FORMATTED
Report that contents of pane have been formatted.
static StringMSG_SCROLL_TO
Scroll document to point that shows arg.
protected intwchars_
Constructor Summary
IScrollPane(String name, Map<String,Object> attr, INode parent)
Method Summary
booleancheckRep()
voiddump(int level, int maxlevel)
intdx()
intdy()
booleaneventNode(AWTEvent e, Point rel)
booleanformatNode(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.
VScrollbargetHsb()
IScrollPanegetIScrollPane()
VScrollbargetVsb()
Scrollbars, which uncharacteristically aren't reachable by walking the tree.
voidpaintBeforeAfter(Rectangle docclip, Context cx)
If IScrollPane not valid when needs to be painted, format it now.
voidpaintNode(Rectangle docclip, Context cx)
Paints contents in scrolled, clipped java.awt.Graphics2D.
voidscrollBy(int dx, int dy)
Scroll by a delta x and y.
voidscrollTo(int x, int y)
Scroll to an absolute x and y.
voidscrollTo(Node node, int xoff, int yoff, boolean pickplace)
Pickplace option described in VScrollbar.
voidsetScrollbarShowPolicy(byte policy)
Convenience method to set both scrollbars to same VScrollbar policy.
voidsetSizeChars(int widthchars, int heightchars)
Compute dimensions from number of characters of prevailing font.

Field Detail

editable

public boolean editable
Is content editable? This is the wrong way to do this, and will be changed in the future.

hchars_

protected int hchars_

ibbox

public Rectangle ibbox
Bounding box of content.

MSG_FORMATTED

public static final String MSG_FORMATTED
Report that contents of pane have been formatted.

"formattedPane": arg= IScrollPane instance

MSG_SCROLL_TO

public static final String MSG_SCROLL_TO
Scroll document to point that shows arg.

"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)

wchars_

protected int wchars_

Constructor Detail

IScrollPane

public IScrollPane(String name, Map<String,Object> attr, INode parent)

Method Detail

checkRep

public boolean checkRep()

dump

public void dump(int level, int maxlevel)

dx

public int dx()

dy

public int dy()

eventNode

public boolean eventNode(AWTEvent e, Point rel)

formatNode

public 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. Else maintain length, which should have been set externally beforehand. Sends MSG_FORMATTED.

getHsb

public VScrollbar getHsb()

getIScrollPane

public IScrollPane getIScrollPane()

getVsb

public VScrollbar getVsb()
Scrollbars, which uncharacteristically aren't reachable by walking the tree. That may change.

paintBeforeAfter

public void paintBeforeAfter(Rectangle docclip, Context cx)
If IScrollPane not valid when needs to be painted, format it now. Generally, formatting should be done lazily, on demand just before it needs to be painted (including in the IScrollPane subclass Document).

paintNode

public void paintNode(Rectangle docclip, Context cx)
Paints contents in scrolled, clipped java.awt.Graphics2D.

scrollBy

public void scrollBy(int dx, int dy)
Scroll by a delta x and y. Positive x moves right; positive y moves down.

scrollTo

public void scrollTo(int x, int y)
Scroll to an absolute x and y.

scrollTo

public void scrollTo(Node node, int xoff, int yoff, boolean pickplace)
Pickplace option described in VScrollbar.

See Also: VScrollbar

setScrollbarShowPolicy

public void setScrollbarShowPolicy(byte policy)
Convenience method to set both scrollbars to same VScrollbar policy. Access scrollbars individually to set to different policies.

setSizeChars

public void setSizeChars(int widthchars, int heightchars)
Compute dimensions from number of characters of prevailing font. To disable, set to 0.