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 Link icon

  • Constructor Details Link icon

    • OpIcon Link icon

      public OpIcon()
      Creates an uninitialized icon.
    • OpIcon Link icon

      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 Link icon

    • paintIcon Link icon

      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 Link icon

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

      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 Link icon

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

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

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

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