01: /*
02: * Copyright Javelin Software, All rights reserved.
03: */
04:
05: package com.javelin.swinglets;
06:
07: import java.util.*;
08: import java.io.*;
09:
10: import com.javelin.swinglets.plaf.*;
11:
12: /**
13: * SLayoutManager is used to layout SComponents in a SContainer.
14: *
15: * @author Robin Sharp
16: */
17:
18: public class SFlowLayout extends SLayoutManager {
19: /**
20: * Construct a fully qualified SFlowLayout, with SConstants.LEFT layout.
21: */
22: public SFlowLayout() {
23: // default to 1 space, can't rely on <cr> at end of label
24:
25: this (SConstants.LEFT, 1);
26: }
27:
28: /**
29: * Construct a fully qualified SFlowLayout,
30: * @alignment either SConstants.LEFT, SConstants.CENTER or SConstants.RIGHT layout.
31: */
32: public SFlowLayout(int alignment) {
33: this (alignment, 0);
34: }
35:
36: /**
37: * Construct a fully qualified SFlowLayout,
38: * @alignment either SConstants.LEFT, SConstants.CENTER or SConstants.RIGHT layout.
39: * @gap the number of spaces either vertical or horizontal.
40: */
41: public SFlowLayout(int alignment, int gap) {
42: this .alignment = alignment;
43: this .gap = gap;
44: }
45:
46: /**
47: * Returns the name of the L&F class that renders this layout.
48: */
49: public Class getUIClass() {
50: return SFlowLayout.class;
51: }
52:
53: /**
54: * Adds a component and constraint to the manager. -- TO DO
55: */
56: public void addComponent(SComponent component, Object constraint) {
57: }
58:
59: /**
60: * Remove a component.
61: */
62: public void removeComponent(SComponent component) {
63: }
64:
65: /**
66: * Get the alignment.
67: */
68: public int getAlignment() {
69: return alignment;
70: }
71:
72: /**
73: * Get the gap.
74: */
75: public int getGap() {
76: return gap;
77: }
78:
79: // PRIVATE /////////////////////////////////////////////////////////
80:
81: private int gap;
82: private int alignment;
83:
84: }
|