001: /*
002: * IzPack - Copyright 2001-2008 Julien Ponge, All Rights Reserved.
003: *
004: * http://izpack.org/
005: * http://izpack.codehaus.org/
006: *
007: * Copyright 2002 Elmar Grom
008: *
009: * Licensed under the Apache License, Version 2.0 (the "License");
010: * you may not use this file except in compliance with the License.
011: * You may obtain a copy of the License at
012: *
013: * http://www.apache.org/licenses/LICENSE-2.0
014: *
015: * Unless required by applicable law or agreed to in writing, software
016: * distributed under the License is distributed on an "AS IS" BASIS,
017: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
018: * See the License for the specific language governing permissions and
019: * limitations under the License.
020: */
021:
022: package com.izforge.izpack.gui;
023:
024: import java.awt.Component;
025:
026: /**
027: * The constraints class to use with <code>TwoColumnLayout</code>.
028: *
029: * @see com.izforge.izpack.gui.TwoColumnLayout
030: *
031: * @version 0.0.1 / 11/15/02
032: * @author Elmar Grom
033: */
034: public class TwoColumnConstraints implements Cloneable {
035:
036: // these numbers are arbitrary - this way, there's a lower chance
037: // of somebody using the number instead of the symbolic name
038: public static final int NORTH = 9;
039:
040: public static final int WEST = 15;
041:
042: public static final int WESTONLY = 16;
043:
044: public static final int EAST = 26;
045:
046: public static final int EASTONLY = 27;
047:
048: public static final int BOTH = 29;
049:
050: public static final int LEFT = 31;
051:
052: public static final int CENTER = 35;
053:
054: public static final int RIGHT = 47;
055:
056: /**
057: * Indicates where to place the associated component. <code>NORTH</code> will place the
058: * component in the title margin. </code>WEST</code> will place the component in the left
059: * column and <code>EAST</code> will place it in the right column. If <code>BOTH</code> is
060: * used, the component will straddle both columns. <code>WESTONLY</code> and <code>EASTONLY</code>
061: * will place the element accordingly but make sure that nothing is placed in the opposite
062: * column.
063: */
064: public int position = WEST;
065:
066: /**
067: * How to align the associated component, <code>LEFT</code>, <code>CENTER</code> or
068: * <code>RIGHT</code>. Note that this setting only taks effect in the component is placed in
069: * the title margin.
070: */
071: public int align = LEFT;
072:
073: /** If set to true, the indent setting in the layout manager will be applied. */
074: public boolean indent = false;
075:
076: /**
077: * If set to true the associated component will be allowed to stretch to the width of the entire
078: * avaiable space.
079: */
080: public boolean stretch = false;
081:
082: /** for private use by the layout manager */
083: Component component = null;
084:
085: /**
086: * Creates a copy of this two column constraint.
087: *
088: * @return a copy of this <code>TwoColumnConstraints</code>
089: */
090: public Object clone() {
091: TwoColumnConstraints newObject = new TwoColumnConstraints();
092:
093: newObject.position = position;
094: newObject.align = align;
095: newObject.indent = indent;
096: newObject.stretch = stretch;
097: newObject.component = component;
098:
099: return (newObject);
100: }
101: }
102: /*---------------------------------------------------------------------------*/
|