Package com.jformdesigner.model
Class SwingIcon
- java.lang.Object
-
- com.jformdesigner.model.SwingIcon
-
- All Implemented Interfaces:
SwingResource,Icon
public class SwingIcon extends Object implements Icon, SwingResource
Used to specify aIcon. The icon is either loaded from the classpath usingnew ImageIcon(classLoader.getResource(name)), from the file system usingnew ImageIcon(name)or from the current look and feel usingUIManager.getIcon(name).
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IconcreateIcon(ClassLoader loader)For internal use only.booleanequals(Object obj)Determines whether another object is equal to this object.intgetIconHeight()intgetIconWidth()StringgetName()Returns the icon name.intgetType()inthashCode()Returns the hash code for this object.voidpaintIcon(Component c, Graphics g, int x, int y)StringtoString()Returns a string representation of the object.
-
-
-
Field Detail
-
CLASSPATH
public static final int CLASSPATH
- See Also:
- Constant Field Values
-
FILE
public static final int FILE
- See Also:
- Constant Field Values
-
SWING
public static final int SWING
- Since:
- 3.0
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SwingIcon
public SwingIcon(int type, String name)Constructs a icon.- Parameters:
type- The icon type (CLASSPATH,FILEorSWING).name- The icon name. A resource name (seejava.lang.ClassLoader.getResource(String)) if type isCLASSPATH, a file name (seejavax.swing.ImageIcon(String)) if type isFILEor a key (seejavax.swing.UIManager.getIcon(String)) if type isSWING.
-
-
Method Detail
-
getType
public int getType()
-
getName
public String getName()
-
createIcon
public Icon createIcon(ClassLoader loader)
For internal use only.
-
getIconWidth
public int getIconWidth()
- Specified by:
getIconWidthin interfaceIcon
-
getIconHeight
public int getIconHeight()
- Specified by:
getIconHeightin interfaceIcon
-
equals
public boolean equals(Object obj)
Determines whether another object is equal to this object.
-
hashCode
public int hashCode()
Returns the hash code for this object.
-
-