org.progeeks.util.swing
Class CompositeIcon

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

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

Composes two separate Icon objects into one Icon.

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
CompositeIcon()
          Creates an empty icon.
CompositeIcon(javax.swing.Icon a, javax.swing.Icon b)
          Creates an icon overlaying the two icons with the second centered over the first.
CompositeIcon(javax.swing.Icon a, javax.swing.Icon b, int yAlignment)
          Creates an icon reprsenting the two icons side by side.
CompositeIcon(javax.swing.Icon a, javax.swing.Icon b, int xOffset, int yOffset, int xAlignment, int yAlignment)
          Creates an icon with the specified parameters.
 
Method Summary
 int getHorizontalAlignment()
           
 javax.swing.Icon getIconA()
           
 javax.swing.Icon getIconB()
           
 int getIconHeight()
           
 int getIconWidth()
           
 java.awt.Point getOffset()
           
 int getOffsetX()
           
 int getOffsetY()
           
 int getVerticalAlignment()
           
 void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)
           
protected  void recalculate()
           
 void setHorizontalAlignment(int align)
           
 void setIconA(javax.swing.Icon a)
           
 void setIconB(javax.swing.Icon b)
           
 void setOffset(int xOffset, int yOffset)
           
 void setOffsetX(int xOffset)
           
 void setOffsetY(int yOffset)
           
 void setVerticalAlignment(int align)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CompositeIcon

public CompositeIcon()
Creates an empty icon.


CompositeIcon

public CompositeIcon(javax.swing.Icon a,
                     javax.swing.Icon b)
Creates an icon overlaying the two icons with the second centered over the first.


CompositeIcon

public CompositeIcon(javax.swing.Icon a,
                     javax.swing.Icon b,
                     int yAlignment)
Creates an icon reprsenting the two icons side by side.


CompositeIcon

public CompositeIcon(javax.swing.Icon a,
                     javax.swing.Icon b,
                     int xOffset,
                     int yOffset,
                     int xAlignment,
                     int yAlignment)
Creates an icon with the specified parameters.

Method Detail

setIconA

public void setIconA(javax.swing.Icon a)

getIconA

public javax.swing.Icon getIconA()

setIconB

public void setIconB(javax.swing.Icon b)

getIconB

public javax.swing.Icon getIconB()

setHorizontalAlignment

public void setHorizontalAlignment(int align)

getHorizontalAlignment

public int getHorizontalAlignment()

setVerticalAlignment

public void setVerticalAlignment(int align)

getVerticalAlignment

public int getVerticalAlignment()

setOffset

public void setOffset(int xOffset,
                      int yOffset)

getOffset

public java.awt.Point getOffset()

setOffsetX

public void setOffsetX(int xOffset)

getOffsetX

public int getOffsetX()

setOffsetY

public void setOffsetY(int yOffset)

getOffsetY

public int getOffsetY()

recalculate

protected void recalculate()

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.