Class ImageElement

    • Constructor Detail

      • ImageElement

        public ImageElement​(Image image)
        Create from existing Image
        Parameters:
        image - image
      • ImageElement

        public ImageElement​(int record_ID,
                            boolean isAttachment)
        Create Image from Attachment or Column
        Parameters:
        record_ID - record id from printformat or column
        isAttachment - flag to indicate if is attachment or is a column from DB
    • Method Detail

      • get

        public static ImageElement get​(String imageURLString)
        Create Image from URL
        Parameters:
        imageURLString - image url
        Returns:
        image element
      • get

        public static ImageElement get​(URL imageURL)
        Create Image from URL
        Parameters:
        imageURL - image url
        Returns:
        image element
      • get

        public static ImageElement get​(int AD_PrintFormatItem_ID)
        Create Image from Attachment
        Parameters:
        AD_PrintFormatItem_ID - record id
        Returns:
        image element
      • get

        public static ImageElement get​(PrintDataElement data,
                                       String imageURLString)
        Create Image from database column
        Parameters:
        data - the printdataelement, containing the reference
        imageURLString - image url - containing just the AD_Image_ID reference
        Returns:
        image element
      • calculateSize

        protected boolean calculateSize()
        Calculate Image Size. Set p_width and p_height
        Specified by:
        calculateSize in class PrintElement
        Returns:
        true if calculated
      • getImage

        public Image getImage()
        Get the Image
        Returns:
        image
      • getScaleFactor

        public double getScaleFactor()
        Get image scale factor. author teo_sarca - [ 1673548 ] Image is not scaled in a report table cell
        Returns:
        scale factor
      • paint

        public void paint​(Graphics2D g2D,
                          int pageNo,
                          Point2D pageStart,
                          Properties ctx,
                          boolean isView)
        Paint Image
        Specified by:
        paint in class PrintElement
        Parameters:
        g2D - Graphics
        pageStart - top left Location of page
        pageNo - page number for multi page support (0 = header/footer) - ignored
        ctx - print context
        isView - true if online view (IDs are links)