Class Picture

All Implemented Interfaces:
BorderProperties, GeneralProperties, HyperlinkProperties, NodeParser, PictureProperties, com.inet.report.ReferenceHolder, Serializable, Cloneable

public class Picture extends AbstractPictureElement
This class represent a static picture. For example you can set a special logo at runtime on all of your reports. To add a picture to your report use method Section.addPicture(int, int, int, int, java.awt.image.BufferedImage) in class Section and give size, position and the filename of the picture.

This class is part of the RDC.
See Also:
  • Method Details

    • copy

      public Object copy() throws ReportException
      Creates a serializable copy of this Element. The returned Object is not an instance of Element. This method is used from i-net Designer for Copy and Paste.
      Overrides:
      copy in class Element
      Returns:
      A serializable Object.
      Throws:
      ReportException - If accessing properties of this Element causes any errors.
      See Also:
    • getWidthRenderingFactor

      public double getWidthRenderingFactor()
      Gets the property 'width rendering factor'. While 'width scaling factor' is a user defined faction this rendering factor includes the user factor and the image resolution if available. Otherwise it is equal to width scaling factor
      Returns:
      The value of the property 'width scaling factor'. I.e. 0.1 means 10%, 5.0 means 500%.
    • getHeightRenderingFactor

      public double getHeightRenderingFactor()
      Gets the property 'height rendering factor'. While 'height scaling factor' is a user defined factor, this rendering factor includes the user factor and the image resolution if available. Otherwise it is equal to height scaling factor.
      Returns:
      The value of the property 'height scaling factor'. I.e. 0.1 means 10%, 5.0 means 500%.
    • setImageLocationFormula

      public void setImageLocationFormula(FormulaField newFormula)
      Use this formula to exchange the source of the image dynamically at runtime. The formula should return an url which specifies the image location of the replacing image. If the url doesnt point to a valid image file the original image wont be replaced.
      Parameters:
      newFormula - A string formula which represents the image URL of the replacing image.
      Since:
      6.0
    • getImageLocationFormula

      public FormulaField getImageLocationFormula()
      Returns the formula for the "image location" property
      Returns:
      Formula field for the "image location" property
      Since:
      6.0
      See Also:
    • getImage

      public Image getImage()
      Returns the java.awt.Image of this picture element.
      Returns:
      The java.awt.Image of this picture element.
      Since:
      6.0
    • parseElement

      public NodeParser parseElement(com.inet.report.parser.XMLTag group, String tag, Attributes atts, Map<String,Object> parserMap) throws FatalParserException
      FOR INTERNAL USE ONLY FOR INTERNAL USE ONLY FOR INTERNAL USE ONLY Internal method for reading report XML

      Parses an XML node with the given information, and returns either a sub-element which was created as a result, or null if no sub-element was created, i.e. the information was applied to the ReportComponent itself. Note that the parsing is highly tolerant, i.e. exceptions are intercepted and suppressed if at all possible.

      Specified by:
      parseElement in interface NodeParser
      Overrides:
      parseElement in class Element
      Parameters:
      group - XMLTag of the current node to be parsed, or null if there is no such current group. An XMLTag is a group of nodes bundled together, usually it is a Properties node such as CommonProperties, BorderProperties, etc.
      tag - The XMLTag to be parsed
      atts - The set of attributes in the current XMLTag
      parserMap - The map of current Parser.
      Returns:
      The NodeParser sub-element if one needed to be created, or null if none was created.
      Throws:
      FatalParserException - if an exception occurs which causes the report to not be able to be read: causes the abortion of the reading of the report.
    • parseText

      public void parseText(String textData, Map<String,Object> parserMap)
      FOR INTERNAL USE ONLY FOR INTERNAL USE ONLY FOR INTERNAL USE ONLY Internal method for reading report XML

      This method is called if text was encountered in the context of this node. (Examples would be a formula's text or a text element's text)

      Specified by:
      parseText in interface NodeParser
      Overrides:
      parseText in class Element
      Parameters:
      textData - text encountered and to be stored
      parserMap - The map of current Parser.
    • parseEndElement

      public void parseEndElement(com.inet.report.parser.XMLTag group, String tag, Map<String,Object> parserMap) throws FatalParserException
      FOR INTERNAL USE ONLY FOR INTERNAL USE ONLY Internal method for reading report XML

      Receive notification of the end of an XML tag.

      Specified by:
      parseEndElement in interface NodeParser
      Overrides:
      parseEndElement in class ReportComponent
      Parameters:
      group - XMLTag of the current node to be parsed, or null if there is no such current group.
      tag - The XMLTag to be parsed
      parserMap - The map of current Parser.
      Throws:
      FatalParserException - if an exception occurs which causes the report to not be able to be read: causes the abortion of the reading of the report.
    • createPictureMetaData

      public com.inet.report.encode.PictureMetaData createPictureMetaData()
      Creates a meta data instance for this picture.
      Returns:
      the created meta data instance or null if no meta data can be retrieved (e.g. when picture data is missing or the data format is unknown)
    • getSubComponents

      public List<? extends ReportComponent> getSubComponents()
      Returns all ReportComponents that are descendants of this one. E.G. this will return all Element of a Section. But it's as well useful for CrossTabs or Text elements which have additional elements.
      Specified by:
      getSubComponents in class ReportComponent
      Returns:
      a list with all sub components which can be empty as well; will be null if the component has no descendants