public class DefaultBox extends DefaultContentRect implements Box
Box.DisplayType, Box.Type| Constructor and Description |
|---|
DefaultBox() |
DefaultBox(DefaultBox src) |
| Modifier and Type | Method and Description |
|---|---|
String |
getAttribute(String name)
Obtains a value of an additional attribute.
|
Map<String,String> |
getAttributes()
Obtains the names and values of all the box attributes.
|
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.
|
String |
getFontFamily()
Obtains the font family name used by the box.
|
int |
getHeight() |
Box |
getChildBox(int index)
Obtains the n-th child box.
|
Box |
getParentBox()
Obtains the parent box of this box.
|
int |
getSourceNodeId()
Obtains a unique identification of the box source (e.g. the source DOM node).
|
String |
getTagName()
When the box is generated by a DOM element, obtains the corresponding tag name.
|
String |
getText()
Obtains the complete text contained in this box.
|
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 |
move(int xofs,
int yofs) |
void |
removeAttribute(String name) |
void |
setAttribute(String name,
String value) |
void |
setColor(Color color) |
void |
setContentBounds(Rectangular contentBounds) |
void |
setContentObject(ContentObject contentObject) |
void |
setDisplayType(Box.DisplayType displayType) |
void |
setFontFamily(String fontFamily) |
void |
setSourceNodeId(int sourceNodeId) |
void |
setTagName(String tagName) |
void |
setText(String text) |
void |
setType(Box.Type type) |
void |
setVisible(boolean visible) |
void |
setVisualBounds(Rectangular visualBounds) |
String |
toString() |
equals, getBackgroundColor, getBorderCount, getBorderStyle, getBottomBorder, getBounds, getFontSize, getFontStyle, getFontWeight, getId, getLeftBorder, getLineThrough, getPage, getRightBorder, getTopBorder, getUnderline, hasBottomBorder, hashCode, hasLeftBorder, hasRightBorder, hasTopBorder, isBackgroundSeparated, resetId, setBackgroundColor, setBackgroundSeparated, setBorders, setBorderStyle, setBottomBorder, setBounds, setFontSize, setFontStyle, setFontWeight, setId, setLeftBorder, setLineThrough, setPage, setRightBorder, setTopBorder, setUnderlineadd, addUserAttribute, getDepth, getChildAt, getChildCount, getChildren, getIndex, getLeafCount, getNextSiblingNode, getParent, getPreviousSiblingNode, getRoot, getUserAttribute, insert, isLeaf, isRoot, remove, remove, removeAllChildrenclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetBounds, getChildCountgetBackgroundColor, getBorderCount, getBorderStyle, getBottomBorder, getFontSize, getFontStyle, getFontWeight, getId, getLeftBorder, getLineThrough, getPage, getRightBorder, getTopBorder, getUnderline, hasBottomBorder, hasLeftBorder, hasRightBorder, hasTopBorder, isBackgroundSeparatedpublic DefaultBox()
public DefaultBox(DefaultBox src)
public Box getChildBox(int index)
BoxgetChildBox in interface Boxindex - the child indexpublic Box getParentBox()
BoxgetParentBox in interface Boxnull when this is the root box.public boolean isVisible()
Boxpublic void setVisible(boolean visible)
public void setColor(Color color)
public String getFontFamily()
BoxgetFontFamily in interface Boxpublic void setFontFamily(String fontFamily)
public String getText()
Boxpublic void setText(String text)
public ContentObject getContentObject()
BoxgetContentObject in interface Boxnull when there is no object contained.public void setContentObject(ContentObject contentObject)
public Rectangular getContentBounds()
BoxgetContentBounds in interface Boxpublic void setContentBounds(Rectangular contentBounds)
public Rectangular getVisualBounds()
BoxgetVisualBounds in interface Boxpublic void setVisualBounds(Rectangular visualBounds)
public int getSourceNodeId()
BoxgetSourceNodeId in interface Boxpublic void setSourceNodeId(int sourceNodeId)
public String getTagName()
BoxgetTagName in interface Boxnull for boxes that do not correspond to a DOM element.public void setTagName(String tagName)
public String getAttribute(String name)
Boxclass or href.getAttribute in interface Boxname - the attribute namenull if the value is not specified.public Map<String,String> getAttributes()
Boxclass or href.getAttributes in interface Boxpublic void removeAttribute(String name)
public Box.Type getType()
Boxpublic void setType(Box.Type type)
public Box.DisplayType getDisplayType()
BoxgetDisplayType in interface Boxpublic void setDisplayType(Box.DisplayType displayType)
public int getX1()
getX1 in interface RectgetX1 in class DefaultContentRectpublic int getY1()
getY1 in interface RectgetY1 in class DefaultContentRectpublic int getX2()
getX2 in interface RectgetX2 in class DefaultContentRectpublic int getY2()
getY2 in interface RectgetY2 in class DefaultContentRectpublic int getWidth()
getWidth in interface RectgetWidth in class DefaultContentRectpublic int getHeight()
getHeight in interface RectgetHeight in class DefaultContentRectpublic void move(int xofs,
int yofs)
move in interface Rectmove in class DefaultContentRectCopyright © 2018. All rights reserved.