|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectwt.clients.util.ContainerColorUtility
public class ContainerColorUtility
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 |
|---|
public ContainerColorUtility()
public ContainerColorUtility(Container container)
myContainer to the container passed in.
| Method Detail |
|---|
public void setContainter(Container container)
myContainer attribute.
public Container getContainer()
myContainer attribute.
public void colorContainer()
public static void colorContainer(Container container)
protected void color(Container container)
public void colorContents()
public static void colorContents(Container container)
protected void colorContentsOfContainer(Container container)
public void setBackground(Color new_background)
public void setChoiceBackground(Color new_choice_background)
public void setTextBackground(Color new_text_background)
public void setForeground(Color new_foreground)
public void setFont(Font new_font)
public void setCellBackground(Color cell_background)
public void setCellForeground(Color cell_foreground)
public void setHeadingBackground(Color heading_background)
public void setHeadingForeground(Color heading_foreground)
public Color getBackground()
public Color getChoiceBackground()
public Color getTextBackground()
public Color getForeground()
public Font getFont()
public Color getCellBackground()
public Color getCellForeground()
public Color getHeadingBackground()
public Color getHeadingForeground()
public static void setDefaultBackground(Color new_background)
public static void setDefaultChoiceBackground(Color new_choice_background)
public static void setDefaultTextBackground(Color new_text_background)
public static void setDefaultForeground(Color new_foreground)
public static void setDefaultFont(Font new_font)
public static void setDefaultCellBackground(Color cell_background)
public static void setDefaultCellForeground(Color cell_foreground)
public static void setDefaultHeadingBackground(Color heading_background)
public static void setDefaultHeadingForeground(Color heading_foreground)
public static Color getDefaultBackground()
public static Color getDefaultChoiceBackground()
public static Color getDefaultTextBackground()
public static Color getDefaultForeground()
public static Font getDefaultFont()
public static Color getDefaultCellBackground()
public static Color getDefaultCellForeground()
public static Color getDefaultHeadingBackground()
public static Color getDefaultHeadingForeground()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||