org.progeeks.util.swing
Class ScaledIcon

java.lang.Object
  extended by org.progeeks.util.swing.ScaledIcon
All Implemented Interfaces:
javax.swing.Icon, javax.swing.SwingConstants

public class ScaledIcon
extends java.lang.Object
implements javax.swing.Icon, javax.swing.SwingConstants

Wraps an icon to provide a scaled view.

Version:
$Revision: 1.4 $
Author:
Paul Speed

Field Summary
 
Fields inherited from interface javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
 
Constructor Summary
ScaledIcon()
          Creates an empty icon.
ScaledIcon(javax.swing.Icon icon)
          Creates an icon wrapping the specified icon with default scaling.
ScaledIcon(javax.swing.Icon icon, double xScale, double yScale)
          Creates an icon overlaying the two icons with the second centered over the first.
 
Method Summary
 javax.swing.Icon getIcon()
           
 int getIconHeight()
           
 int getIconWidth()
           
 double getXScale()
           
 double getYScale()
           
 boolean isAntialias()
           
 void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)
           
 void setAntialias(boolean antialias)
           
 void setIcon(javax.swing.Icon icon)
           
 void setXScale(double xScale)
           
 void setYScale(double yScale)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScaledIcon

public ScaledIcon()
Creates an empty icon.


ScaledIcon

public ScaledIcon(javax.swing.Icon icon)
Creates an icon wrapping the specified icon with default scaling.


ScaledIcon

public ScaledIcon(javax.swing.Icon icon,
                  double xScale,
                  double yScale)
Creates an icon overlaying the two icons with the second centered over the first.

Method Detail

setIcon

public void setIcon(javax.swing.Icon icon)

getIcon

public javax.swing.Icon getIcon()

setXScale

public void setXScale(double xScale)

getXScale

public double getXScale()

setYScale

public void setYScale(double yScale)

getYScale

public double getYScale()

setAntialias

public void setAntialias(boolean antialias)

isAntialias

public boolean isAntialias()

paintIcon

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

getIconWidth

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

getIconHeight

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


Copyright © 2002-2003 Paul Speed. All Rights Reserved.