public class AreaImpl
extends org.fit.layout.impl.DefaultArea
implements org.fit.layout.model.Area
| Constructor and Description |
|---|
AreaImpl(AreaImpl src)
Creates a copy of another area.
|
AreaImpl(org.fit.layout.model.Box box)
Creates an area from a single box.
|
AreaImpl(int x1,
int y1,
int x2,
int y2)
Creates an empty area of a given size
|
AreaImpl(List<org.fit.layout.model.Box> boxList)
Creates an area from a a list of boxes.
|
AreaImpl(org.fit.layout.model.Rectangular r)
Creates an empty area of a given size
|
| Modifier and Type | Method and Description |
|---|---|
void |
addBox(org.fit.layout.model.Box box)
Adds a new box to the area and updates the area bounds.
|
void |
appendChild(org.fit.layout.model.Area child) |
void |
appendChildren(List<org.fit.layout.model.Area> list) |
boolean |
contains(int x,
int y) |
boolean |
containsText() |
org.fit.layout.model.Area |
copy() |
void |
createSeparators()
Creates a set of the horizontal and vertical separators
|
org.fit.layout.model.Area |
createSuperArea(org.fit.layout.model.Rectangular gp,
List<org.fit.layout.model.Area> selected,
String name) |
boolean |
encloses(AreaImpl other) |
AreaImpl |
findContentAbove(Separator sep)
Looks for the nearest text box area placed above the separator.
|
String |
getBoxText()
Returns the text string represented by a concatenation of all
the boxes contained directly in this area (no subareas)
|
float |
getColorLuminosity()
Computes the average luminosity of the boxes in the area
|
float |
getDeclaredFontSize()
Returns the font size declared for the first box.
|
Color |
getEffectiveBackgroundColor() |
float |
getFontSize()
Computes the average font size of the boxes in the area
|
float |
getFontStyle()
Computes the average font style of the boxes in the area
|
float |
getFontWeight()
Computes the average font weight of the boxes in the area
|
List<org.fit.layout.model.Area> |
getChildNodesInside(org.fit.layout.model.Rectangular r)
Returns the child areas whose absolute coordinates intersect with the specified rectangle.
|
int |
getLevel() |
float |
getLineThrough() |
org.fit.layout.model.ContentObject |
getReplacedContent() |
SeparatorSet |
getSeparators() |
AreaStyle |
getStyle()
Obtains the overall style of the area.
|
String |
getText() |
int |
getTextLength()
Returns the text string represented by a concatenation of all
the boxes contained directly in this area.
|
float |
getUnderline() |
boolean |
hasContent() |
boolean |
hasSameBackground(AreaImpl other)
Checks if this area has the same background color as another area
|
boolean |
hasSameStyle(AreaImpl other)
Compares two areas and decides whether they have the same style.
|
void |
chooseBox(org.fit.layout.model.Box node)
Add the box node to the area if its bounds are inside of the area bounds.
|
boolean |
isAreaEmpty(org.fit.layout.model.Rectangular r)
Check if there are some children in the given subarea of the area.
|
boolean |
isExplicitlySeparated()
When set to true, the area is considered to be separated from other
areas explicitly, i.e. independently on its real borders or background.
|
boolean |
isHorizontalSeparator()
Tries to guess if this area acts as a horizontal separator.
|
boolean |
isReplaced() |
boolean |
isVerticalSeparator()
Tries to guess if this area acts as a vertical separator.
|
void |
join(AreaImpl other,
boolean horizontal)
Joins another area to this area.
|
void |
joinArea(AreaImpl other,
org.fit.layout.model.Rectangular pos,
boolean horizontal)
Joins this area with another area and updates the layout in the grid to the given values.
|
void |
joinChild(AreaImpl other)
Joins a child area to this area.
|
void |
removeAllChildren() |
void |
removeSimpleSeparators()
Removes simple separators from current separator set.
|
protected void |
resetAverages()
Resets the averages to the values obtained from the text boxes
that belong to this area only.
|
boolean |
separatedDown() |
boolean |
separatedLeft() |
boolean |
separatedRight() |
boolean |
separatedUp() |
void |
setLevel(int level) |
void |
setSeparated(boolean separated)
When set to true, the area is considered to be separated from other
areas explicitly, i.e. independently on its real borders or background.
|
String |
toString() |
void |
updateAverages(org.fit.layout.model.Area other)
Updates the average values when a new area is added or joined
|
addTag, containsTag, createGrid, createTopology, getAllBoxes, getAreaTree, getBoxDescription, getBoxes, getContentBounds, getGrid, getGridHeight, getGridPosition, getGridWidth, getGridX, getGridY, getChildArea, getChildAreas, getChildAtGridPos, getIndex, getMostSupportedTag, getName, getNextOnLine, getNextSibling, getParentArea, getPreviousOnLine, getPreviousSibling, getSupportedTags, getTags, getTagSupport, getText, getTopology, hasTag, hasTag, insertChild, insertParent, isAncestorOf, isSeparator, move, removeAllTags, removeBox, removeBoxes, removeChild, removeTag, setAreaTree, setGridPosition, setGridX, setGridY, SetHorizontalSeparator, setName, setNextOnLine, setPreviousOnLine, SetVerticalSeparator, updateTopologiesequals, getBackgroundColor, getBorderCount, getBorderStyle, getBottomBorder, getBounds, getHeight, getId, getLeftBorder, getPage, getRightBorder, getTopBorder, 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, removeclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetAllBoxes, getAreaTree, getBoxes, getName, getText, getTopology, insertParent, isSeparator, setName, updateTopologiesgetBackgroundColor, getBorderCount, getBorderStyle, getBottomBorder, getBounds, getId, getLeftBorder, getPage, getRightBorder, getTopBorder, hasBottomBorder, hasLeftBorder, hasRightBorder, hasTopBorder, isBackgroundSeparatedgetHeight, getWidth, getX1, getX2, getY1, getY2, movepublic AreaImpl(int x1,
int y1,
int x2,
int y2)
public AreaImpl(org.fit.layout.model.Rectangular r)
public AreaImpl(org.fit.layout.model.Box box)
box - The source box that will be contained in this areapublic AreaImpl(List<org.fit.layout.model.Box> boxList)
boxList - The source boxes that will be contained in this areapublic AreaImpl(AreaImpl src)
src - The source areapublic void appendChild(org.fit.layout.model.Area child)
appendChild in interface org.fit.layout.model.AreaTreeNode<org.fit.layout.model.Area>appendChild in class org.fit.layout.impl.DefaultAreapublic void appendChildren(List<org.fit.layout.model.Area> list)
appendChildren in interface org.fit.layout.model.AreaTreeNode<org.fit.layout.model.Area>appendChildren in class org.fit.layout.impl.DefaultAreapublic void removeAllChildren()
removeAllChildren in interface org.fit.layout.model.AreaTreeNode<org.fit.layout.model.Area>removeAllChildren in class org.fit.layout.impl.GenericTreeNodepublic void joinArea(AreaImpl other, org.fit.layout.model.Rectangular pos, boolean horizontal)
other - The area to be joined to this areapos - The position of the result in the gridhorizontal - Horizontal or vertical join?public void join(AreaImpl other, boolean horizontal)
other - The area to be joined to this area.horizontal - If true, the areas are joined horizontally.
This influences the resulting area borders. If false, the areas are joined vertically.public void joinChild(AreaImpl other)
other - The child area to be joined to this area.public int getLevel()
public void setLevel(int level)
public String toString()
toString in class org.fit.layout.impl.DefaultAreapublic void chooseBox(org.fit.layout.model.Box node)
node - The box node to be addedpublic boolean hasSameBackground(AreaImpl other)
other - the other areapublic boolean encloses(AreaImpl other)
public boolean contains(int x,
int y)
public boolean hasContent()
public Color getEffectiveBackgroundColor()
getEffectiveBackgroundColor in interface org.fit.layout.model.AreagetEffectiveBackgroundColor in class org.fit.layout.impl.DefaultAreapublic boolean containsText()
public boolean isReplaced()
isReplaced in interface org.fit.layout.model.AreaisReplaced in class org.fit.layout.impl.DefaultAreapublic String getBoxText()
getBoxText in class org.fit.layout.impl.DefaultAreapublic int getTextLength()
public org.fit.layout.model.ContentObject getReplacedContent()
public boolean isHorizontalSeparator()
isHorizontalSeparator in interface org.fit.layout.model.AreaisHorizontalSeparator in class org.fit.layout.impl.DefaultAreapublic boolean isVerticalSeparator()
isVerticalSeparator in interface org.fit.layout.model.AreaisVerticalSeparator in class org.fit.layout.impl.DefaultAreapublic org.fit.layout.model.Area createSuperArea(org.fit.layout.model.Rectangular gp,
List<org.fit.layout.model.Area> selected,
String name)
createSuperArea in interface org.fit.layout.model.AreacreateSuperArea in class org.fit.layout.impl.DefaultAreapublic org.fit.layout.model.Area copy()
copy in interface org.fit.layout.model.Areacopy in class org.fit.layout.impl.DefaultAreapublic float getDeclaredFontSize()
public float getFontSize()
getFontSize in interface org.fit.layout.model.ContentRectgetFontSize in class org.fit.layout.impl.DefaultContentRectpublic float getFontWeight()
getFontWeight in interface org.fit.layout.model.ContentRectgetFontWeight in class org.fit.layout.impl.DefaultContentRectpublic float getFontStyle()
getFontStyle in interface org.fit.layout.model.ContentRectgetFontStyle in class org.fit.layout.impl.DefaultContentRectpublic float getUnderline()
getUnderline in interface org.fit.layout.model.ContentRectgetUnderline in class org.fit.layout.impl.DefaultContentRectpublic float getLineThrough()
getLineThrough in interface org.fit.layout.model.ContentRectgetLineThrough in class org.fit.layout.impl.DefaultContentRectpublic float getColorLuminosity()
public void updateAverages(org.fit.layout.model.Area other)
other - the other areaprotected void resetAverages()
public String getText()
getText in interface org.fit.layout.model.AreagetText in class org.fit.layout.impl.DefaultAreapublic List<org.fit.layout.model.Area> getChildNodesInside(org.fit.layout.model.Rectangular r)
public boolean isAreaEmpty(org.fit.layout.model.Rectangular r)
public void createSeparators()
public SeparatorSet getSeparators()
public void removeSimpleSeparators()
public AreaImpl findContentAbove(Separator sep)
sep - the separatornull if there is nothing above the separatorpublic void addBox(org.fit.layout.model.Box box)
addBox in class org.fit.layout.impl.DefaultAreabox - the new box to addpublic boolean separatedDown()
true if the area is separated from the areas below itpublic boolean separatedUp()
true if the area is separated from the areas above itpublic boolean separatedLeft()
true if the area is separated from the areas on the leftpublic boolean separatedRight()
true if the area is separated from the areas on the rightpublic boolean isExplicitlySeparated()
true, if the area is explicitly separatedpublic void setSeparated(boolean separated)
separated - true, if the area should be explicitly separatedpublic AreaStyle getStyle()
Copyright © 2016. All rights reserved.