|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Represents a rectangular area in the layout.
Method Summary | |
boolean |
containsOffset(int offset)
Returns true if this box contains the given offset. |
java.awt.Shape[] |
getCaretShapes(LayoutContext context,
int offset)
Returns shapes for the primary and secondary carets for the given offset. |
Box[] |
getChildren()
Returns an array of this box's children. |
Element |
getElement()
Returns the Element with which this box is associated, or null if there is no such box. |
int |
getEndOffset()
Returns the offset of the end of the content that the box covers. |
int |
getHeight()
Returns the height of the box. |
int |
getStartOffset()
Returns the offset of the start of the content that the box covers. |
int |
getWidth()
Returns the height of the box. |
int |
getX()
Returns the x-coordinate of the box's top left corner, relative to its parent. |
int |
getY()
Returns the y-coordinate of the box's top left corner, relative to its parent. |
boolean |
hasContent()
Returns true if this box represents a portion of the XML document's content. |
void |
paint(LayoutContext context,
int x,
int y)
Draws the box's content in the given Graphics context. |
void |
setX(int x)
Sets the x-coordinate of the top-left corner of the box. |
void |
setY(int y)
Sets the y-coordinate of the top-left corner of the box. |
int |
viewToModel(LayoutContext context,
int x,
int y)
Returns the offset in the content closest to the given view position. |
Method Detail |
public boolean containsOffset(int offset)
offset
- the offset to testpublic java.awt.Shape[] getCaretShapes(LayoutContext context, int offset)
context
- LayoutContext to be usedoffset
- offset for which to retrieve the caret
Shape
objectspublic Box[] getChildren()
public Element getElement()
public int getEndOffset()
public int getHeight()
public int getStartOffset()
public int getWidth()
public int getX()
public int getY()
public boolean hasContent()
public void paint(LayoutContext context, int x, int y)
context
- LayoutContext
containing the
Graphics
object into which the box should be
paintedx
- the x-offset at which the box should be paintedy
- the y-offset at which the box should be paintedpublic void setX(int x)
x
- the new x-coordinatepublic void setY(int y)
y
- the new y-coordinatepublic int viewToModel(LayoutContext context, int x, int y)
context
- LayoutContext
for this box treex
- x offset of the view position for which the model
offset is to be determined.y
- y offset of the view position for which the model
offset is to be determined.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |