01: /*
02: * Copyright Javelin Software, All rights reserved.
03: */
04:
05: package com.javelin.swinglets;
06:
07: import java.awt.*;
08: import java.util.*;
09: import java.io.*;
10:
11: import javax.swing.*;
12: import javax.swing.border.*;
13: import javax.servlet.http.*;
14:
15: import com.javelin.swinglets.plaf.*;
16: import com.javelin.swinglets.tree.*;
17: import com.javelin.swinglets.table.*;
18:
19: /**
20: * SUIDefault contains default resources for a LookAndFeel.
21: *
22: * @author Robin Sharp
23: */
24:
25: public class SUIDefaults extends Hashtable {
26:
27: /**
28: * Get the value as a SUI Class, otherwise return null.
29: */
30: public Class getUIClass(Object key) {
31: Object object = get(key);
32: return (object instanceof Class) ? (Class) object : null;
33: }
34:
35: /**
36: * Get the value as a Border, otherwise return null.
37: */
38: public Border getBorder(Object key) {
39: Object object = get(key);
40: return (object instanceof Border) ? (Border) object : null;
41: }
42:
43: /**
44: * Get the STableCellRenderer class.
45: */
46: public Class getTableCellRenderer(Object key) {
47: Object object = get(key);
48: return (object instanceof Class) ? (Class) object : null;
49: }
50:
51: /**
52: * Get the value as a STreeCellRenderer class.
53: */
54: public Class getTreeCellRenderer(Object key) {
55: Object object = get(key);
56: return (object instanceof Class) ? (Class) object : null;
57: }
58:
59: /**
60: * Get the value as a STabbedCellRenderer class.
61: */
62: public Class getTabbedCellRenderer(Object key) {
63: Object object = get(key);
64: return (object instanceof Class) ? (Class) object : null;
65: }
66:
67: /**
68: * Get the value as a String, otherwise return null.
69: */
70: public String getString(Object key) {
71: Object object = get(key);
72: return (object instanceof String) ? (String) object : null;
73: }
74:
75: /**
76: * Get the value as an Integer, otherwise return null.
77: */
78: public int getInt(Object key) {
79: Object object = get(key);
80: return (object instanceof Integer) ? ((Integer) object)
81: .intValue() : 0;
82: }
83:
84: /**
85: * Get the value as a Dimension, otherwise return null.
86: */
87: public Dimension getDimension(Object key) {
88: Object object = get(key);
89: return (object instanceof Dimension) ? (Dimension) object
90: : null;
91: }
92:
93: }
|