public static class

WindowsInternalFrameTitlePane.ScalableIconUIResource

extends Object
implements Icon UIResource
java.lang.Object
   ↳ com.sun.java.swing.plaf.windows.WindowsInternalFrameTitlePane.ScalableIconUIResource

Class Overview

A versatile Icon implementation which can take an array of Icon instances (typically ImageIcons) and choose one that gives the best quality for a given Graphics2D scale factor when painting.

The class is public so it can be instantiated by UIDefaults.ProxyLazyValue.

Note: We assume here that icons are square.

Summary

Public Constructors
WindowsInternalFrameTitlePane.ScalableIconUIResource(Object[] objects)
Public Methods
int getIconHeight()
Returns the icon's height.
int getIconWidth()
Returns the icon's width.
void paintIcon(Component c, Graphics g, int x, int y)
Draw the icon at the specified location.
Protected Methods
Icon getBestIcon(int size)
[Expand]
Inherited Methods
From class java.lang.Object
From interface javax.swing.Icon

Public Constructors

public WindowsInternalFrameTitlePane.ScalableIconUIResource (Object[] objects)

Public Methods

public int getIconHeight ()

Returns the icon's height.

Returns
  • an int specifying the fixed height of the icon.

public int getIconWidth ()

Returns the icon's width.

Returns
  • an int specifying the fixed width of the icon.

public void paintIcon (Component c, Graphics g, int x, int y)

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.

Protected Methods

protected Icon getBestIcon (int size)

Returns
  • the Icon closest to the requested size