01: /*
02: * Copyright Javelin Software, All rights reserved.
03: */
04:
05: package com.javelin.swinglets.plaf.wml;
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:
14: /**
15: * WMLGridLayoutUI defines a look and feel for default WML.
16: *
17: * @author Robin Sharp
18: */
19:
20: public class WMLBorderLayoutUI extends WMLLayoutUI {
21: /**
22: * Lays out the container in the specified manner.
23: */
24: public void layoutContainer(SContainer parent, PrintWriter out) {
25: if (parent.getComponentCount() == 0)
26: return;
27:
28: SBorderLayout borderLayout = (SBorderLayout) parent
29: .getLayoutManager();
30:
31: out.print(WMLCharacterUI.getSpecialCharacter(SCharacter.BREAK));
32:
33: if (borderLayout.getComponent(SBorderLayout.NORTH) != null) {
34: borderLayout.getComponent(SBorderLayout.NORTH).paint(out);
35: out.print(WMLCharacterUI
36: .getSpecialCharacter(SCharacter.BREAK));
37: }
38:
39: if (borderLayout.getComponent(SBorderLayout.WEST) != null) {
40: borderLayout.getComponent(SBorderLayout.WEST).paint(out);
41: }
42:
43: if (borderLayout.getGap() > 0) {
44: out.print(WMLCharacterUI
45: .getSpecialCharacter(SCharacter.SPACE));
46: }
47:
48: if (borderLayout.getComponent(SBorderLayout.CENTER) != null) {
49: borderLayout.getComponent(SBorderLayout.CENTER).paint(out);
50: }
51:
52: if (borderLayout.getGap() > 0) {
53: out.print(WMLCharacterUI
54: .getSpecialCharacter(SCharacter.SPACE));
55: }
56:
57: if (borderLayout.getComponent(SBorderLayout.EAST) != null) {
58: borderLayout.getComponent(SBorderLayout.EAST).paint(out);
59: }
60:
61: if (borderLayout.getComponent(SBorderLayout.WEST) != null
62: || borderLayout.getComponent(SBorderLayout.CENTER) != null
63: || borderLayout.getComponent(SBorderLayout.EAST) != null) {
64: out.print(WMLCharacterUI
65: .getSpecialCharacter(SCharacter.BREAK));
66: }
67:
68: if (borderLayout.getComponent(SBorderLayout.NORTH) != null) {
69: borderLayout.getComponent(SBorderLayout.NORTH).paint(out);
70: out.print(WMLCharacterUI
71: .getSpecialCharacter(SCharacter.BREAK));
72: }
73: }
74:
75: }
|