java.lang.Object
javax.swing.ImageIcon
com.inductiveautomation.ignition.client.images.PathIcon
All Implemented Interfaces:
Serializable, Accessible, Icon

public class PathIcon extends ImageIcon
This class loads an icon, possibly stretching and applying filters (color replace, color tint) to it.

For a long time, this class loaded images asynchronously with the EventQueue thread, updating the imageobserver as they came in. It was changed to instead load images synchronously, opting to store them in an in-memory cache. See ImageLoader This simplifies the code a lot, and was done to eliminate a race condition that was occuring when multiple images were loading the same image, and then applying filters (common). See SVN for old methods and inner classes.

See Also:
  • Field Details

    • COMP

      protected static final Component COMP
    • useCache

      protected boolean useCache
  • Constructor Details

    • PathIcon

      public PathIcon()
    • PathIcon

      public PathIcon(ImageObserver observer, String path, int w, int h)
    • PathIcon

      public PathIcon(ImageObserver observer, String path, int w, int h, boolean useCache, boolean loadInBackground)
  • Method Details

    • setLoadInBackground

      public void setLoadInBackground(boolean loadInBackground)
    • isLoadInBackground

      public boolean isLoadInBackground()
    • getIconHeight

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

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

      public void paintIcon(Component c, Graphics g, int x, int y)
      Specified by:
      paintIcon in interface Icon
      Overrides:
      paintIcon in class ImageIcon
    • setImage

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

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

      public int getHeight()
    • getImageObserver

      public ImageObserver getImageObserver()
      Overrides:
      getImageObserver in class ImageIcon
    • getWidth

      public int getWidth()
    • setHeight

      public void setHeight(int i)
    • setStretchSize

      public void setStretchSize(int w, int h)
    • reset

      public void reset()
    • setUseCache

      public void setUseCache(boolean useCache)
    • isUseCache

      public boolean isUseCache()
    • setImageObserver

      public void setImageObserver(ImageObserver observer)
      Overrides:
      setImageObserver in class ImageIcon
    • setWidth

      public void setWidth(int i)
    • getPath

      public String getPath()
    • getImageLoadingTask

      protected PathIcon.LoadImageTask getImageLoadingTask(String path, int sW, int sH, long mySeq)
    • setPath

      public void setPath(String string)
    • waitForImage

      public static boolean waitForImage(Image image)
    • setFilterA

      public void setFilterA(ImageFilter filter)
    • setFilterB

      public void setFilterB(ImageFilter filter)
    • doFilters

      public void doFilters(boolean update)
    • setScaleMode

      @Deprecated public void setScaleMode(int scaleMode)
      Deprecated.
      Not used anymore now that scaling is done by the ImageLoader