Package cnuphys.splot.plot
Class ImageManager
java.lang.Object
cnuphys.splot.plot.ImageManager
- 
Field SummaryFields
- 
Method SummaryModifier and TypeMethodDescriptionclone()Singleton objects cannot be cloned, so we override clone to throw a CloneNotSupportedException.Try to obtain an ImageIcon from the cache.static ImageManagerAccess to the image manager singletonLoad an image from file or the jar file.loadImageFromFile(String fileName, Component component) Load an image from a local file.loadImageFromURL(URL url, Component c) Load an image from a URLloadImageIcon(BufferedImage bufferedImage, String hashKey) Load an image icon from a buffered image.loadImageIcon(String imageFileName) Load an image icon from file or the jar file.voidPlace an ImageIcon into the cache.
- 
Field Details- 
cnuIcon
 
- 
- 
Method Details- 
getInstanceAccess to the image manager singleton- Returns:
- the image manager singleton.
 
- 
loadImageLoad an image from file or the jar file.- Parameters:
- imageFileName- the image files name.
- component- a component to serve as an ImageObserver(any component should do).
- Returns:
- the image
 
- 
loadImageIconLoad an image icon from a buffered image.- Parameters:
- bufferedImage- the buffered image.
- hashKey- the hashtable key.
- Returns:
- the image icon.
 
- 
loadImageIconLoad an image icon from file or the jar file.- Parameters:
- imageFileName- the image file name, relative to class path.
- Returns:
- the loaded ImageIcon, or null.
 
- 
loadImageFromFileLoad an image from a local file.- Parameters:
- fileName- the name of the file holding the image. It will first treat this as an absolute path. If that fails, it will try to uses it relative to the current working directory. If that fails, relative to the home directory. If that fails, we cave.
- component- a component to use as an observer. Any component should do.
- Returns:
- the loaded image, or null.
 
- 
loadImageFromURLLoad an image from a URL- Parameters:
- url- The url of the image
- c- A component to use as an observer
- Returns:
- the image found at the url
 
- 
getTry to obtain an ImageIcon from the cache.- Parameters:
- key- the has key.
- Returns:
- an ImageIcom from the key, or null.
 
- 
putPlace an ImageIcon into the cache.- Parameters:
- key- the hask key to use.
- imageIcon- the ImageIcon to cache.
 
- 
cloneSingleton objects cannot be cloned, so we override clone to throw a CloneNotSupportedException.- Overrides:
- clonein class- Object
- Throws:
- CloneNotSupportedException
 
 
-