Get Bounce at SourceForge.net. Fast secure and Free Open Source software downloads

org.bounce
Class QIcon

java.lang.Object
  extended by org.bounce.QIcon
All Implemented Interfaces:
javax.swing.Icon

public class QIcon
extends java.lang.Object
implements javax.swing.Icon

Icon implementation that allows for overlaying a number of icons on top of the base icon. Important: Icons are overlayed in the order they are supplied. Note: This implementation is based on the CompositeIcon Version 1.00 Aug 15 2001, implementation by Eric Schultz: http://forum.java.sun.com/thread.jsp?forum=57&thread=157029

Version:
$Revision: 1.6 $, $Date: 2008/01/28 21:28:37 $
Author:
Edwin Dankert

Field Summary
static int CENTER
          The overlay icon location CENTER
static int EAST
          The overlay icon location EAST
static int NORTH
          The overlay icon location NORTH
static int NORTH_EAST
          The overlay icon location NORTH_EAST
static int NORTH_WEST
          The overlay icon location NORTH_WEST
static int SOUTH
          The overlay icon location SOUTH
static int SOUTH_EAST
          The overlay icon location SOUTH_EAST
static int SOUTH_WEST
          The overlay icon location SOUTH_WEST
static int WEST
          The overlay icon location WEST
 
Constructor Summary
QIcon(javax.swing.Icon baseIcon)
          Creates a QIcon for the base icon.
QIcon(javax.swing.Icon baseIcon, javax.swing.Icon overlay, int position)
          Creates a new composite icon from two existing icons and places the overlay in the specified position
 
Method Summary
 void addOverlayIcon(javax.swing.Icon icon, int pos)
          Add an overlay icon, using the abstract position.
 void addOverlayIcon(javax.swing.Icon icon, int xpos, int ypos)
          Add an overlay icon, using the position supplied.
 void addOverlayIcon(javax.swing.Icon icon, java.awt.Point position)
          Add an overlay icon, using the position supplied.
 int getIconHeight()
          Return the height of the icon.
 int getIconWidth()
          Return the width of the icon.
 void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)
          Paint the icon.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NORTH

public static final int NORTH
The overlay icon location NORTH

See Also:
Constant Field Values

NORTH_EAST

public static final int NORTH_EAST
The overlay icon location NORTH_EAST

See Also:
Constant Field Values

NORTH_WEST

public static final int NORTH_WEST
The overlay icon location NORTH_WEST

See Also:
Constant Field Values

WEST

public static final int WEST
The overlay icon location WEST

See Also:
Constant Field Values

EAST

public static final int EAST
The overlay icon location EAST

See Also:
Constant Field Values

CENTER

public static final int CENTER
The overlay icon location CENTER

See Also:
Constant Field Values

SOUTH

public static final int SOUTH
The overlay icon location SOUTH

See Also:
Constant Field Values

SOUTH_EAST

public static final int SOUTH_EAST
The overlay icon location SOUTH_EAST

See Also:
Constant Field Values

SOUTH_WEST

public static final int SOUTH_WEST
The overlay icon location SOUTH_WEST

See Also:
Constant Field Values
Constructor Detail

QIcon

public QIcon(javax.swing.Icon baseIcon)
Creates a QIcon for the base icon.

Parameters:
baseIcon - the base icon.

QIcon

public QIcon(javax.swing.Icon baseIcon,
             javax.swing.Icon overlay,
             int position)
Creates a new composite icon from two existing icons and places the overlay in the specified position

Parameters:
baseIcon - the base icon
overlay - the icon to draw on top of the base
position - the location of the overlay relative to the base
Method Detail

addOverlayIcon

public void addOverlayIcon(javax.swing.Icon icon,
                           int pos)
Add an overlay icon, using the abstract position.

Parameters:
icon - the overlay icon.
pos - the abstract position of the icon.

addOverlayIcon

public void addOverlayIcon(javax.swing.Icon icon,
                           int xpos,
                           int ypos)
Add an overlay icon, using the position supplied.

Parameters:
icon - the overlay icon.
xpos - the X position of the icon.
ypos - the Y position of the icon.

addOverlayIcon

public void addOverlayIcon(javax.swing.Icon icon,
                           java.awt.Point position)
Add an overlay icon, using the position supplied.

Parameters:
icon - the overlay icon.
position - the position of the icon.

getIconHeight

public int getIconHeight()
Return the height of the icon.

Specified by:
getIconHeight in interface javax.swing.Icon
Returns:
the icon height.

getIconWidth

public int getIconWidth()
Return the width of the icon.

Specified by:
getIconWidth in interface javax.swing.Icon
Returns:
the icon width.

paintIcon

public void paintIcon(java.awt.Component c,
                      java.awt.Graphics g,
                      int x,
                      int y)
Paint the icon.

Specified by:
paintIcon in interface javax.swing.Icon
Parameters:
c - the component to paint the icon on.
g - the graphics.
x - the x location.
y - the y location.

Get Bounce at SourceForge.net. Fast secure and Free Open Source software downloads

Copyright 2002-2002-2009 Edwin Dankert. All Rights Reserved.