Package resources
Class IconProvider
- java.lang.Object
-
- resources.IconProvider
-
public class IconProvider extends java.lang.Object
A class that knows how to provide an icon and the URL for that icon. IfgetUrl()
returns a non-null value, then that is the URL used to originally load the icon in this class.If
getUrl()
returns null, thengetOrCreateUrl()
can be used to create a value URL by writing out the image for this class's icon.
-
-
Constructor Summary
Constructors Constructor Description IconProvider(javax.swing.ImageIcon icon, java.net.URL url)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.swing.ImageIcon
getIcon()
java.net.URL
getOrCreateUrl()
Returns the value ofgetUrl()
if it is non-null.java.net.URL
getUrl()
boolean
isInvalid()
-
-
-
Method Detail
-
getIcon
public javax.swing.ImageIcon getIcon()
-
isInvalid
public boolean isInvalid()
-
getUrl
public java.net.URL getUrl()
-
getOrCreateUrl
public java.net.URL getOrCreateUrl()
Returns the value ofgetUrl()
if it is non-null. Otherwise, this class will attempt to create a temporary file containing the image of this class in order to return a URL for that temp file. If a temporary file could not be created, then the URL returned from this class will point to thedefault icon
.- Returns:
- the URL
-
-