01: /*
02: * Copyright Javelin Software, All rights reserved.
03: */
04:
05: package com.javelin.swinglets.plaf.html;
06:
07: import java.awt.*;
08: import java.util.*;
09: import java.io.*;
10:
11: import com.javelin.swinglets.*;
12: import com.javelin.swinglets.plaf.*;
13: import com.javelin.swinglets.border.*;
14:
15: /**
16: * HTMLCompoundBorderUI defines a look and feel for default HTML.
17: *
18: * @author Robin Sharp
19: */
20:
21: public class HTMLCompoundBorderUI extends HTMLBorderUI {
22: /**
23: * Lays out the border header in the specified manner.
24: */
25: public void updateBorderHeader(PrintWriter out, SComponent component) {
26: if (component.getBorder() == null
27: || !(component.getBorder() instanceof SCompoundBorder)) {
28: return;
29: }
30:
31: SCompoundBorder border = (SCompoundBorder) component
32: .getBorder();
33:
34: if (border.getBorder() == null) {
35: component.getUI().updateComponentHeader(out, component);
36: } else {
37: border.getBorder().paintHeader(out, component);
38: }
39: }
40:
41: /**
42: * Lays out the border in the specified manner.
43: */
44: public void updateBorder(PrintWriter out, SComponent component) {
45: if (component.getBorder() == null
46: || !(component.getBorder() instanceof SCompoundBorder)) {
47: return;
48: }
49:
50: SCompoundBorder border = (SCompoundBorder) component
51: .getBorder();
52:
53: if (border.getBorder() == null) {
54: component.getUI().update(out, component);
55: } else {
56: border.getBorder().paint(out, component);
57: }
58: }
59:
60: /**
61: * Lays out the border footer in the specified manner.
62: */
63: public void updateBorderFooter(PrintWriter out, SComponent component) {
64: if (component.getBorder() == null
65: || !(component.getBorder() instanceof SCompoundBorder)) {
66: return;
67: }
68:
69: SCompoundBorder border = (SCompoundBorder) component
70: .getBorder();
71:
72: if (border.getBorder() == null) {
73: component.getUI().updateComponentFooter(out, component);
74: } else {
75: border.getBorder().paintFooter(out, component);
76: }
77: }
78: }
|