Sweet Home 3D 4.1

com.eteks.sweethome3d.swing
Class IconManager

java.lang.Object
  extended by com.eteks.sweethome3d.swing.IconManager

public class IconManager
extends Object

Singleton managing icons cache.

Author:
Emmanuel Puybaret

Method Summary
 void clear()
          Clears the loaded resources cache and shutdowns the multithreaded service that loads icons.
 Icon getErrorIcon()
          Returns the icon displayed for wrong content.
 Icon getErrorIcon(int height)
          Returns the icon displayed for wrong content resized at a given height.
 Icon getIcon(Content content, Component waitingComponent)
          Returns an icon read from content.
 Icon getIcon(Content content, int height, Component waitingComponent)
          Returns an icon read from content and rescaled at a given height.
static IconManager getInstance()
          Returns an instance of this singleton.
 Icon getWaitIcon()
          Returns the icon displayed while a content is loaded.
 Icon getWaitIcon(int height)
          Returns the icon displayed while a content is loaded resized at a given height.
 boolean isErrorIcon(Icon icon)
          Returns true if the given icon is the error icon used by this manager to indicate it couldn't load an icon.
 boolean isWaitIcon(Icon icon)
          Returns true if the given icon is the wait icon used by this manager to indicate it's currently loading an icon.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static IconManager getInstance()
Returns an instance of this singleton.


clear

public void clear()
Clears the loaded resources cache and shutdowns the multithreaded service that loads icons.


getErrorIcon

public Icon getErrorIcon(int height)
Returns the icon displayed for wrong content resized at a given height.


getErrorIcon

public Icon getErrorIcon()
Returns the icon displayed for wrong content.


isErrorIcon

public boolean isErrorIcon(Icon icon)
Returns true if the given icon is the error icon used by this manager to indicate it couldn't load an icon.


getWaitIcon

public Icon getWaitIcon(int height)
Returns the icon displayed while a content is loaded resized at a given height.


getWaitIcon

public Icon getWaitIcon()
Returns the icon displayed while a content is loaded.


isWaitIcon

public boolean isWaitIcon(Icon icon)
Returns true if the given icon is the wait icon used by this manager to indicate it's currently loading an icon.


getIcon

public Icon getIcon(Content content,
                    Component waitingComponent)
Returns an icon read from content.

Parameters:
content - an object containing an image
waitingComponent - a waiting component. If null, the returned icon will be read immediately in the current thread.

getIcon

public Icon getIcon(Content content,
                    int height,
                    Component waitingComponent)
Returns an icon read from content and rescaled at a given height.

Parameters:
content - an object containing an image
height - the desired height of the returned icon
waitingComponent - a waiting component. If null, the returned icon will be read immediately in the current thread.

Sweet Home 3D 4.1

© Copyrights 2006-2013 eTeks - All rights reserved
Distributed under GNU General Public License