01: package net.suberic.pooka.gui.filter;
02:
03: import java.awt.*;
04:
05: /**
06: * A DisplayFilter which changes the color of the given messages in
07: * the FolderDisplayPanel to the selected color.
08: */
09: public class ColorDisplayFilter implements DisplayFilter {
10:
11: Color newColor;
12:
13: /**
14: * Creates a new ColorDisplayFilter.
15: */
16: public ColorDisplayFilter() {
17: }
18:
19: /**
20: * a no-op.
21: */
22: public java.util.List performFilter(java.util.List tmp) {
23: return tmp;
24: }
25:
26: /**
27: * Configures the filter from the given property.
28: */
29: public void initializeFilter(String propertyName) {
30: try {
31: newColor = new Color(Integer
32: .parseInt(net.suberic.pooka.Pooka.getProperty(
33: propertyName + ".rgb", "742")));
34: } catch (Exception e) {
35: newColor = new Color(742);
36: }
37:
38: }
39:
40: /**
41: * Applies the filter to the given component.
42: */
43: public void apply(java.awt.Component target) {
44: target.setForeground(newColor);
45: }
46: }
|