dsto.dfc.swing.icons
Class FlowIcon

java.lang.Object
  extended by dsto.dfc.swing.icons.FlowIcon
All Implemented Interfaces:
Icon

public class FlowIcon
extends Object
implements Icon

This is used if you want to display a group of icons one after the other horizontally across, and also want it treated as an Icon so that it may be used on many type of components, including buttons, and labels.

Version:
$Revision$

Field Summary
protected  int gap
           
protected  int height
           
protected  ArrayList icons
           
protected  int width
           
 
Constructor Summary
FlowIcon()
           
FlowIcon(Icon icon1, Icon icon2)
           
FlowIcon(int gap)
           
 
Method Summary
 void addIcon(Icon icon)
           
 int getGap()
           
 int getIconHeight()
           
 int getIconWidth()
           
static void main(String[] args)
          This is so that you easily test this class.
 void paintIcon(Component c, Graphics g, int x, int y)
           
 void removeAllIcons()
          Removes all the icons.
 void removeIcon(Icon icon)
           
 void setGap(int newGap)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

icons

protected ArrayList icons

width

protected int width

height

protected int height

gap

protected int gap
Constructor Detail

FlowIcon

public FlowIcon()

FlowIcon

public FlowIcon(int gap)

FlowIcon

public FlowIcon(Icon icon1,
                Icon icon2)
Method Detail

setGap

public void setGap(int newGap)

getGap

public int getGap()

addIcon

public void addIcon(Icon icon)

removeIcon

public void removeIcon(Icon icon)

removeAllIcons

public void removeAllIcons()
Removes all the icons. ie when asked to paint, nothing will be painted.


paintIcon

public void paintIcon(Component c,
                      Graphics g,
                      int x,
                      int y)
Specified by:
paintIcon in interface Icon

getIconWidth

public int getIconWidth()
Specified by:
getIconWidth in interface Icon

getIconHeight

public int getIconHeight()
Specified by:
getIconHeight in interface Icon

main

public static void main(String[] args)
This is so that you easily test this class. Just run it.



Copyright © 2008 Commonwealth of Australia