KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > izforge > izpack > gui > TwoColumnConstraints


1 /*
2  * IzPack - Copyright 2001-2007 Julien Ponge, All Rights Reserved.
3  *
4  * http://www.izforge.com/izpack/
5  * http://developer.berlios.de/projects/izpack/
6  *
7  * Copyright 2002 Elmar Grom
8  *
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  */

21
22 package com.izforge.izpack.gui;
23
24 import java.awt.Component JavaDoc;
25
26 /**
27  * The constraints class to use with <code>TwoColumnLayout</code>.
28  *
29  * @see com.izforge.izpack.gui.TwoColumnLayout
30  *
31  * @version 0.0.1 / 11/15/02
32  * @author Elmar Grom
33  */

34 public class TwoColumnConstraints implements Cloneable JavaDoc
35 {
36
37     // these numbers are arbitrary - this way, there's a lower chance
38
// of somebody using the number instead of the symbolic name
39
public static final int NORTH = 9;
40
41     public static final int WEST = 15;
42
43     public static final int WESTONLY = 16;
44
45     public static final int EAST = 26;
46
47     public static final int EASTONLY = 27;
48
49     public static final int BOTH = 29;
50
51     public static final int LEFT = 31;
52
53     public static final int CENTER = 35;
54
55     public static final int RIGHT = 47;
56
57     /**
58      * Indicates where to place the associated component. <code>NORTH</code> will place the
59      * component in the title margin. </code>WEST</code> will place the component in the left
60      * column and <code>EAST</code> will place it in the right column. If <code>BOTH</code> is
61      * used, the component will straddle both columns. <code>WESTONLY</code> and <code>EASTONLY</code>
62      * will place the element accordingly but make sure that nothing is placed in the opposite
63      * column.
64      */

65     public int position = WEST;
66
67     /**
68      * How to align the associated component, <code>LEFT</code>, <code>CENTER</code> or
69      * <code>RIGHT</code>. Note that this setting only taks effect in the component is placed in
70      * the title margin.
71      */

72     public int align = LEFT;
73
74     /** If set to true, the indent setting in the layout manager will be applied. */
75     public boolean indent = false;
76
77     /**
78      * If set to true the associated component will be allowed to stretch to the width of the entire
79      * avaiable space.
80      */

81     public boolean stretch = false;
82
83     /** for private use by the layout manager */
84     Component JavaDoc component = null;
85
86     /**
87      * Creates a copy of this two column constraint.
88      *
89      * @return a copy of this <code>TwoColumnConstraints</code>
90      */

91     public Object JavaDoc clone()
92     {
93         TwoColumnConstraints newObject = new TwoColumnConstraints();
94
95         newObject.position = position;
96         newObject.align = align;
97         newObject.indent = indent;
98         newObject.stretch = stretch;
99         newObject.component = component;
100
101         return (newObject);
102     }
103 }
104 /*---------------------------------------------------------------------------*/
105
Popular Tags