Class VisualBlock


  • public class VisualBlock
    extends Object
    An extracted visual block in the page.
    Author:
    Tomas Popela, burgetr
    • Constructor Detail

      • VisualBlock

        public VisualBlock()
    • 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
      • 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