public class IconManager
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears the loaded resources cache and shutdowns the multithreaded service
that loads icons.
|
javax.swing.Icon |
getErrorIcon()
Returns the icon displayed for wrong content.
|
javax.swing.Icon |
getErrorIcon(int height)
Returns the icon displayed for wrong content resized at a given height.
|
javax.swing.Icon |
getIcon(Content content,
java.awt.Component waitingComponent)
Returns an icon read from
content . |
javax.swing.Icon |
getIcon(Content content,
int height,
java.awt.Component waitingComponent)
Returns an icon read from
content and rescaled at a given height . |
static IconManager |
getInstance()
Returns an instance of this singleton.
|
javax.swing.Icon |
getWaitIcon()
Returns the icon displayed while a content is loaded.
|
javax.swing.Icon |
getWaitIcon(int height)
Returns the icon displayed while a content is loaded resized at a given height.
|
boolean |
isErrorIcon(javax.swing.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(javax.swing.Icon icon)
Returns
true if the given icon is the wait icon
used by this manager to indicate it's currently loading an icon. |
public static IconManager getInstance()
public void clear()
public javax.swing.Icon getErrorIcon(int height)
public javax.swing.Icon getErrorIcon()
public boolean isErrorIcon(javax.swing.Icon icon)
true
if the given icon
is the error icon
used by this manager to indicate it couldn't load an icon.public javax.swing.Icon getWaitIcon(int height)
public javax.swing.Icon getWaitIcon()
public boolean isWaitIcon(javax.swing.Icon icon)
true
if the given icon
is the wait icon
used by this manager to indicate it's currently loading an icon.public javax.swing.Icon getIcon(Content content, java.awt.Component waitingComponent)
content
.content
- an object containing an imagewaitingComponent
- a waiting component. If null
, the returned icon will
be read immediately in the current thread.public javax.swing.Icon getIcon(Content content, int height, java.awt.Component waitingComponent)
content
and rescaled at a given height
.content
- an object containing an imageheight
- the desired height of the returned iconwaitingComponent
- a waiting component. If null
, the returned icon will
be read immediately in the current thread.
© Copyright 2024 Space Mushrooms
Distributed under GNU General Public License