public class DefaultArea extends DefaultContentRect implements Area
| Constructor and Description |
|---|
DefaultArea(Box box) |
DefaultArea(DefaultArea src) |
DefaultArea(int x1,
int y1,
int x2,
int y2) |
DefaultArea(java.util.List<Box> boxList) |
DefaultArea(Rectangular r) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addBox(Box box)
Adds a new box to the area.
|
void |
addTag(Tag tag,
float support)
Adds a tag to this area.
|
void |
appendChild(Area child)
Appends a new child area to the list of child areas of this area.
|
void |
appendChildren(java.util.List<Area> list)
Appends a list of child areas to the list of child areas of this area.
|
boolean |
containsTag(Tag tag)
Tests whether the area or any of its direct child areas have the given tag.
|
void |
createGrid()
Creates the grid of areas from the child areas.
|
Area |
createSuperArea(Rectangular gp,
java.util.List<Area> selected,
java.lang.String name)
Creates a new subarea from a specified region of the area and moves the selected child
nodes to the new area.
|
protected AreaTopology |
createTopology()
Creates a topology for this area.
|
java.util.Vector<Box> |
getAllBoxes()
Obtains all the boxes from this area and all the child areas.
|
java.util.Vector<Box> |
getBoxes()
Returns a vector of boxes that are inside of this area
|
java.lang.String |
getBoxText()
Returns the text string represented by a concatenation of all
the boxes contained directly in this area (no subareas)
|
Rectangular |
getContentBounds() |
java.awt.Color |
getEffectiveBackgroundColor()
Obtains the effective background color visible under the area.
|
AreaGrid |
getGrid()
Obtains the gird of contained areas.
|
int |
getGridHeight() |
Rectangular |
getGridPosition() |
int |
getGridWidth() |
int |
getGridX() |
int |
getGridY() |
Area |
getChildArea(int index)
Obtains the n-th child area.
|
java.util.List<Area> |
getChildAreas()
Returns the list of all the child areas.
|
DefaultArea |
getChildAtGridPos(int x,
int y)
Returns the child area at the specified grid position or null, if there is no
child area at this position.
|
int |
getIndex(Area child)
Returns the index of the specified child in this node's child array.
|
Tag |
getMostSupportedTag()
Obtains the tag with the greatest support that is assigned to this area.
|
java.lang.String |
getName() |
Area |
getNextOnLine() |
Area |
getNextSibling()
Obtains the next siblibg of this area.
|
Area |
getParentArea()
Obtains the parent area of this area.
|
Area |
getPreviousOnLine() |
Area |
getPreviousSibling()
Obtains the previous siblibg of this area.
|
java.util.Map<Tag,java.lang.Float> |
getTags()
Obtains the set of tags assigned to the area.
|
float |
getTagSupport(Tag tag)
Obtains the support of the given tag assignment
|
java.lang.String |
getText()
Returns the complete text contained in this area and its sub area.
|
java.lang.String |
getText(java.lang.String separator)
Returns the complete text contained in this area and its sub area.
|
AreaTopology |
getTopology()
Returns the topology of this area.
|
boolean |
hasTag(Tag tag)
Tests whether the area has this tag.
|
boolean |
hasTag(Tag tag,
float minSupport)
Tests whether the area has this tag with a support greater or equal to the specified value.
|
void |
insertChild(Area child,
int index)
Inserts a new child at the given position.
|
boolean |
isHorizontalSeparator()
Checks whether the area can be interpreted as a horizontal separator.
|
boolean |
isReplaced()
Checks whether this area is formed by replaced boxes.
|
boolean |
isSeparator()
Checks whether the area can be interpreted as any kind of separator.
|
boolean |
isVerticalSeparator()
Checks whether the area can be interpreted as a vertical separator.
|
void |
removeAllTags(java.util.Collection<Tag> c)
Removes all tags that belong to the given collection.
|
void |
removeChild(Area child)
Removes a child area from its parent.
|
void |
removeTag(Tag tag)
Removes the specific tag
|
void |
setGridPosition(Rectangular pos)
Sets the position in the parent area grid for this area
|
void |
setGridX(int gridX) |
void |
setGridY(int gridY) |
void |
SetHorizontalSeparator(boolean hsep) |
void |
setName(java.lang.String name)
Sets the name of the area.
|
void |
setNextOnLine(Area nextOnLine) |
void |
setPreviousOnLine(Area previousOnLine) |
void |
SetVerticalSeparator(boolean vsep) |
java.lang.String |
toString() |
getBackgroundColor, getBorderCount, getBottomBorder, getBounds, getFontSize, getFontStyle, getFontWeight, getHeight, getId, getLeftBorder, getLineThrough, getPage, getRightBorder, getTopBorder, getUnderline, getWidth, getX1, getX2, getY1, getY2, hasBottomBorder, hasLeftBorder, hasRightBorder, hasTopBorder, isBackgroundSeparated, setBackgroundColor, setBackgroundSeparated, setBorders, setBottomBorder, setBounds, setFontSize, setFontStyle, setFontWeight, setId, setLeftBorder, setLineThrough, setPage, setRightBorder, setTopBorder, setUnderlineadd, addAttribute, getAttribute, getDepth, getChildAt, getChildCount, getChildren, getIndex, getLeafCount, getNextSiblingNode, getParent, getPreviousSiblingNode, getRoot, insert, isLeaf, isRoot, remove, remove, removeAllChildrenclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetBackgroundColor, getBorderCount, getBottomBorder, getBounds, getFontSize, getFontStyle, getFontWeight, getId, getLeftBorder, getLineThrough, getPage, getRightBorder, getTopBorder, getUnderline, hasBottomBorder, hasLeftBorder, hasRightBorder, hasTopBorder, isBackgroundSeparatedgetHeight, getWidth, getX1, getX2, getY1, getY2addAttribute, getAttribute, getDepth, getChildCount, getLeafCount, isLeaf, removeAllChildrenpublic DefaultArea(Rectangular r)
public DefaultArea(DefaultArea src)
public DefaultArea(int x1,
int y1,
int x2,
int y2)
public DefaultArea(Box box)
public DefaultArea(java.util.List<Box> boxList)
public void setName(java.lang.String name)
toString()name - The new area namepublic java.lang.String getName()
public Rectangular getContentBounds()
public AreaTopology getTopology()
AreagetTopology in interface Areaprotected AreaTopology createTopology()
public java.awt.Color getEffectiveBackgroundColor()
AreagetEffectiveBackgroundColor in interface Areapublic Area getParentArea()
AreaTreeNodegetParentArea in interface AreaTreeNode<Area>null when this is the root area.public Area getPreviousSibling()
AreaTreeNodegetPreviousSibling in interface AreaTreeNode<Area>null when this is the first child.public Area getNextSibling()
AreaTreeNodegetNextSibling in interface AreaTreeNode<Area>null when this is the last child.public Area getChildArea(int index) throws java.lang.ArrayIndexOutOfBoundsException
AreaTreeNodegetChildArea in interface AreaTreeNode<Area>index - the child indexjava.lang.ArrayIndexOutOfBoundsExceptionpublic java.util.List<Area> getChildAreas()
AreaTreeNodegetChildAreas in interface AreaTreeNode<Area>public int getIndex(Area child)
AreaTreeNodegetIndex in interface AreaTreeNode<Area>child - the child node to searchpublic void appendChild(Area child)
AreaTreeNodeappendChild in interface AreaTreeNode<Area>child - The new child to be appendedpublic void appendChildren(java.util.List<Area> list)
AreaTreeNodeappendChildren in interface AreaTreeNode<Area>list - The list of new children to be appendedpublic void insertChild(Area child, int index)
AreaTreeNodeinsertChild in interface AreaTreeNode<Area>child - the child to be insertedindex - the index of the new childpublic void removeChild(Area child)
AreaTreeNoderemoveChild in interface AreaTreeNode<Area>child - The new child to be appendedpublic Area getPreviousOnLine()
public void setPreviousOnLine(Area previousOnLine)
public Area getNextOnLine()
public void setNextOnLine(Area nextOnLine)
public java.lang.String getText()
Areapublic java.lang.String getText(java.lang.String separator)
Areapublic boolean isReplaced()
AreaisReplaced in interface Areatrue if the area contains replaced boxes onlyprotected void addBox(Box box)
box - public java.util.Vector<Box> getBoxes()
public java.util.Vector<Box> getAllBoxes()
getAllBoxes in interface Areapublic java.lang.String getBoxText()
public void createGrid()
public AreaGrid getGrid()
public int getGridHeight()
public int getGridWidth()
public int getGridX()
public void setGridX(int gridX)
gridX - The gridX to set.public int getGridY()
public void setGridY(int gridY)
gridY - The gridY to set.public Rectangular getGridPosition()
public void setGridPosition(Rectangular pos)
pos - the positionpublic DefaultArea getChildAtGridPos(int x, int y)
public void addTag(Tag tag, float support)
Taggablepublic boolean hasTag(Tag tag)
Taggablepublic boolean hasTag(Tag tag, float minSupport)
Taggablepublic float getTagSupport(Tag tag)
TaggablegetTagSupport in interface Taggabletag - The tag to be testedpublic Tag getMostSupportedTag()
TaggablegetMostSupportedTag in interface Taggablenull if there are no tags assigned to this areapublic void removeAllTags(java.util.Collection<Tag> c)
c - A collection of tags to be removed.public void removeTag(Tag tag)
public boolean containsTag(Tag tag)
tag - the tag to be tested.true if the area or its direct child areas have the given tagpublic java.util.Map<Tag,java.lang.Float> getTags()
public void SetHorizontalSeparator(boolean hsep)
public boolean isHorizontalSeparator()
AreaisHorizontalSeparator in interface Areatrue when this area is a horizontal separatorpublic void SetVerticalSeparator(boolean vsep)
public boolean isVerticalSeparator()
AreaisVerticalSeparator in interface Areatrue when this area is a vertical separatorpublic boolean isSeparator()
AreaisSeparator in interface Areatrue when this area is a separatorpublic Area createSuperArea(Rectangular gp, java.util.List<Area> selected, java.lang.String name)
AreacreateSuperArea in interface Areagp - the subarea boundsselected - nodes to be moved to the new areaname - the name (identification) of the new areapublic java.lang.String toString()
toString in class java.lang.Object