01: package test.check.command;
02:
03: import java.awt.Color;
04: import java.awt.Component;
05:
06: /**
07: * A configure command that sets the specified foreground color on the
08: * specified component.
09: *
10: * @author Kirill Grouchnikov
11: */
12: public class ForegroundColorCommand implements
13: ConfigurationCommand<Component> {
14: /**
15: * Color to set.
16: */
17: private Color color;
18:
19: /**
20: * Creates a foreground color configuration command.
21: *
22: * @param color
23: * Foreground color to set.
24: */
25: public ForegroundColorCommand(Color color) {
26: this .color = color;
27: }
28:
29: /*
30: * (non-Javadoc)
31: *
32: * @see test.check.ConfigurationCommand#invoke(java.lang.Object)
33: */
34: public void configure(Component ab) {
35: ab.setForeground(this.color);
36: }
37: }
|