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 TypeMethodDescriptionvoid
doFilters
(boolean update) int
int
int
getImage()
protected PathIcon.LoadImageTask
getImageLoadingTask
(String path, int sW, int sH, long mySeq) getPath()
int
getWidth()
boolean
boolean
void
void
reset()
void
setFilterA
(ImageFilter filter) void
setFilterB
(ImageFilter filter) void
setHeight
(int i) void
void
setImageObserver
(ImageObserver observer) void
setLoadInBackground
(boolean loadInBackground) void
void
setScaleMode
(int scaleMode) Deprecated.Not used anymore now that scaling is done by the ImageLoadervoid
setStretchSize
(int w, int h) void
setUseCache
(boolean useCache) void
setWidth
(int i) static boolean
waitForImage
(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:
getIconHeight
in interfaceIcon
- Overrides:
getIconHeight
in classImageIcon
-
getIconWidth
public int getIconWidth()- Specified by:
getIconWidth
in interfaceIcon
- Overrides:
getIconWidth
in classImageIcon
-
paintIcon
-
setImage
-
getImage
-
getHeight
public int getHeight() -
getImageObserver
- Overrides:
getImageObserver
in 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:
setImageObserver
in 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
-