ice.pilots.html4
Class ScrollBox

java.lang.Object
  extended byice.pilots.html4.CSSBox
      extended byice.pilots.html4.InlineBox
          extended byice.pilots.html4.BlockBox
              extended byice.pilots.html4.ScrollBox
All Implemented Interfaces:
HighlightListener, ImageObserver

public class ScrollBox
extends ice.pilots.html4.BlockBox

This box is used by CSS scrollers to contain all the children of a BlockBox which has overflow==scroll


Field Summary
protected static int _expansions
           
protected  LineBox[] _lineBoxArray
           
protected  int _lineBoxIndex
          An index into the array of LineBoxes used for line layout
protected static int _passes
           
protected  int _startingCharOffset
          The index of the starting character offset for this passage.
protected  int _startingSentenceOffset
           
protected  int _startingWordOffset
           
protected  int boxId
           
protected  ice.pilots.html4.CSSLayout cssLayout
           
protected  DElement element
           
protected  ice.pilots.html4.CSSBox first
           
protected static int idCounter
           
protected  boolean isPureBlock
           
protected  ice.pilots.html4.CSSBox last
           
protected  int lastPosition
           
protected  ice.pilots.html4.CSSBox lastProcessedChild
           
protected static int LINE_ARRAY_SIZE
           
protected static int LINE_BLOCK_SIZE
           
protected  int[] lines
           
protected  ice.pilots.html4.CSSBox next
           
protected  ice.pilots.html4.CSSBox parentBox
           
protected  int sizeLines
           
protected  int totalSkipped
           
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Method Summary
protected  boolean changeDynamicStyle(int type)
           
 void clearHighlights()
          Clear all highlight ranges on a given node.
protected  void findAbsPos(Point p)
          Return the absolute position of the the box inside the document.
 ScrollBox getAncestorScrollBox()
          Get the closest ScrollBox ancestor of this ScrollBox
 CSSAttribs getCSSAttribs()
           
 int getHeight()
          Retrieve the height of this ScrollBox
 ObjectBox getObjectBox()
          Get ObjectBox associated with this ScrollBox
 int getScrollableHeight()
          Retrieve the height of this ScrollBox's client content.
 int getScrollableWidth()
          Retrieve the width of this ScrollBox's client.
 int getScrollX()
          Retrieve the setting of the horizontal ScrollBar
 int getScrollY()
          Retrieve the setting of the vertical ScrollBar
 int getWidth()
          Retrieve the width of this ScrollBox
 boolean hasMoreThanOneChild()
           
 void highlightArea(int startPosition, int endPosition)
          Define a highlight range on a given node.
 boolean imageUpdate(Image img, int info, int x, int y, int w, int h)
           
 void layout(int parentContentWidth, int parentContentHeight, ice.pilots.html4.FloatManager m)
           
 void layoutScrollable(int parentContentWidth, int parentContentHeight)
           
 void paint(Graphics g)
          Paint the contents of this block box.
protected  void paintBackground(Graphics g, Rectangle clip_r, int aX, int aY, int aW, int aH, int vadjust)
          Paint the background color and/or the background image of this box.
protected  void paintBorders(Graphics g, Rectangle r, int x, int y, int w, int h, boolean isTop, boolean isBottom, boolean isLeft, boolean isRight)
          It is assumed that if isTop==true then isTop has some style and has width.
protected  void paintChildren(Graphics g, int aStartX, int aWidth, LineBox aLineBox)
          Paint this InlineBoxes children.
 void paintScrollable(Graphics g)
           
 void setScrollPosition(int sx, int sy)
           
protected  boolean setVisibility(short b)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

isPureBlock

protected boolean isPureBlock

LINE_BLOCK_SIZE

protected static final int LINE_BLOCK_SIZE
See Also:
Constant Field Values

LINE_ARRAY_SIZE

protected static final int LINE_ARRAY_SIZE
See Also:
Constant Field Values

_passes

protected static final int _passes
See Also:
Constant Field Values

_expansions

protected static final int _expansions
See Also:
Constant Field Values

lines

protected int[] lines

_lineBoxArray

protected LineBox[] _lineBoxArray

sizeLines

protected int sizeLines

totalSkipped

protected int totalSkipped

_lineBoxIndex

protected int _lineBoxIndex
An index into the array of LineBoxes used for line layout


first

protected ice.pilots.html4.CSSBox first

last

protected ice.pilots.html4.CSSBox last

lastProcessedChild

protected ice.pilots.html4.CSSBox lastProcessedChild

lastPosition

protected int lastPosition

idCounter

protected static int idCounter

boxId

protected int boxId

cssLayout

protected ice.pilots.html4.CSSLayout cssLayout

parentBox

protected ice.pilots.html4.CSSBox parentBox

next

protected ice.pilots.html4.CSSBox next

element

protected DElement element

_startingCharOffset

protected int _startingCharOffset
The index of the starting character offset for this passage. For accessability


_startingWordOffset

protected int _startingWordOffset

_startingSentenceOffset

protected int _startingSentenceOffset
Method Detail

setScrollPosition

public void setScrollPosition(int sx,
                              int sy)

getScrollX

public int getScrollX()
Retrieve the setting of the horizontal ScrollBar

Returns:
The setting of the horizontal scrollbar. 0 if not enabled
Since:
6.1

getScrollY

public int getScrollY()
Retrieve the setting of the vertical ScrollBar

Returns:
The setting of the vertical scrollbar. 0 if not enabled
Since:
6.1

paint

public void paint(Graphics g)
Description copied from class: ice.pilots.html4.BlockBox
Paint the contents of this block box.

Parameters:
g - GraphicsContext to paint the box in

getScrollableWidth

public int getScrollableWidth()
Retrieve the width of this ScrollBox's client. This is the value that may be larger than the ScrollBox.

Returns:
The width in pixels

getScrollableHeight

public int getScrollableHeight()
Retrieve the height of this ScrollBox's client content. This is the value that may be larger than the ScrollBox

Returns:
the height in pixels

getHeight

public int getHeight()
Retrieve the height of this ScrollBox

Returns:
The height
Since:
6.1

getWidth

public int getWidth()
Retrieve the width of this ScrollBox

Returns:
The width
Since:
6.1

layoutScrollable

public void layoutScrollable(int parentContentWidth,
                             int parentContentHeight)

paintScrollable

public void paintScrollable(Graphics g)

getAncestorScrollBox

public ScrollBox getAncestorScrollBox()
Get the closest ScrollBox ancestor of this ScrollBox


getObjectBox

public ObjectBox getObjectBox()
Get ObjectBox associated with this ScrollBox


layout

public void layout(int parentContentWidth,
                   int parentContentHeight,
                   ice.pilots.html4.FloatManager m)

hasMoreThanOneChild

public boolean hasMoreThanOneChild()

changeDynamicStyle

protected final boolean changeDynamicStyle(int type)

paintChildren

protected void paintChildren(Graphics g,
                             int aStartX,
                             int aWidth,
                             LineBox aLineBox)
Paint this InlineBoxes children. This method replaces the earlier version that accepted ascent and descent from the BlockBox. This method determines the different line permutations from the _lines array maintained now in this object. For each rendered line that is contained in this InlineBox, this method calls paintChunk to paint a chunk that starts within the element, and stretches across the screen. The LineBox is meant to contain the y deflections for each element in the line. It may be null, however if the BlockBox has floating elements.

Parameters:
g - The GraphicsContext
aStartX - The starting X offset of the chunk to paint
aWidth - The width of the screen segment in which to paint children in.
aLineBox - The object describing the y deflection of the line elements. This may be null.

setVisibility

protected final boolean setVisibility(short b)

getCSSAttribs

public CSSAttribs getCSSAttribs()

highlightArea

public void highlightArea(int startPosition,
                          int endPosition)
Define a highlight range on a given node. Each node should be capable of accepting multiple highlight regions.

Specified by:
highlightArea in interface HighlightListener
Parameters:
startPosition - Starting character offset for highlight range, or zero.
endPosition - Ending character offset for highlight range, or zero.

clearHighlights

public void clearHighlights()
Clear all highlight ranges on a given node. Currently, I don't quite see the need to identify and clear each highlight range independently.

Specified by:
clearHighlights in interface HighlightListener

findAbsPos

protected void findAbsPos(Point p)
Return the absolute position of the the box inside the document.

Parameters:
p - position will be writen to this variable.

toString

public String toString()

paintBackground

protected void paintBackground(Graphics g,
                               Rectangle clip_r,
                               int aX,
                               int aY,
                               int aW,
                               int aH,
                               int vadjust)
Paint the background color and/or the background image of this box. This method paints the background of some high level box types, InlineBox, BlockBox, and Table cell boxes. Note that the background image is read from the CSSAttribs instance variable.

Parameters:
g - Graphics context in which to paint.
clip_r - Clipping bounds of Graphics context
aX - X position of top left corner
aY - Y position of top left corner
aW - Width of area to paint
aH - Height of area to paint
vadjust - An adjustment factor to apply to a background image.

imageUpdate

public boolean imageUpdate(Image img,
                           int info,
                           int x,
                           int y,
                           int w,
                           int h)
Specified by:
imageUpdate in interface ImageObserver

paintBorders

protected void paintBorders(Graphics g,
                            Rectangle r,
                            int x,
                            int y,
                            int w,
                            int h,
                            boolean isTop,
                            boolean isBottom,
                            boolean isLeft,
                            boolean isRight)
It is assumed that if isTop==true then isTop has some style and has width. This has to be checked outside.