JFormDesigner 5.0.4 Runtime API

com.jformdesigner.model
Class SwingIcon

java.lang.Object
  extended by com.jformdesigner.model.SwingIcon
All Implemented Interfaces:
SwingResource, javax.swing.Icon

public class SwingIcon
extends java.lang.Object
implements javax.swing.Icon, SwingResource

Used to specify a javax.swing.Icon. The icon is either loaded from the classpath using new ImageIcon(classLoader.getResource(name)), from the file system using new ImageIcon(name) or from the current look and feel using UIManager.getIcon(name).


Field Summary
static int CLASSPATH
           
static int FILE
           
static int SWING
           
 
Constructor Summary
SwingIcon(int type, java.lang.String name)
          Constructs a icon.
 
Method Summary
 javax.swing.Icon createIcon(java.lang.ClassLoader loader)
          For internal use only.
 boolean equals(java.lang.Object obj)
          Determines whether another object is equal to this object.
 int getIconHeight()
           
 int getIconWidth()
           
 java.lang.String getName()
          Returns the icon name.
 int getType()
          Returns the icon type (CLASSPATH, FILE or SWING).
 int hashCode()
          Returns the hash code for this object.
 void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)
           
 java.lang.String toString()
          Returns a string representation of the object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

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,
                 java.lang.String name)
Constructs a icon.

Parameters:
type - The icon type (CLASSPATH, FILE or SWING).
name - The icon name. A resource name (see java.lang.ClassLoader.getResource(String)) if type is CLASSPATH, a file name (see javax.swing.ImageIcon(String)) if type is FILE or a key (see javax.swing.UIManager.getIcon(String)) if type is SWING.
Method Detail

getType

public int getType()
Returns the icon type (CLASSPATH, FILE or SWING).


getName

public java.lang.String getName()
Returns the icon name. A resource name if type is CLASSPATH, a file name if type is FILE or a key if type is SWING.


createIcon

public javax.swing.Icon createIcon(java.lang.ClassLoader loader)
For internal use only.


getIconWidth

public int getIconWidth()
Specified by:
getIconWidth in interface javax.swing.Icon

getIconHeight

public int getIconHeight()
Specified by:
getIconHeight in interface javax.swing.Icon

paintIcon

public void paintIcon(java.awt.Component c,
                      java.awt.Graphics g,
                      int x,
                      int y)
Specified by:
paintIcon in interface javax.swing.Icon

equals

public boolean equals(java.lang.Object obj)
Determines whether another object is equal to this object.

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Returns the hash code for this object.

Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Returns a string representation of the object.

Overrides:
toString in class java.lang.Object

JFormDesigner 5.0.4 Runtime API

Copyright (C) 2004-2012 FormDev Software GmbH. All rights reserved.