Class Cell

java.lang.Object
net.atthegate.server.service.pdf.Cell

public class Cell extends Object
Used to create table cell objects. See the Table class for more information.
  • Field Details

    • font

      protected Font font
    • fallbackFont

      protected Font fallbackFont
    • text

      protected String text
    • image

      protected Image image
    • point

      protected Point point
    • compositeTextLine

      protected CompositeTextLine compositeTextLine
    • ignoreImageHeight

      protected boolean ignoreImageHeight
    • width

      protected float width
    • top_padding

      protected float top_padding
    • bottom_padding

      protected float bottom_padding
    • left_padding

      protected float left_padding
    • right_padding

      protected float right_padding
    • lineWidth

      protected float lineWidth
  • Constructor Details

    • Cell

      public Cell(Font font)
      Creates a cell object and sets the font.
      Parameters:
      font - the font.
    • Cell

      public Cell(Font font, String text)
      Creates a cell object and sets the font and the cell text.
      Parameters:
      font - the font.
      text - the text.
    • Cell

      public Cell(Font font, Font fallbackFont, String text)
      Creates a cell object and sets the font, fallback font and the cell text.
      Parameters:
      font - the font.
      fallbackFont - the fallback font.
      text - the text.
  • Method Details

    • setFont

      public void setFont(Font font)
      Sets the font for this cell.
      Parameters:
      font - the font.
    • setFallbackFont

      public void setFallbackFont(Font fallbackFont)
      Sets the fallback font for this cell.
      Parameters:
      fallbackFont - the fallback font.
    • getFont

      public Font getFont()
      Returns the font used by this cell.
      Returns:
      the font.
    • getFallbackFont

      public Font getFallbackFont()
      Returns the fallback font used by this cell.
      Returns:
      the fallback font.
    • setText

      public void setText(String text)
      Sets the cell text.
      Parameters:
      text - the cell text.
    • getText

      public String getText()
      Returns the cell text.
      Returns:
      the cell text.
    • setImage

      public void setImage(Image image)
      Sets the image inside this cell.
      Parameters:
      image - the image.
    • getImage

      public Image getImage()
      Returns the cell image.
      Returns:
      the image.
    • setPoint

      public void setPoint(Point point)
      Sets the point inside this cell. See the Point class and Example_09 for more information.
      Parameters:
      point - the point.
    • getPoint

      public Point getPoint()
      Returns the cell point.
      Returns:
      the point.
    • setCompositeTextLine

      public void setCompositeTextLine(CompositeTextLine compositeTextLine)
      Sets the composite text object.
      Parameters:
      compositeTextLine - the composite text object.
    • getCompositeTextLine

      public CompositeTextLine getCompositeTextLine()
      Returns the composite text object.
      Returns:
      the composite text object.
    • setWidth

      public void setWidth(float width)
      Sets the width of this cell.
      Parameters:
      width - the specified width.
    • getWidth

      public float getWidth()
      Returns the cell width.
      Returns:
      the cell width.
    • setTopPadding

      public void setTopPadding(float padding)
      Sets the top padding of this cell.
      Parameters:
      padding - the top padding.
    • setBottomPadding

      public void setBottomPadding(float padding)
      Sets the bottom padding of this cell.
      Parameters:
      padding - the bottom padding.
    • setLeftPadding

      public void setLeftPadding(float padding)
      Sets the left padding of this cell.
      Parameters:
      padding - the left padding.
    • setRightPadding

      public void setRightPadding(float padding)
      Sets the right padding of this cell.
      Parameters:
      padding - the right padding.
    • setPadding

      public void setPadding(float padding)
      Sets the top, bottom, left and right paddings of this cell.
      Parameters:
      padding - the right padding.
    • getHeight

      public float getHeight()
      Returns the cell height.
      Returns:
      the cell height.
    • setLineWidth

      public void setLineWidth(float lineWidth)
      Sets the border line width.
      Parameters:
      lineWidth - the border line width.
    • getLineWidth

      public float getLineWidth()
      Returns the border line width.
      Returns:
      the border line width.
    • setBgColor

      public void setBgColor(int color)
      Sets the background to the specified color.
      Parameters:
      color - the color specified as 0xRRGGBB integer.
    • getBgColor

      public int getBgColor()
      Returns the background color of this cell.
    • setPenColor

      public void setPenColor(int color)
      Sets the pen color.
      Parameters:
      color - the color specified as 0xRRGGBB integer.
    • getPenColor

      public int getPenColor()
      Returns the pen color.
    • setBrushColor

      public void setBrushColor(int color)
      Sets the brush color.
      Parameters:
      color - the color specified as 0xRRGGBB integer.
    • getBrushColor

      public int getBrushColor()
      Returns the brush color.
      Returns:
      the brush color.
    • setFgColor

      public void setFgColor(int color)
      Sets the pen and brush colors to the specified color.
      Parameters:
      color - the color specified as 0xRRGGBB integer.
    • setProperties

      protected void setProperties(int properties)
    • getProperties

      protected int getProperties()
    • setColSpan

      public void setColSpan(int colspan)
      Sets the column span private variable.
      Parameters:
      colspan - the specified column span value.
    • getColSpan

      public int getColSpan()
      Returns the column span private variable value.
      Returns:
      the column span value.
    • setBorder

      public void setBorder(int border, boolean visible)
      Sets the cell border object.
      Parameters:
      border - the border object.
    • getBorder

      public boolean getBorder(int border)
      Returns the cell border object.
      Returns:
      the cell border object.
    • setNoBorders

      public void setNoBorders()
      Sets all border object parameters to false. This cell will have no borders when drawn on the page.
    • setTextAlignment

      public void setTextAlignment(int alignment)
      Sets the cell text alignment.
      Parameters:
      alignment - the alignment code. Supported values: Align.LEFT, Align.RIGHT and Align.CENTER.
    • getTextAlignment

      public int getTextAlignment()
      Returns the text alignment.
      Returns:
      the text horizontal alignment code.
    • setVerTextAlignment

      public void setVerTextAlignment(int alignment)
      Sets the cell text vertical alignment.
      Parameters:
      alignment - the alignment code. Supported values: Align.TOP, Align.CENTER and Align.BOTTOM.
    • getVerTextAlignment

      public int getVerTextAlignment()
      Returns the cell text vertical alignment.
      Returns:
      the vertical alignment code.
    • setUnderline

      public void setUnderline(boolean underline)
      Sets the underline text parameter. If the value of the underline variable is 'true' - the text is underlined.
      Parameters:
      underline - the underline text parameter.
    • getUnderline

      public boolean getUnderline()
      Returns the underline text parameter.
      Returns:
      the underline text parameter.
    • setStrikeout

      public void setStrikeout(boolean strikeout)
      Sets the strikeout text parameter.
      Parameters:
      strikeout - the strikeout text parameter.
    • getStrikeout

      public boolean getStrikeout()
      Returns the strikeout text parameter.
      Returns:
      the strikeout text parameter.
    • setURIAction

      public void setURIAction(String uri)
    • paint

      protected void paint(Page page, float x, float y, float w, float h) throws Exception
      Draws the point, text and borders of this cell.
      Throws:
      Exception
    • getNumVerCells

      public int getNumVerCells()
      Use this method to find out how many vertically stacked cell are needed after call to wrapAroundCellText.
      Returns:
      the number of vertical cells needed to wrap around the cell text.
    • getNumVerCells2

      public int getNumVerCells2()
      Use this method to find out how many vertically stacked cell are needed after call to wrapAroundCellText2.
      Returns:
      the number of vertical cells needed to wrap around the cell text.
    • setIgnoreImageHeight

      public void setIgnoreImageHeight(boolean ignoreImageHeight)
    • getIgnoreImageHeight

      public boolean getIgnoreImageHeight()