public class DefaultBox extends DefaultContentRect implements Box
Box.DisplayType, Box.Type
Constructor and Description |
---|
DefaultBox() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getAttribute(java.lang.String name)
Obtains a value of an additional attribute.
|
Border |
getBorderStyle(Border.Side side)
Obtains the properties of the box border at the given side.
|
int |
getBottomBorder()
Obtains the bottom border width.
|
java.awt.Color |
getColor()
Obtains the box text color.
|
Rectangular |
getContentBounds()
Returns the content bounds.
|
ContentObject |
getContentObject()
Obtains the content object contained in this box.
|
Box.DisplayType |
getDisplayType()
Obtains the display type of the element according to the CSS display: property.
|
java.lang.String |
getFontFamily()
Obtains the font family name used by the box.
|
int |
getHeight() |
Box |
getChildBox(int index)
Obtains the n-th child box.
|
int |
getLeftBorder()
Obtains the left border width.
|
Box |
getParentBox()
Obtains the parent box of this box.
|
int |
getRightBorder()
Obtains the right border width.
|
java.lang.String |
getTagName()
When the box is generated by a DOM element, obtains the corresponding tag name.
|
java.lang.String |
getText()
Obtains the complete text contained in this box.
|
int |
getTopBorder()
Obtains the top border width.
|
Box.Type |
getType()
Resurns the type of the box.
|
Rectangular |
getVisualBounds()
Returns the bounds of the box as they visually appear to the user.
|
int |
getWidth() |
int |
getX1() |
int |
getX2() |
int |
getY1() |
int |
getY2() |
boolean |
isVisible()
Checks whether the box is visible.
|
void |
removeAttribute(java.lang.String name) |
void |
setAttribute(java.lang.String name,
java.lang.String value) |
void |
setBorderStyle(Border.Side side,
Border style) |
void |
setBottomBorder(int width) |
void |
setColor(java.awt.Color color) |
void |
setContentBounds(Rectangular contentBounds) |
void |
setContentObject(ContentObject contentObject) |
void |
setDisplayType(Box.DisplayType displayType) |
void |
setFontFamily(java.lang.String fontFamily) |
void |
setLeftBorder(int width) |
void |
setRightBorder(int width) |
void |
setTagName(java.lang.String tagName) |
void |
setText(java.lang.String text) |
void |
setTopBorder(int width) |
void |
setType(Box.Type type) |
void |
setVisible(boolean visible) |
void |
setVisualBounds(Rectangular visualBounds) |
getBackgroundColor, getBorderCount, getBounds, getFontSize, getFontStyle, getFontWeight, getId, getLineThrough, getPage, getUnderline, hasBottomBorder, hasLeftBorder, hasRightBorder, hasTopBorder, isBackgroundSeparated, setBackgroundColor, setBackgroundSeparated, setBorders, setBounds, setFontSize, setFontStyle, setFontWeight, setId, setLineThrough, setPage, setUnderline
add, addAttribute, getAttribute, getDepth, getChildAt, getChildCount, getChildren, getIndex, getLeafCount, getNextSiblingNode, getParent, getPreviousSiblingNode, getRoot, insert, isLeaf, isRoot, remove, remove, removeAllChildren
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getBounds, getChildCount
getBackgroundColor, getBorderCount, getFontSize, getFontStyle, getFontWeight, getId, getLineThrough, getPage, getUnderline, hasBottomBorder, hasLeftBorder, hasRightBorder, hasTopBorder, isBackgroundSeparated
public Box getChildBox(int index)
Box
getChildBox
in interface Box
index
- the child indexpublic Box getParentBox()
Box
getParentBox
in interface Box
null
when this is the root box.public boolean isVisible()
Box
public void setVisible(boolean visible)
public java.awt.Color getColor()
Box
public void setColor(java.awt.Color color)
public java.lang.String getFontFamily()
Box
getFontFamily
in interface Box
public void setFontFamily(java.lang.String fontFamily)
public java.lang.String getText()
Box
public void setText(java.lang.String text)
public ContentObject getContentObject()
Box
getContentObject
in interface Box
null
when there is no object contained.public void setContentObject(ContentObject contentObject)
public Rectangular getContentBounds()
Box
getContentBounds
in interface Box
public void setContentBounds(Rectangular contentBounds)
public Rectangular getVisualBounds()
Box
getVisualBounds
in interface Box
public void setVisualBounds(Rectangular visualBounds)
public java.lang.String getTagName()
Box
getTagName
in interface Box
null
for boxes that do not correspond to a DOM element.public void setTagName(java.lang.String tagName)
public java.lang.String getAttribute(java.lang.String name)
Box
class
or href
.getAttribute
in interface Box
name
- the attribute namenull
if the value is not specified.public void setAttribute(java.lang.String name, java.lang.String value)
public void removeAttribute(java.lang.String name)
public Box.Type getType()
Box
public void setType(Box.Type type)
public Box.DisplayType getDisplayType()
Box
getDisplayType
in interface Box
public void setDisplayType(Box.DisplayType displayType)
public int getX1()
getX1
in interface Rect
getX1
in class DefaultContentRect
public int getY1()
getY1
in interface Rect
getY1
in class DefaultContentRect
public int getX2()
getX2
in interface Rect
getX2
in class DefaultContentRect
public int getY2()
getY2
in interface Rect
getY2
in class DefaultContentRect
public int getWidth()
getWidth
in interface Rect
getWidth
in class DefaultContentRect
public int getHeight()
getHeight
in interface Rect
getHeight
in class DefaultContentRect
public Border getBorderStyle(Border.Side side)
Box
getBorderStyle
in interface Box
side
- the border side.public void setBorderStyle(Border.Side side, Border style)
public int getTopBorder()
ContentRect
getTopBorder
in interface ContentRect
getTopBorder
in class DefaultContentRect
public void setTopBorder(int width)
setTopBorder
in class DefaultContentRect
public int getBottomBorder()
ContentRect
getBottomBorder
in interface ContentRect
getBottomBorder
in class DefaultContentRect
public void setBottomBorder(int width)
setBottomBorder
in class DefaultContentRect
public int getLeftBorder()
ContentRect
getLeftBorder
in interface ContentRect
getLeftBorder
in class DefaultContentRect
public void setLeftBorder(int width)
setLeftBorder
in class DefaultContentRect
public int getRightBorder()
ContentRect
getRightBorder
in interface ContentRect
getRightBorder
in class DefaultContentRect
public void setRightBorder(int width)
setRightBorder
in class DefaultContentRect