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 voidaddChild(VisualBlock child)Adds new child to blocks childrenStringgetBgColor()Gets background color of elementRectangulargetBounds()Gets the visual bounds of the block.BoxgetBox()Gets Box corresponding to the blockintgetDoC()Returns block's degree of coherence DoCintgetFontSize()Gets block's font sizeStringgetFontWeight()Gets block's font weightList<VisualBlock>getChildren()Gets all blocks childrenVisualBlockgetRoot()booleanisAlreadyDivided()Checks if node was already dividedbooleanisDividable()Checks if block is dividablebooleanisVisualBlock()Checks if block is visual blockvoidreset()Resets the block parametres to consider the block again.voidsetAlreadyDivided(boolean alreadyDivided)Sets if block was dividedvoidsetBox(Box box)Sets block corresponding BoxvoidsetDoC(int doC)Sets block;s degree of coherencevoidsetIsDividable(boolean isDividable)Sets dividability of blockvoidsetIsVisualBlock(boolean isVisualBlock)Sets block as visual blockvoidsetRoot(VisualBlock root)StringtoString()
-
-
-
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
-
-