Class OpIcon

java.lang.Object
javax.swing.ImageIcon
VASSAL.tools.imageop.OpIcon
All Implemented Interfaces:
Serializable, Accessible, Icon

public class OpIcon extends ImageIcon implements Icon
An implementation of Icon using an ImageOp as a source.
Since:
3.1.0
Author:
Joel Uckelman
See Also:
  • Field Details

  • Constructor Details

    • OpIcon

      public OpIcon()
      Creates an uninitialized icon.
    • OpIcon

      public OpIcon(ImageOp op)
      Creates an OpIcon using a given ImageOp as its image source.
      Parameters:
      op - the ImageOp to be used by this OpIcon
  • Method Details

    • paintIcon

      public void paintIcon(Component c, Graphics g, int x, int y)

      The given ImageOp is called asynchronously when painting, so as not to block the Event Dispatch Thread.

      Specified by:
      paintIcon in interface Icon
      Overrides:
      paintIcon in class ImageIcon
      Parameters:
      c -
      g -
      x -
      y -
    • getImage

      public Image getImage()
      Overrides:
      getImage in class ImageIcon
    • setImage

      public void setImage(Image img)
      This method does nothing. It is overridden to prevent the image from being set this way.
      Overrides:
      setImage in class ImageIcon
    • getIconWidth

      public int getIconWidth()
      Specified by:
      getIconWidth in interface Icon
      Overrides:
      getIconWidth in class ImageIcon
    • getIconHeight

      public int getIconHeight()
      Specified by:
      getIconHeight in interface Icon
      Overrides:
      getIconHeight in class ImageIcon
    • getOp

      public ImageOp getOp()
      Returns the ImageOp which produces this icon's Image.
      Returns:
      the ImageOp for this OpIcon
    • setOp

      public void setOp(ImageOp op)
      Sets the ImageOp which produces this icon's Image.
      Parameters:
      op - the ImageOp