Class ReportImage

All Implemented Interfaces:
Serializable, quadbase.common.util.internal.IReportImage
Direct Known Subclasses:
ReportChartObject, ReportGrid, ReportLine

public class ReportImage extends ReportCell implements quadbase.common.util.internal.IReportImage, Serializable
This class can be used to insert images anywhere in the Report--in the ReportSection, or ReportTable.
See Also:
  • Field Details

    • DBImageDir

      public static final String DBImageDir
      See Also:
    • XMLTAG

      public static final String XMLTAG
      See Also:
    • CENTER

      public static final int CENTER
      This constant is only used for the background image. It specifies the background image to display once in the center of each page. This is the default.
      See Also:
    • FIT

      public static final int FIT
      This constant is only used for the background image. It specifies the background image to be resized to fit the entire page.
      See Also:
    • TILE

      public static final int TILE
      This constant is only used for the background image. It specifies the background image to tile to fill the entire page.
      See Also:
  • Constructor Details

    • ReportImage

      public ReportImage()
      Constructs a ReportImage with no label
    • ReportImage

      public ReportImage(String name)
      Constructs a ReportImage with the specified label
      Parameters:
      name - name of the new ReportImage object
  • Method Details

    • copy

      public void copy(ReportImage _cell)
      Specifies this ReportImage to be the same as "_cell"
      Parameters:
      _cell - the ReportImage object being emulated
    • deepCopy

      public void deepCopy(ReportImage _cell)
      internal use only
    • copyTemplate

      public void copyTemplate(ReportImage _cell)
      For internal use only.
    • applyTemplate

      public void applyTemplate(ReportImage _cell)
      Specifies the look invalid input: '&' feel to be the same as another ReportImage object.
      Parameters:
      _cell - the ReportImage object being emulated
    • applyTemplate

      public void applyTemplate(ReportImage _cell, boolean applyScript)
      Specifies the look invalid input: '&' feel to be the same as another ReportImage object.
      Parameters:
      applyScript - If true, the script text of the object will also be applied.
    • equals

      public boolean equals(ReportImage _cell)
      internal use only Checks if this ReportImage object's properties are the same as "_cell"
      Parameters:
      _cell - the ReportImage object being compared to
    • getImageType

      public int getImageType()
      Gets the image format of this image (GIF, PNG, JPEG, etc...) See IExportConstants for possible returned values.
    • setImageType

      public void setImageType(int type)
      Sets the image format of this image (GIF, PNG, JPEG, etc...) See IExportConstants for possible parameter values.
      Default is JPEG.
    • getPdfImageType

      public int getPdfImageType()
      Gets the image format of this image (GIF, PNG, JPEG, etc...) when the report is exported as a PDF file. See IExportConstants for possible returned values.
    • setPdfImageType

      public void setPdfImageType(int type)
      Sets the image format of this image (GIF, PNG, JPEG, etc...) when the report is exported as a PDF file. See IExportConstants for possible parameter values.
      Default is PNG
    • getJPEGQuality

      public int getJPEGQuality()
      Since JPEG uses compression, which decimates the quality of the image, this method gets the JPEG quality index, default is 99. best quality (99) >= jpegQuality => (1) worse quality
    • setJPEGQuality

      public void setJPEGQuality(int q)
      Since JPEG uses compression, which decimates the quality of the image, this method sets the JPEG quality index, default is 99. best quality (99) >= jpegQuality => (1) worse quality
    • getPNGCompression

      public int getPNGCompression()
      Gets the PNG compression index, default is 0. See quadbase.ChartAPI.IExportConstants for possible values (eg. quadbase.ChartAPI.IExportConstants.PNG_COMPRESSION_FAST).
    • setPNGCompression

      public void setPNGCompression(int q)
      Sets the PNG compression index, default is 0. See quadbase.ChartAPI.IExportConstants for possible values (eg. quadbase.ChartAPI.IExportConstants.PNG_COMPRESSION_FAST).
    • isGIFTransparent

      public boolean isGIFTransparent()
      Gets the state of GIF transparent mode. If it is transparent, then the background will show throughout the image.
    • setGIFTransparent

      public void setGIFTransparent(boolean b)
      Sets the state of GIF transparent mode. If it is transparent, then the background will show throughout the image.
    • getFlashFrameCount

      public int getFlashFrameCount()
    • setFlashFrameCount

      public void setFlashFrameCount(int ct)
    • getFlashFrameRate

      public float getFlashFrameRate()
    • setFlashFrameRate

      public void setFlashFrameRate(float rate)
    • setImageOption

      public void setImageOption(int i)
      This method is only used for the background image. It sets the display option for the background image. Possible values are ReportImage.CENTER (default), ReportImage.FIT, and ReportImage.TILE.
    • getImageOption

      public int getImageOption()
      This method is only used for the background image. It returns the display option for the background image. Possible values are ReportImage.CENTER (default), ReportImage.FIT, and ReportImage.TILE.
    • getImageURL

      public URL getImageURL()
      Gets the URL associated with this image.
      Returns:
      URL the URL of the location of the image.
    • setImageURL

      public void setImageURL(URL url)
      Sets the image URL
      Specified by:
      setImageURL in interface quadbase.common.util.internal.IReportImage
      Parameters:
      url - the URL location of the image.
    • setImageURL

      public void setImageURL(URL url, boolean setBytes)
      Specified by:
      setImageURL in interface quadbase.common.util.internal.IReportImage
    • getImagePath

      public String getImagePath()
      Gets the image PATH
      Returns:
      image PATH
    • setImagePath

      public void setImagePath(String path)
      Sets the image PATH
      Parameters:
      path - image the path to this image
    • setImagePath

      public void setImagePath(String path, boolean setBytes)
    • setBytes

      public void setBytes(String filename)
    • setHTMLParameters

      public void setHTMLParameters(String dirLocation, String url, String fileName)
      Sets some options for outputting in HTML
      Parameters:
      dirLocation - path to the image on disk
      url - URL location to the image
      fileName - the name of the image file.
    • getSavedFileLocation

      public String getSavedFileLocation()
      Gets the path to the image on disk
    • getSavedFileURL

      public String getSavedFileURL()
      gets the URL location to the image.
    • setDBImage

      public void setDBImage(boolean fdb)
      internal use only Sets this image as a Database image, it will be stored as an array of bytes on a database system.
      Specified by:
      setDBImage in interface quadbase.common.util.internal.IReportImage
    • isDBImage

      public boolean isDBImage()
      internal use only Returns whether this image is stored in the database.
    • setRelativePath

      public void setRelativePath(String rpath)
      internal use only Sets the relative path to where the image can be found iff it is an DB image (one that resides in the DBImages directory of the ER installation)
      Specified by:
      setRelativePath in interface quadbase.common.util.internal.IReportImage
    • getRelativePath

      public String getRelativePath()
      internal use only Gets the relative path to where the image can be found iff it is an DB image (one that resides in the DBImages directory of the ER installation)
      Specified by:
      getRelativePath in interface quadbase.common.util.internal.IReportImage
    • setBytes

      public void setBytes(byte[] b)
      Set the bytes to be used as this image's data.
      Parameters:
      b - the image in bytes
    • getBytes

      public byte[] getBytes()
      Get the this image's data in bytes.
    • write

      public void write(DataOutput out) throws IOException
      For internal use only.
      Overrides:
      write in class ReportCell
      Throws:
      IOException
    • write

      public void write(DataOutput out, boolean pack) throws IOException
      internal use only
      Throws:
      IOException
    • writeImageData

      protected void writeImageData(DataOutput out, boolean pack) throws IOException
      Writes image data to a file specified in the imageURL field.
      Parameters:
      pack - If true, the image is written in 2KB blocks
      Throws:
      IOException
    • writeXML

      public void writeXML(Writer out, boolean writeElementTag) throws IOException
      For internal use only.
      Overrides:
      writeXML in class ReportCell
      Throws:
      IOException
    • createImage

      public static ReportImage createImage(Node node, int version) throws Exception
      For internal use only.
      Throws:
      Exception
    • readXML

      public void readXML(Node node, int version) throws Exception
      For internal use only.
      Overrides:
      readXML in class ReportCell
      Throws:
      Exception
    • createImage

      public static ReportImage createImage(DataInput in, int version) throws Exception
      For internal use only.
      Throws:
      Exception
    • createImage

      public static ReportImage createImage(DataInput in, int version, boolean pack, quadbase.common.util.internal.FileInMemTable subFilesTable) throws Exception
      For internal use only.
      Throws:
      Exception
    • read

      public void read(DataInput in, int version) throws Exception
      For internal use only.
      Overrides:
      read in class ReportCell
      Throws:
      Exception
    • read

      public void read(DataInput in, int version, boolean pack, quadbase.common.util.internal.FileInMemTable subFilesTable) throws Exception
      internal use only.
      Throws:
      Exception
    • toString

      public String toString()
      internal use only
      Overrides:
      toString in class Object
    • createReportImage

      public quadbase.common.util.internal.IReportImage createReportImage(String name)
      internal use only Constructs a ReportImage with the specified label
      Specified by:
      createReportImage in interface quadbase.common.util.internal.IReportImage
      Parameters:
      name - name of the new ReportImage object