Package org.jfree.layouting.input

## Class AWTImageData

- java.lang.Object
- - org.jfree.layouting.input.AWTImageData

- All Implemented Interfaces:
    `java.io.Serializable`, `ImageData`

      public class AWTImageData
      extends java.lang.Object
      implements ImageData

  Creation-Date: 14.12.2005, 14:03:08
  Author:
    Thomas Morgner
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `AWTImageData​(org.pentaho.reporting.libraries.resourceloader.Resource source, java.awt.Image image)` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `draw​(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D area)` | Draws the object.
    `long` | `getHeight​()` | Returns the height of the image in micro-dots.
    `java.awt.Dimension` | `getPreferredSize​()` | Returns the preferred size of the drawable.
    `org.pentaho.reporting.libraries.resourceloader.Resource` | `getSource​()` | Returns the resource definition that was used to load the image.
    `long` | `getWidth​()` | Returns the width of the image in micro-dots.
    `boolean` | `isPreserveAspectRatio​()` | Returns true, if this drawable will preserve an aspect ratio during the drawing.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### AWTImageData

          public AWTImageData​(org.pentaho.reporting.libraries.resourceloader.Resource source,
                              java.awt.Image image)

  - ### Method Detail

    - #### getSource

          public org.pentaho.reporting.libraries.resourceloader.Resource getSource​()

      Returns the resource definition that was used to load the image. Return null, if there was no resource loader involved. (This covers both invalid/empty content and generated content.)
      Specified by:
        `getSource` in interface `ImageData`
      Returns:

    - #### getWidth

          public long getWidth​()

      Description copied from interface: `ImageData`
      Returns the width of the image in micro-dots.
      Specified by:
        `getWidth` in interface `ImageData`
      Returns:

    - #### getHeight

          public long getHeight​()

      Description copied from interface: `ImageData`
      Returns the height of the image in micro-dots.
      Specified by:
        `getHeight` in interface `ImageData`
      Returns:

    - #### getPreferredSize

          public java.awt.Dimension getPreferredSize​()

      Returns the preferred size of the drawable. If the drawable is aspect ratio aware, these bounds should be used to compute the preferred aspect ratio for this drawable.
      Returns:
        the preferred size.

    - #### isPreserveAspectRatio

          public boolean isPreserveAspectRatio​()

      Returns true, if this drawable will preserve an aspect ratio during the drawing.
      Returns:
        true, if an aspect ratio is preserved, false otherwise.

    - #### draw

          public void draw​(java.awt.Graphics2D g2,
                           java.awt.geom.Rectangle2D area)

      Draws the object.
      Specified by:
        `draw` in interface `ImageData`
      Parameters:
        `g2` - the graphics device.
        `area` - the area inside which the object should be drawn.