Top Fields Constructors Methods
org.kordamp.ikonli.swing

public Class FontIcon

extends Object
implements Icon
Class Inheritance
All Implemented Interfaces
javax.swing.Icon
Imports
org.kordamp.ikonli.Ikon, .IkonHandler, javax.swing.*, java.awt.*, java.awt.image.BufferedImage

Author
Andres Almiray

Field Summary

Modifier and TypeField and Description
private Font
private int
private Color
private int
private Ikon
private static final Object
private int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public Color
public int
getIconHeight()

Implements javax.swing.Icon.getIconHeight.

Returns the icon's height.

public int
public int
getIconWidth()

Implements javax.swing.Icon.getIconWidth.

Returns the icon's width.

public Ikon
public static FontIcon
of(Ikon ikon)

public static FontIcon
of(Ikon ikon, int iconSize)

public static FontIcon
of(Ikon ikon, Color iconColor)

public static FontIcon
of(Ikon ikon, int iconSize, Color iconColor)

public void
paintIcon(Component
a Component to get properties useful for painting
c
,
Graphics
the graphics context
g
,
int
the X coordinate of the icon's top-left corner
x
,
int
the Y coordinate of the icon's top-left corner
y
)

Implements javax.swing.Icon.paintIcon.

Draw the icon at the specified location.

public void
setIconColor(Color iconColor)

public void
setIconSize(int iconSize)

public void
setIkon(Ikon ikon)

protected void
public ImageIcon
public ImageIcon
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

fontback to summary
private Font font
heightback to summary
private int height
iconColorback to summary
private Color iconColor
iconSizeback to summary
private int iconSize
ikonback to summary
private Ikon ikon
LOCKback to summary
private static final Object LOCK
widthback to summary
private int width

Constructor Detail

FontIconback to summary
public FontIcon()

Method Detail

getIconColorback to summary
public Color getIconColor()
getIconHeightback to summary
public int getIconHeight()

Implements javax.swing.Icon.getIconHeight.

Doc from javax.swing.Icon.getIconHeight.

Returns the icon's height.

Returns:int

an int specifying the fixed height of the icon.

getIconSizeback to summary
public int getIconSize()
getIconWidthback to summary
public int getIconWidth()

Implements javax.swing.Icon.getIconWidth.

Doc from javax.swing.Icon.getIconWidth.

Returns the icon's width.

Returns:int

an int specifying the fixed width of the icon.

getIkonback to summary
public Ikon getIkon()
ofback to summary
public static FontIcon of(Ikon ikon)
ofback to summary
public static FontIcon of(Ikon ikon, int iconSize)
ofback to summary
public static FontIcon of(Ikon ikon, Color iconColor)
ofback to summary
public static FontIcon of(Ikon ikon, int iconSize, Color iconColor)
paintIconback to summary
public void paintIcon(Component c, Graphics g, int x, int y)

Implements javax.swing.Icon.paintIcon.

Doc from javax.swing.Icon.paintIcon.

Draw the icon at the specified location. Icon implementations may use the Component argument to get properties useful for painting, e.g. the foreground or background color.

Parameters
c:Component

a Component to get properties useful for painting

g:Graphics

the graphics context

x:int

the X coordinate of the icon's top-left corner

y:int

the Y coordinate of the icon's top-left corner

setIconColorback to summary
public void setIconColor(Color iconColor)
setIconSizeback to summary
public void setIconSize(int iconSize)
setIkonback to summary
public void setIkon(Ikon ikon)
setPropertiesback to summary
protected void setProperties()
toImageIconback to summary
public ImageIcon toImageIcon()
toImageIconback to summary
public ImageIcon toImageIcon(Icon icon)