ice.pilots.html4
Class ObjectBox

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

public class ObjectBox
extends ice.pilots.html4.CSSBox


Field Summary
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 static int idCounter
           
protected  ice.pilots.html4.CSSBox next
           
protected  ice.pilots.html4.CSSBox parentBox
           
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Method Summary
 boolean checkIfVisible()
          Check to see if the ObjectBox should be visible.
 void clearHighlights()
          Clear all highlight ranges on a given node.
 void findAbsolutePosition(Point p)
          Find the absolute position of the top left corner of the content box.
protected  void findAbsolutePosition(Rectangle rec)
          Find the absolutePostion of this object box.
protected  void findAbsPos(Point p)
          Return the absolute position of the the box inside the document.
 ScrollBox getAncestorScrollBox()
          Used to find the nearest ancestor ScrollBox in which this ObjectBox lives.
 Color getBackgroundColor()
           
 CSSAttribs getCSSAttribs()
           
 ObjectPainter getObjectPainter()
           
 ScrollBox getScrollBox()
          If this ObjectBox represents a Scroller, return the corresponding ScrollBox.
 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 invalidate()
           
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.
 void reqReflow()
           
 void reqRepaint()
           
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

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

checkIfVisible

public boolean checkIfVisible()
Check to see if the ObjectBox should be visible. This includes hiding because of z-index issues

Returns:
true if visible, false if the Object should be hidden

getBackgroundColor

public Color getBackgroundColor()

findAbsolutePosition

public void findAbsolutePosition(Point p)
Find the absolute position of the top left corner of the content box.

Parameters:
p - The point argument to fill in

invalidate

public void invalidate()

reqReflow

public void reqReflow()

reqRepaint

public void reqRepaint()

getAncestorScrollBox

public ScrollBox getAncestorScrollBox()
Used to find the nearest ancestor ScrollBox in which this ObjectBox lives. Note that if this box represents a scroller, its ScrollBox is not taken into account.


getScrollBox

public ScrollBox getScrollBox()
If this ObjectBox represents a Scroller, return the corresponding ScrollBox. Used from Scroller.


getObjectPainter

public ObjectPainter getObjectPainter()

findAbsolutePosition

protected void findAbsolutePosition(Rectangle rec)
Find the absolutePostion of this object box. Added so that pritner can access this need information for iframes.

Parameters:
rec - shape of object box.

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.