Package cz.vutbr.fit.layout.vips.impl
Class VisualBlock
- java.lang.Object
-
- cz.vutbr.fit.layout.vips.impl.VisualBlock
-
public class VisualBlock extends Object
An extracted visual block in the page.- Author:
- Tomas Popela, burgetr
-
-
Constructor Summary
Constructors Constructor Description VisualBlock()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addChild(VisualBlock child)
Adds new child to blocks childrenString
getBgColor()
Gets background color of elementRectangular
getBounds()
Gets the visual bounds of the block.Box
getBox()
Gets Box corresponding to the blockint
getDoC()
Returns block's degree of coherence DoCint
getFontSize()
Gets block's font sizeString
getFontWeight()
Gets block's font weightList<VisualBlock>
getChildren()
Gets all blocks childrenVisualBlock
getRoot()
boolean
isAlreadyDivided()
Checks if node was already dividedboolean
isDividable()
Checks if block is dividableboolean
isVisualBlock()
Checks if block is visual blockvoid
reset()
Resets the block parametres to consider the block again.void
setAlreadyDivided(boolean alreadyDivided)
Sets if block was dividedvoid
setBox(Box box)
Sets block corresponding Boxvoid
setDoC(int doC)
Sets block;s degree of coherencevoid
setIsDividable(boolean isDividable)
Sets dividability of blockvoid
setIsVisualBlock(boolean isVisualBlock)
Sets block as visual blockvoid
setRoot(VisualBlock root)
String
toString()
-
-
-
Method Detail
-
reset
public void reset()
Resets the block parametres to consider the block again.
-
setIsVisualBlock
public void setIsVisualBlock(boolean isVisualBlock)
Sets block as visual block- Parameters:
isVisualBlock
- Value
-
isVisualBlock
public boolean isVisualBlock()
Checks if block is visual block- Returns:
- True if block if visual block, otherwise false
-
addChild
public void addChild(VisualBlock child)
Adds new child to blocks children- Parameters:
child
- New child
-
getChildren
public List<VisualBlock> getChildren()
Gets all blocks children- Returns:
- List of children
-
getRoot
public VisualBlock getRoot()
-
setRoot
public void setRoot(VisualBlock root)
-
setBox
public void setBox(Box box)
Sets block corresponding Box- Parameters:
box
- Box
-
getBox
public Box getBox()
Gets Box corresponding to the block- Returns:
- Box
-
getDoC
public int getDoC()
Returns block's degree of coherence DoC- Returns:
- Degree of coherence
-
setDoC
public void setDoC(int doC)
Sets block;s degree of coherence- Parameters:
doC
- Degree of coherence
-
isDividable
public boolean isDividable()
Checks if block is dividable- Returns:
- True if is dividable, otherwise false
-
setIsDividable
public void setIsDividable(boolean isDividable)
Sets dividability of block- Parameters:
isDividable
- True if is dividable otherwise false
-
isAlreadyDivided
public boolean isAlreadyDivided()
Checks if node was already divided- Returns:
- True if was divided, otherwise false
-
setAlreadyDivided
public void setAlreadyDivided(boolean alreadyDivided)
Sets if block was divided- Parameters:
alreadyDivided
- True if block was divided, otherwise false
-
getBounds
public Rectangular getBounds()
Gets the visual bounds of the block.- Returns:
- the visual bounds
-
getBgColor
public String getBgColor()
Gets background color of element- Returns:
- Background color
-
getFontSize
public int getFontSize()
Gets block's font size- Returns:
- Font size
-
getFontWeight
public String getFontWeight()
Gets block's font weight- Returns:
- Font weight
-
-