Class GridCell

    • Constructor Detail

      • GridCell

        public GridCell​(GridCellPos pos,
                        Content content,
                        GridCellType type,
                        GridCellAlignment align,
                        GridCellShowMode showMode,
                        Double brightness,
                        GridCellWidth width,
                        GridCellPadding padding,
                        String id)
        Create a cell of the grid.
        Parameters:
        pos - the upper left corner (0-based index)
        content - the cell content (may be null, if there is no content)
        type - header or not
        align - alignment
        showMode - show mode
        brightness - background brightness. 1 means white, 0 means black. null means: transparent.
        width - the width
        padding - padding
        id - id (used as postfix of CSS id)
    • Method Detail

      • getPos

        public GridCellPos getPos()
        Returns:
        the upper left corner (0-based index)
      • getContent

        public Content getContent()
        Returns:
        the content
      • getType

        public GridCellType getType()
        Returns:
        the type of the cell (header, normal).
      • getAlign

        public GridCellAlignment getAlign()
        Returns:
        the alignment of the cell (left, center, ...)
      • getDim

        public abstract GridCellDim getDim()
        Returns:
        the dimensions (width and height). Single cells always return (1,1).
      • colsSet

        public Set<Integer> colsSet​(IntPredicate filter)
        Parameters:
        filter - if null, nothing is filtered
        Returns:
        a set of integers with the range of columns spanned by this cell
      • hasColsPassing

        public boolean hasColsPassing​(IntPredicate filter)
        Parameters:
        filter - if null, nothing is filtered
        Returns:
        true, if this cell spans at least one column whose index passes the given filter. If filter is null, the answer is always true.
      • rowsSet

        public Set<Integer> rowsSet​(IntPredicate filter)
        Parameters:
        filter - if null, nothing is filtered
        Returns:
        a set of integers with the range of rows spanned by this cell
      • hasRowsPassing

        public boolean hasRowsPassing​(IntPredicate filter)
        Parameters:
        filter - if null, nothing is filtered
        Returns:
        true, if this cell spans at least one row whose index passes the given filter. If filter is null, the answer is always true.
      • hasColsInExcept

        public boolean hasColsInExcept​(Collection<Integer> inCollection,
                                       int except)
        Returns:
        true, if this cell spans at least one column whose index is contained in inCollection but is not equal to except.
      • hasRowsInExcept

        public boolean hasRowsInExcept​(Collection<Integer> inCollection,
                                       int except)
        Returns:
        true, if this cell spans at least one row whose index is contained in inCollection but is not equal to except.
      • getShowMode

        public GridCellShowMode getShowMode()
        Returns:
        the show mode of the cell (empty? defensive?)
      • getBrightness

        public Double getBrightness()
        Returns:
        the background brightness. 1 means white, 0 means black, null means transparent.
      • setBrightness

        public void setBrightness​(Double brightness)
        Set the background brightness
        Parameters:
        brightness - 1 means white, 0 means black, 0 means transparent.
      • getShrinkWidthMode

        public GridCellWidth getShrinkWidthMode()
        Returns:
        the width of the cell
      • setShrinkWidthMode

        public void setShrinkWidthMode​(GridCellWidth width)
        Set the width of the cell.
        Parameters:
        width - The new value.
      • getPadding

        public GridCellPadding getPadding()
        Returns:
        the padding of the cell
      • getId

        public String getId()
        Returns:
        the CSS id of the cell
      • setId

        public void setId​(String id)
        Set the id
        Parameters:
        id - id
      • forEach

        public abstract void forEach​(GridCell.PosProcessor p)
        Execute a method for each position
        Parameters:
        p - the processor