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(List<Box> boxList) |
DefaultArea(Rectangular r) |
| Modifier and Type | Method and Description |
|---|---|
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(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.
|
Area |
copy()
Creates a copy of the area and makes it a next sibling of the source area.
|
void |
createGrid()
Creates the grid of areas from the child areas.
|
Area |
createSuperArea(Rectangular gp,
List<Area> selected,
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.
|
Vector<Box> |
getAllBoxes()
Obtains all the boxes from this area and all the child areas.
|
AreaTree |
getAreaTree()
Obtains the tree the node belongs to.
|
protected String |
getBoxDescription(Box box)
Obtains a box description used as the default area name when the area
is created from a box.
|
Vector<Box> |
getBoxes()
Returns a vector of boxes that are inside of this area
|
String |
getBoxText()
Returns the text string represented by a concatenation of all
the boxes contained directly in this area (no subareas)
|
Rectangular |
getContentBounds() |
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.
|
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.
|
String |
getName()
Obtains the area name.
|
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.
|
Set<Tag> |
getSupportedTags(float minSupport)
Obtains all the tags with the support greater or equal to the specified value.
|
Map<Tag,Float> |
getTags()
Obtains the set of tags assigned to the area.
|
float |
getTagSupport(Tag tag)
Obtains the support of the given tag assignment
|
String |
getText()
Returns the complete text contained in this area and its sub area.
|
String |
getText(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.
|
void |
insertParent(Area newParent,
Area child)
Inserts a new area as a new parent of the given child area.
|
boolean |
isAncestorOf(Area other)
Check whether this area is an ancestor of another area.
|
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 |
move(int xofs,
int yofs) |
void |
removeAllTags(Collection<Tag> c)
Removes all tags that belong to the given collection.
|
void |
removeBox(Box box)
Removes the given box from the given area.
|
void |
removeBoxes(Collection<Box> box)
Removes the given boxes from the given area.
|
void |
removeChild(Area child)
Removes a child area from its parent.
|
void |
removeTag(Tag tag)
Removes the specific tag
|
void |
setAreaTree(AreaTree areaTree) |
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(String name)
Sets the name of the area.
|
void |
setNextOnLine(Area nextOnLine) |
void |
setPreviousOnLine(Area previousOnLine) |
void |
SetVerticalSeparator(boolean vsep) |
String |
toString() |
void |
updateTopologies()
Updates the topologies of the child areas.
|
equals, getBackgroundColor, getBorderCount, getBorderStyle, getBottomBorder, getBounds, getFontSize, getFontStyle, getFontWeight, getHeight, getId, getLeftBorder, getLineThrough, getPage, getRightBorder, getTopBorder, getUnderline, getWidth, getX1, getX2, getY1, getY2, 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, waitgetBackgroundColor, getBorderCount, getBorderStyle, getBottomBorder, getBounds, getFontSize, getFontStyle, getFontWeight, getId, getLeftBorder, getLineThrough, getPage, getRightBorder, getTopBorder, getUnderline, hasBottomBorder, hasLeftBorder, hasRightBorder, hasTopBorder, isBackgroundSeparatedgetHeight, getWidth, getX1, getX2, getY1, getY2addUserAttribute, getDepth, getChildCount, getLeafCount, getUserAttribute, isLeaf, removeAllChildrenpublic DefaultArea(Rectangular r)
public DefaultArea(DefaultArea src)
public DefaultArea(int x1,
int y1,
int x2,
int y2)
public DefaultArea(Box box)
public void setName(String name)
toString()public String getName()
AreagetName in interface AreaArea.setName(String) or a default name when nothing has been previously set.public AreaTree getAreaTree()
AreagetAreaTree in interface Areanull when the node does not form part of any tree.public void setAreaTree(AreaTree areaTree)
public Rectangular getContentBounds()
public void move(int xofs,
int yofs)
move in interface Rectmove in class DefaultContentRectpublic AreaTopology getTopology()
AreagetTopology in interface Areapublic void updateTopologies()
AreaupdateTopologies in interface Areaprotected AreaTopology createTopology()
public 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 ArrayIndexOutOfBoundsException
AreaTreeNodegetChildArea in interface AreaTreeNode<Area>index - the child indexArrayIndexOutOfBoundsExceptionpublic 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(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 String getText()
Areapublic String getText(String separator)
Areapublic boolean isReplaced()
AreaisReplaced in interface Areatrue if the area contains replaced boxes onlypublic boolean isAncestorOf(Area other)
AreaTreeNodeisAncestorOf in interface AreaTreeNode<Area>other - the other areatrue when this area is an ancestor of the other area.public void addBox(Box box)
box - public Vector<Box> getAllBoxes()
getAllBoxes in interface Areapublic String getBoxText()
public void removeBox(Box box)
box - the box to be removedpublic void removeBoxes(Collection<Box> box)
box - the collection of boxes to be removedpublic 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 Set<Tag> getSupportedTags(float minSupport)
TaggablegetSupportedTags in interface TaggableminSupport - minimal required supportpublic 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(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 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, List<Area> selected, String name)
AreacreateSuperArea in interface Areagp - the subarea boundsselected - nodes to be moved to the new areaname - the name (identification) of the new areapublic void insertParent(Area newParent, Area child)
AreainsertParent in interface AreanewParent - the new parent area (replacement)child - the child area that should be replacedpublic Area copy()
AreaCopyright © 2016. All rights reserved.