Class IconElement


public class IconElement extends PictureElement
An icon element is a picture element that is rendered from image data. Generally, icons should be small and easily rendered.
Since:
3.1.1
Author:
Peter Hollemans
  • Constructor Details

    • IconElement

      protected IconElement()
  • Method Details

    • setShadow

      public void setShadow(boolean flag)
      Sets the drop shadow flag.
      Parameters:
      flag - the drop shadow flag, true to draw a drop shadow or false to not. By default the drop shadow is not drawn.
      Since:
      3.7.1
    • create

      public static IconElement create(InputStream stream) throws IOException
      Creates a new icon element from the specified image stream. The position and preferred size are initialized to (0,0) and null.
      Parameters:
      stream - the icon image input stream.
      Returns:
      the new icon element.
      Throws:
      IOException - if an error occurred reading the icon image.
      Since:
      3.7.1
    • render

      public void render(Graphics2D g, Color foreground, Color background)
      Description copied from class: AnnotationElement
      Renders the element graphics.
      Specified by:
      render in class AnnotationElement
      Parameters:
      g - the graphics object for drawing.
      foreground - the foreground element color.
      background - the background element color or null for no background.
    • getArea

      public Area getArea(Graphics2D g)
      Description copied from class: AnnotationElement
      Gets the element bounding area.
      Specified by:
      getArea in class AnnotationElement
      Parameters:
      g - the graphics object for drawing.