Interface SimpleElementContainer

All Known Subinterfaces:
ElementContainer
All Known Implementing Classes:
CrossTabDescriptionSection, Section

public interface SimpleElementContainer
The interface describes the methods to add some elements such as Text, Box, Line, FieldElement, Picture, JavaBean and DataBasePicture to the container.
Since:
9.1
  • Method Summary

    Modifier and Type
    Method
    Description
    addBox(int boxX, int boxY, int boxWidth, int boxHeight)
    Adds a new box to the container and returns it.
    addDatabasePicture(Field field, int pictureX, int pictureY, int pictureWidth, int pictureHeight)
    Adds a new DatabasePicture to the container and returns it.
    addFieldElement(Field field, int fieldX, int fieldY, int fieldWidth, int fieldHeight)
    Adds a new FieldElement (a dynamic text element based on a Field) to this container and returns it.
    addHorizontalLine(int xpos, int ypos, int objwidth)
    Adds a new horizontal line to the container and returns it.
    addJavaBean(String className, int xpos, int ypos, int objwidth, int objheight)
    Add a new JavaBean to the container.
    addPicture(int xpos, int ypos, int objwidth, int objheight, byte[] buffer)
    Adds a new picture element to the container and returns it.
    addPicture(int xpos, int ypos, int objwidth, int objheight, int[] buffer)
    Adds a new picture element to the container and returns it.
    addPicture(int xpos, int ypos, int objwidth, int objheight, BufferedImage im)
    Adds a new picture element to the container and returns it.
    addPicture(int xpos, int ypos, int objwidth, int objheight, File file)
    Adds a new picture element to the container and returns it.
    addPicture(int xpos, int ypos, int objwidth, int objheight, String fileName)
    Adds a new picture element to the container and returns it.
    addText(int xpos, int ypos, int objwidth, int objheight)
    Adds a new text element to the container.
    addVerticalLine(int xpos, int ypos, int length)
    Adds a new vertical line to the container and returns it.
    Returns an array containing all elements of this container.
    Deprecated.
    As of i-net Clear Reports 15.0, use getElements() instead
    Get a report Element.
    int
    Counts the number of Report Elements in this container and returns it.
    void
    Removes the given report element from the container.
  • Method Details

    • addBox

      Box addBox(int boxX, int boxY, int boxWidth, int boxHeight)
      Adds a new box to the container and returns it.
      Parameters:
      boxX - The horizontal offset in twips.
      boxY - The vertical offset in twips.
      boxWidth - The width of the box in twips.
      boxHeight - The height of the box in twips.
      Returns:
      The created box element or null if the creation was not successful
      Throws:
      IllegalArgumentException - If the parameter width or height are negative.
      Since:
      9.1
    • addDatabasePicture

      DatabasePicture addDatabasePicture(Field field, int pictureX, int pictureY, int pictureWidth, int pictureHeight)
      Adds a new DatabasePicture to the container and returns it.
      Parameters:
      field - Field which value type is Field.BINARY and that should be added to the container. This can be a database field, a formula field, a prompt field or a SQL field.
      pictureX - x-coordinate of the upper left corner in twips.
      pictureY - y-coordinate of the upper left corner in twips.
      pictureWidth - Width of the new fieldElement in twips.
      pictureHeight - Height of the new fieldElement in twips.
      Returns:
      new created DatabasePicture
      Since:
      9.1
    • addFieldElement

      FieldElement addFieldElement(Field field, int fieldX, int fieldY, int fieldWidth, int fieldHeight) throws ReportException
      Adds a new FieldElement (a dynamic text element based on a Field) to this container and returns it. Note that for binary fields you need to use the method addDatabasePicture(Field, int, int, int, int), since picture fields are not FieldElements.
      Parameters:
      field - The field that should added into container. May not be null.
      fieldX - The x-coordinate of the upper left corner in twips.
      fieldY - The y-coordinate of the upper left corner in twips.
      fieldWidth - The width of the new fieldElement in twips.
      fieldHeight - The height of the new fieldElement in twips.
      Returns:
      The created FieldElement or null if the creation was not successful.
      Throws:
      ReportException - if the value type of the field is binary - use addDatabasePicture(Field, int, int, int, int) instead.
      IllegalArgumentException - if the parameters x, y, width or height are negative
      NullPointerException - if the field is null
      Since:
      9.1
      See Also:
    • addJavaBean

      JavaBean addJavaBean(String className, int xpos, int ypos, int objwidth, int objheight) throws ReportException
      Add a new JavaBean to the container. The class of the Java Bean need to be extends form java.awt.Component.
      Parameters:
      className - The class name of the Java Bean.
      xpos - The x-coordinate of the upper left corner in twips.
      ypos - The y-coordinate of the upper left corner in twips.
      objwidth - The width of the new fieldElement in twips.
      objheight - The height of the new fieldElement in twips.
      Returns:
      The created JavaBean.
      Throws:
      IllegalArgumentException - if the parameters x, y, width or height are negative.
      ReportException - if the Java Bean cannot created.
      Since:
      6.0
    • addHorizontalLine

      Line addHorizontalLine(int xpos, int ypos, int objwidth)
      Adds a new horizontal line to the container and returns it.
      Parameters:
      xpos - the horizontal offset of the start point in twips.
      ypos - the vertical offset of the start point in twips.
      objwidth - the width of the line in twips.
      Returns:
      the created line element
      Throws:
      IllegalArgumentException - if some parameter is negative.
      Since:
      9.1
    • addVerticalLine

      Line addVerticalLine(int xpos, int ypos, int length)
      Adds a new vertical line to the container and returns it.
      Parameters:
      xpos - the horizontal offset of the start point in twips.
      ypos - the vertical offset of the start point in twips.
      length - the height of the line in twips.
      Returns:
      the created line element
      Throws:
      IllegalArgumentException - if the parameters x, y or height are negative
      Since:
      9.1
    • addPicture

      Picture addPicture(int xpos, int ypos, int objwidth, int objheight, BufferedImage im) throws ReportException
      Adds a new picture element to the container and returns it. If the width or height is -1 then the width and height from the loaded image will be used. Valid formats are GIF, JPG, PNG, BMP, WMF or EMF. Also PDF and HTML files can be added as image if the decoder is installed in the lib directory of i-net Clear Reports. If the width or height -1 then the width and height from the loaded image is used. The TYPE_INT_ARGB color model is supported only.
      Parameters:
      xpos - The horizontal offset of the start point in twips.
      ypos - The vertical offset of the start point in twips.
      objwidth - The width of the picture in twips.
      objheight - The height of the picture in twips.
      im - The image object.
      Returns:
      Picture The created report element.
      Throws:
      ReportException - ReportException will thrown if im is an unknown picture format.
      Since:
      9.1
      See Also:
    • addPicture

      Picture addPicture(int xpos, int ypos, int objwidth, int objheight, String fileName) throws ReportException
      Adds a new picture element to the container and returns it. If the width or height is -1 then the width and height from the loaded image will be used. Valid formats are GIF, JPG, PNG, BMP, WMF or EMF. Also PDF and HTML files can be added as image if the decoder is installed in the lib directory of i-net Clear Reports.
      Parameters:
      xpos - The horizontal offset of the start point in twips.
      ypos - The vertical offset of the start point in twips.
      objwidth - The width of the picture in twips
      objheight - The height of the picture in twips.
      fileName - The absolute or relative to working directory path to the image.
      Returns:
      Picture The created report element.
      Throws:
      ReportException - will thrown if file is an unknown picture format.
      Since:
      9.1
      See Also:
    • addPicture

      Picture addPicture(int xpos, int ypos, int objwidth, int objheight, byte[] buffer) throws ReportException
      Adds a new picture element to the container and returns it. If the width or height is -1 then the width and height from the loaded image will be used. Valid formats are GIF, JPG, PNG, BMP, WMF or EMF. Also PDF and HTML files can be added as image if the decoder is installed in the lib directory of i-net Clear Reports.
      Parameters:
      xpos - The horizontal offset of the start point in twips.
      ypos - The vertical offset of the start point in twips.
      objwidth - The width of the picture in twips.
      objheight - The height of the picture in twips.
      buffer - A byte[] with image header and data.
      Returns:
      Picture The created report element.
      Throws:
      ReportException - ReportException will thrown if buffer is an unknown picture format.
      ReportException - if buffer is an unknown picture format.
      Since:
      9.1
      See Also:
    • addPicture

      Picture addPicture(int xpos, int ypos, int objwidth, int objheight, File file) throws ReportException
      Adds a new picture element to the container and returns it. If the width or height is -1 then the width and height from the loaded image will be used. Valid formats are GIF, JPG, PNG, BMP, WMF or EMF. Also PDF and HTML files can be added as image if the decoder is installed in the lib directory of i-net Clear Reports.
      Parameters:
      xpos - The horizontal offset of the start point in twips.
      ypos - The vertical offset of the start point in twips.
      objwidth - The width of the picture in twips.
      objheight - The height of the picture in twips.
      file - The file object to the image.
      Returns:
      Picture The created report element.
      Throws:
      ReportException - will thrown if file is an unknown picture format.
      Since:
      9.1
      See Also:
    • addPicture

      Picture addPicture(int xpos, int ypos, int objwidth, int objheight, int[] buffer) throws ReportException
      Adds a new picture element to the container and returns it. If the width or height is -1 then the width and height from the loaded image will be used. Valid formats are GIF, JPG, PNG, BMP, WMF or EMF. Also PDF and HTML files can be added as image if the decoder is installed in the lib directory of i-net Clear Reports.
      Parameters:
      xpos - The horizontal offset of the start point in twips.
      ypos - The vertical offset of the start point in twips.
      objwidth - The width of the picture in twips.
      objheight - The height of the picture in twips.
      buffer - A int[] with image header and data.
      Returns:
      Picture The created report element.
      Throws:
      ReportException - ReportException will thrown if buffer is an unknown picture format.
      Since:
      9.1
      See Also:
    • addText

      Text addText(int xpos, int ypos, int objwidth, int objheight) throws IllegalArgumentException
      Adds a new text element to the container. To fill a new line into this text element use addParagraph method. The returned text element is empty, that means it contains no paragraph object.
      Parameters:
      xpos - the x offset of the text element
      ypos - the y offset of the text element
      objwidth - the width of the text element
      objheight - the height of the text element
      Returns:
      the created text element.
      Throws:
      IllegalArgumentException - if the parameters x, y, width or height are negative
      Since:
      9.1
    • getElements

      Element[] getElements()
      Returns an array containing all elements of this container. Each field of the array contains an instance of class Element or an instance of Elements subclass.
      Returns:
      An array containing all elements in this container.
      Since:
      9.1
      See Also:
    • getElementsV

      @Deprecated Vector<Element> getElementsV()
      Deprecated.
      As of i-net Clear Reports 15.0, use getElements() instead
      Returns a Vector containing all elements in this container. Each element in the returned Vector is an instance of the class Element or an instance of Element's subclass.
      Returns:
      A Vector containing all elements in this container.
      Since:
      9.1
      See Also:
    • getReportElement

      Element getReportElement(int idx)
      Get a report Element. You can specify the returned Element with the idx parameter.
      Parameters:
      idx - The 0-based index of the element, which should be returned.
      Returns:
      in instance of some subclass of Element.
      Since:
      9.1
    • getReportElementsCount

      int getReportElementsCount()
      Counts the number of Report Elements in this container and returns it.
      Returns:
      The number of report elements in this container.
      Since:
      9.1
    • remove

      void remove(Element elem)
      Removes the given report element from the container.
      Parameters:
      elem - The Report Element which should be removed from the container (null is not permitted).
      Throws:
      IllegalArgumentException - if the parameter elem is null.
      Since:
      9.1