tools
Class BackgroundIcon

java.lang.Object
  extended by tools.BackgroundIcon
All Implemented Interfaces:
javax.swing.Icon

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

A simple class to represent a rectangular icon with a fill color and a black border.

Author:
Collin Fagan

Field Summary
private  java.awt.Color backgroundColor
           
private  int height
           
private  int width
           
 
Constructor Summary
BackgroundIcon()
           
 
Method Summary
 java.awt.Color getBackgroundColor()
           
 int getIconHeight()
           
 int getIconWidth()
           
 void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)
           
 void setBackgroundColor(java.awt.Color backgroundColor)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

width

private int width

height

private int height

backgroundColor

private java.awt.Color backgroundColor
Constructor Detail

BackgroundIcon

public BackgroundIcon()
Method Detail

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

getBackgroundColor

public java.awt.Color getBackgroundColor()
Returns:
the backgroundColor

setBackgroundColor

public void setBackgroundColor(java.awt.Color backgroundColor)
Parameters:
backgroundColor - the backgroundColor to set