Class Cell

    • Field Detail

      • DEFAULT_BORDER

        private static final Border DEFAULT_BORDER
      • row

        private int row
      • col

        private int col
      • rowspan

        private int rowspan
      • colspan

        private int colspan
    • Constructor Detail

      • Cell

        public Cell​(int rowspan,
                    int colspan)
        Creates a cell which takes a custom amount of cell spaces in the table.
        Parameters:
        rowspan - the number of rows this cell must occupy. Negative numbers will make the argument default to 1.
        colspan - the number of columns this cell must occupy. Negative numbers will make the argument default to 1.
      • Cell

        public Cell()
        Creates a cell.
    • Method Detail

      • getRow

        public int getRow()
        Gets the number of the row in which the cell is located.
        Returns:
        the row number
      • getRowspan

        public int getRowspan()
        Gets the rowspan of the cell.
        Returns:
        the rowspan
      • getColspan

        public int getColspan()
        Gets the colspan of the cell.
        Returns:
        the colspan
      • add

        public Cell add​(IBlockElement element)
        Adds any block element to the cell's contents.
        Parameters:
        element - a BlockElement
        Returns:
        this Element
      • add

        public Cell add​(Image element)
        Adds an image to the cell's contents.
        Parameters:
        element - an Image
        Returns:
        this Element
      • clone

        public Cell clone​(boolean includeContent)
        Clones a cell with its position, properties, and optionally its contents.
        Parameters:
        includeContent - whether or not to also include the contents of the cell.
        Returns:
        a clone of this Element
      • getDefaultProperty

        public <T1> T1 getDefaultProperty​(int property)
        Description copied from interface: IPropertyContainer
        Gets the default property from this entity.
        Specified by:
        getDefaultProperty in interface IPropertyContainer
        Overrides:
        getDefaultProperty in class BlockElement<Cell>
        Type Parameters:
        T1 - the return type associated with the property
        Parameters:
        property - the property to be retrieved
        Returns:
        the default property value. If the default property is not defined, null will be returned
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • updateCellIndexes

        protected Cell updateCellIndexes​(int row,
                                         int col,
                                         int numberOfColumns)
        Updates cell indexes.
        Parameters:
        row - the number of the row to update
        col - the number of the col to update
        numberOfColumns - to evaluate new colspan
        Returns:
        this Cell with updated fields