wt.clients.util
Class ContainerColorUtility

java.lang.Object
  extended by wt.clients.util.ContainerColorUtility

public class ContainerColorUtility
extends Object

This class is used to recursively apply the same background, foreground, and font to all components within a container. This can be used as a static method or an instance method. This class contains color defaults that can be changed. There are several ways to use this class. 1) ContainerColorUtility.colorContainer(aContainer); This will color the container and all of its components to the default colors defined in this class. 2) ContainerColorUtility.setBackground(newColor); ContainerColorUtility.setForeground(newColor); . . ContainerColorUtility.colorContainer(aContainer); This will change the default colors and any time that colorContainer is subsequently called, it will use the newColors 3) ContainerColorUtility utility = new ContainerColorUtility(); utility.setComponent(specificComponent) utility.setForeground(newColor); . . utility.colorContainer(); This will create and instance of the utility and the newColors defined here will only apply to that instance of the specificComponent and any subsequent calls to colorContainer with a different instance will be using the default colors not the newColors. 4) utility.colorContents(); The colorContents() method will color only the contents of the container and not the container itself. This is useful for beans when overriding setBackground, etc. The following is an example of how a bean may want to override. ContainerColorUtility utility = new ContainerColorUtility(this); . . public void setBackground(Color newColor) { super.setBackground(newColor); utility.setBackground(newColor); utiltiy.colorContents(); }

Supported API: true.

Extendable: false.


Constructor Summary
ContainerColorUtility()
          This constructs and instance of the ContainerColorUtility

Supported API: true.
ContainerColorUtility(Container container)
          This constructs and instance of the ContainerColorUtility and sets myContainer to the container passed in.
 
Method Summary
protected  void color(Container container)
          Iterates through the container and colors the components within

Supported API: true.
 void colorContainer()
          Call this method when you want to color only the instance of the container that this class is holding and its components.
static void colorContainer(Container container)
          This is the static method that can be used to color a container with the defined colors and recursively color its components.
 void colorContents()
          Use this method to color the contents of the container instance but not the container itself.
static void colorContents(Container container)
          Use this static method to color the contents of the container passed in but not the container itself.
protected  void colorContentsOfContainer(Container container)
          this colors the contents of the container instance but not the container itself.
 Color getBackground()
          This sets the background for this instance.
 Color getCellBackground()
          This gets the background of multilist cells for this instance.
 Color getCellForeground()
          This gets the foreground of multilist cells for this instance.
 Color getChoiceBackground()
          This gets the background color for choice boxes for this instance.
 Container getContainer()
          This is the getter for the myContainer attribute.
static Color getDefaultBackground()
          This gets the background for all instances.
static Color getDefaultCellBackground()
          This gets the background of multilist cells for all instances.
static Color getDefaultCellForeground()
          This gets the foreground of multilist cells for all instances.
static Color getDefaultChoiceBackground()
          This gets the background of choice boxes for all instances.
static Font getDefaultFont()
          This gets the font for all instances.
static Color getDefaultForeground()
          This gets the foreground for all instances.
static Color getDefaultHeadingBackground()
          This gets the background of multilist headers for all instances.
static Color getDefaultHeadingForeground()
          This gets the foreground of multitlist headers for all instances.
static Color getDefaultTextBackground()
          This gets the background of text components for all instances.
 Font getFont()
          This gets the font for this instance.
 Color getForeground()
          This gets the foreground color for this instance.
 Color getHeadingBackground()
          This gets the background of multilist headings for this instance.
 Color getHeadingForeground()
          This gets the foreground of the multilist headers for this instance.
 Color getTextBackground()
          This gets the background color for choice text components for this instance.
 void setBackground(Color new_background)
          This sets the background for this instance.
 void setCellBackground(Color cell_background)
          This sets the background of multilist cells for this instance.
 void setCellForeground(Color cell_foreground)
          This sets the foreground of multilist cells for this instance.
 void setChoiceBackground(Color new_choice_background)
          This sets the background color for choice boxes for this instance.
 void setContainter(Container container)
          This is a setter for the myContainer attribute.
static void setDefaultBackground(Color new_background)
          This sets the background for all instances.
static void setDefaultCellBackground(Color cell_background)
          This sets the background of multilist cells for all instances.
static void setDefaultCellForeground(Color cell_foreground)
          This sets the foreground of multilist cells for all instances.
static void setDefaultChoiceBackground(Color new_choice_background)
          This sets the background of the choice boxes for all instances.
static void setDefaultFont(Font new_font)
          This sets the font for all instances.
static void setDefaultForeground(Color new_foreground)
          This sets the foreground for all instances.
static void setDefaultHeadingBackground(Color heading_background)
          This sets the background of multilist headers for all instances.
static void setDefaultHeadingForeground(Color heading_foreground)
          This sets the foreground of multilist headers for all instances.
static void setDefaultTextBackground(Color new_text_background)
          This sets the background of text components for all instances.
 void setFont(Font new_font)
          This sets the font for this instance.
 void setForeground(Color new_foreground)
          This sets the foreground color for this instance.
 void setHeadingBackground(Color heading_background)
          This sets the background of multilist headings for this instance.
 void setHeadingForeground(Color heading_foreground)
          This sets the foreground of the multilist headers for this instance.
 void setTextBackground(Color new_text_background)
          This sets the background color for choice text components for this instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContainerColorUtility

public ContainerColorUtility()
This constructs and instance of the ContainerColorUtility

Supported API: true.


ContainerColorUtility

public ContainerColorUtility(Container container)
This constructs and instance of the ContainerColorUtility and sets myContainer to the container passed in.

Supported API: true.

Method Detail

setContainter

public void setContainter(Container container)
This is a setter for the myContainer attribute.

Supported API: true.


getContainer

public Container getContainer()
This is the getter for the myContainer attribute.

Supported API: true.


colorContainer

public void colorContainer()
Call this method when you want to color only the instance of the container that this class is holding and its components.

Supported API: true.


colorContainer

public static void colorContainer(Container container)
This is the static method that can be used to color a container with the defined colors and recursively color its components.

Supported API: true.


color

protected void color(Container container)
Iterates through the container and colors the components within

Supported API: true.


colorContents

public void colorContents()
Use this method to color the contents of the container instance but not the container itself.

Supported API: true.


colorContents

public static void colorContents(Container container)
Use this static method to color the contents of the container passed in but not the container itself.

Supported API: true.


colorContentsOfContainer

protected void colorContentsOfContainer(Container container)
this colors the contents of the container instance but not the container itself.

Supported API: true.


setBackground

public void setBackground(Color new_background)
This sets the background for this instance.

Supported API: true.


setChoiceBackground

public void setChoiceBackground(Color new_choice_background)
This sets the background color for choice boxes for this instance.

Supported API: true.


setTextBackground

public void setTextBackground(Color new_text_background)
This sets the background color for choice text components for this instance.

Supported API: true.


setForeground

public void setForeground(Color new_foreground)
This sets the foreground color for this instance.

Supported API: true.


setFont

public void setFont(Font new_font)
This sets the font for this instance.

Supported API: true.


setCellBackground

public void setCellBackground(Color cell_background)
This sets the background of multilist cells for this instance.

Supported API: true.


setCellForeground

public void setCellForeground(Color cell_foreground)
This sets the foreground of multilist cells for this instance.

Supported API: true.


setHeadingBackground

public void setHeadingBackground(Color heading_background)
This sets the background of multilist headings for this instance.

Supported API: true.


setHeadingForeground

public void setHeadingForeground(Color heading_foreground)
This sets the foreground of the multilist headers for this instance.

Supported API: true.


getBackground

public Color getBackground()
This sets the background for this instance.

Supported API: true.


getChoiceBackground

public Color getChoiceBackground()
This gets the background color for choice boxes for this instance.

Supported API: true.


getTextBackground

public Color getTextBackground()
This gets the background color for choice text components for this instance.

Supported API: true.


getForeground

public Color getForeground()
This gets the foreground color for this instance.

Supported API: true.


getFont

public Font getFont()
This gets the font for this instance.

Supported API: true.


getCellBackground

public Color getCellBackground()
This gets the background of multilist cells for this instance.

Supported API: true.


getCellForeground

public Color getCellForeground()
This gets the foreground of multilist cells for this instance.

Supported API: true.


getHeadingBackground

public Color getHeadingBackground()
This gets the background of multilist headings for this instance.

Supported API: true.


getHeadingForeground

public Color getHeadingForeground()
This gets the foreground of the multilist headers for this instance.

Supported API: true.


setDefaultBackground

public static void setDefaultBackground(Color new_background)
This sets the background for all instances.

Supported API: true.


setDefaultChoiceBackground

public static void setDefaultChoiceBackground(Color new_choice_background)
This sets the background of the choice boxes for all instances.

Supported API: true.


setDefaultTextBackground

public static void setDefaultTextBackground(Color new_text_background)
This sets the background of text components for all instances.

Supported API: true.


setDefaultForeground

public static void setDefaultForeground(Color new_foreground)
This sets the foreground for all instances.

Supported API: true.


setDefaultFont

public static void setDefaultFont(Font new_font)
This sets the font for all instances.

Supported API: true.


setDefaultCellBackground

public static void setDefaultCellBackground(Color cell_background)
This sets the background of multilist cells for all instances.

Supported API: true.


setDefaultCellForeground

public static void setDefaultCellForeground(Color cell_foreground)
This sets the foreground of multilist cells for all instances.

Supported API: true.


setDefaultHeadingBackground

public static void setDefaultHeadingBackground(Color heading_background)
This sets the background of multilist headers for all instances.

Supported API: true.


setDefaultHeadingForeground

public static void setDefaultHeadingForeground(Color heading_foreground)
This sets the foreground of multilist headers for all instances.

Supported API: true.


getDefaultBackground

public static Color getDefaultBackground()
This gets the background for all instances.

Supported API: true.


getDefaultChoiceBackground

public static Color getDefaultChoiceBackground()
This gets the background of choice boxes for all instances.

Supported API: true.


getDefaultTextBackground

public static Color getDefaultTextBackground()
This gets the background of text components for all instances.

Supported API: true.


getDefaultForeground

public static Color getDefaultForeground()
This gets the foreground for all instances.

Supported API: true.


getDefaultFont

public static Font getDefaultFont()
This gets the font for all instances.

Supported API: true.


getDefaultCellBackground

public static Color getDefaultCellBackground()
This gets the background of multilist cells for all instances.

Supported API: true.


getDefaultCellForeground

public static Color getDefaultCellForeground()
This gets the foreground of multilist cells for all instances.

Supported API: true.


getDefaultHeadingBackground

public static Color getDefaultHeadingBackground()
This gets the background of multilist headers for all instances.

Supported API: true.


getDefaultHeadingForeground

public static Color getDefaultHeadingForeground()
This gets the foreground of multitlist headers for all instances.

Supported API: true.