01: /*
02: * Copyright Javelin Software, All rights reserved.
03: */
04:
05: package com.javelin.swinglets.plaf;
06:
07: import java.awt.*;
08: import java.util.*;
09: import java.io.*;
10:
11: /**
12: * SLookAndFeel defines a look and feel.
13: *
14: * @author Robin Sharp
15: */
16:
17: import java.awt.*;
18: import java.io.*;
19: import java.util.*;
20:
21: import com.javelin.swinglets.*;
22: import com.javelin.swinglets.border.*;
23: import com.javelin.swinglets.plaf.*;
24:
25: public abstract class SLookAndFeel {
26: public final static String TABLE_DEFAULT_CELL_RENDERER = "_TABLE_DCR";
27: public final static String TABLE_DEFAULT_HEADER_RENDERER = "_TABLE_DHR";
28: public final static String TABLE_DEFAULT_FOOTER_RENDERER = "_TABLE_DFR";
29: public final static String TREE_DEFAULT_CELL_RENDERER = "_TREE_DCR";
30: public final static String TABBED_DEFAULT_CELL_RENDERER = "_TAB_DCR";
31:
32: /**
33: * Construct a SLookAndFeel.
34: */
35: public SLookAndFeel() {
36: }
37:
38: /**
39: * Get the name of the look and feel.
40: */
41: public abstract String getName();
42:
43: /**
44: * Get the content type for the look and feel.
45: */
46: public abstract String getContentType();
47:
48: /**
49: * Does the look and feel require a Writer (char)
50: * stream or a OutputStream (byte) stream.
51: */
52: public abstract boolean isWriter();
53:
54: /**
55: * Get a SComponentUI for a SComponent.
56: */
57: public abstract SComponentUI getUI(SComponent component);
58:
59: /**
60: * Get a SLayoutUI for a SLayout.
61: */
62: public abstract SLayoutUI getLayoutUI(SLayoutManager layout);
63:
64: /**
65: * Get a SBorderUI for a SBorder.
66: */
67: public abstract SBorderUI getBorderUI(SBorder border);
68:
69: /**
70: * Get the SUIDefaults
71: */
72: public SUIDefaults getUIDefaults() {
73: if (defaults == null) {
74: //new Exception().printStackTrace();
75: defaults = new SUIDefaults();
76: initClassDefaults(defaults);
77: }
78:
79: return defaults;
80: }
81:
82: /**
83: * Called by the Constructor.
84: */
85: protected abstract void initClassDefaults(SUIDefaults defaults);
86:
87: /**
88: * To string. get the name
89: */
90: public String toString() {
91: return getName();
92: }
93:
94: // PRIVATE ///////////////////////////////////////////////////////
95:
96: protected SUIDefaults defaults;
97: }
|