Class PathIcon
java.lang.Object
javax.swing.ImageIcon
com.inductiveautomation.ignition.client.images.PathIcon
- All Implemented Interfaces:
Serializable,Accessible,Icon
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:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class javax.swing.ImageIcon
ImageIcon.AccessibleImageIcon -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPathIcon()PathIcon(ImageObserver observer, String path, int w, int h) PathIcon(ImageObserver observer, String path, int w, int h, boolean useCache, boolean loadInBackground) -
Method Summary
Modifier and TypeMethodDescriptionvoiddoFilters(boolean update) intintintgetImage()protected PathIcon.LoadImageTaskgetImageLoadingTask(String path, int sW, int sH, long mySeq) getPath()intgetWidth()booleanbooleanvoidvoidreset()voidsetFilterA(ImageFilter filter) voidsetFilterB(ImageFilter filter) voidsetHeight(int i) voidvoidsetImageObserver(ImageObserver observer) voidsetLoadInBackground(boolean loadInBackground) voidvoidsetScaleMode(int scaleMode) Deprecated.Not used anymore now that scaling is done by the ImageLoadervoidsetStretchSize(int w, int h) voidsetUseCache(boolean useCache) voidsetWidth(int i) static booleanwaitForImage(Image image) Methods inherited from class javax.swing.ImageIcon
getAccessibleContext, getDescription, getImageLoadStatus, loadImage, setDescription, toString
-
Field Details
-
COMP
-
useCache
protected boolean useCache
-
-
Constructor Details
-
PathIcon
public PathIcon() -
PathIcon
-
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:
getIconHeightin interfaceIcon- Overrides:
getIconHeightin classImageIcon
-
getIconWidth
public int getIconWidth()- Specified by:
getIconWidthin interfaceIcon- Overrides:
getIconWidthin classImageIcon
-
paintIcon
-
setImage
-
getImage
-
getHeight
public int getHeight() -
getImageObserver
- Overrides:
getImageObserverin classImageIcon
-
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
- Overrides:
setImageObserverin classImageIcon
-
setWidth
public void setWidth(int i) -
getPath
-
getImageLoadingTask
-
setPath
-
waitForImage
-
setFilterA
-
setFilterB
-
doFilters
public void doFilters(boolean update) -
setScaleMode
Deprecated.Not used anymore now that scaling is done by the ImageLoader
-