Statistics
| Revision:

root / import / ext3D / trunk / install-extension3d / IzPack / src / lib / com / izforge / izpack / gui / TwoColumnConstraints.java @ 15280

History | View | Annotate | Download (3.59 KB)

1
/*
2
 * $Id: TwoColumnConstraints.java,v 1.1 2006/06/14 07:29:07 cesar Exp $
3
 * Copyright (C) 2002 Elmar Grom
4
 *
5
 * File :               TwoColumnConstraint.java
6
 * Description :        the constraint class used with TwoColumnLayout
7
 * Author's email :     elmar@grom.net
8
 * Author's Website :   http://www.izforge.com
9
 *
10
 * This program is free software; you can redistribute it and/or
11
 * modify it under the terms of the GNU General Public License
12
 * as published by the Free Software Foundation; either version 2
13
 * of the License, or any later version.
14
 *
15
 * This program is distributed in the hope that it will be useful,
16
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 * GNU General Public License for more details.
19
 *
20
 * You should have received a copy of the GNU General Public License
21
 * along with this program; if not, write to the Free Software
22
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
23
 */
24

    
25
package   com.izforge.izpack.gui;
26

    
27
import java.awt.Component;
28

    
29
/**
30
 * The constraints class to use with <code>TwoColumnLayout</code>.
31
 *
32
 * @see      com.izforge.izpack.gui.TwoColumnLayout
33
 *
34
 * @version  0.0.1 / 11/15/02
35
 * @author   Elmar Grom
36
 */
37
public class TwoColumnConstraints implements Cloneable
38
{
39
  // these numbers are arbitrary - this way, there's a lower chance
40
  // of somebody using the number instead of the symbolic name
41
  public static final int       NORTH       = 9;
42
  public static final int       WEST        = 15;
43
  public static final int       WESTONLY    = 16;
44
  public static final int       EAST        = 26;
45
  public static final int       EASTONLY    = 27;
46
  public static final int       BOTH        = 29;
47
  public static final int       LEFT        = 31;
48
  public static final int       CENTER      = 35;
49
  public static final int       RIGHT       = 47;
50

    
51
  /** Indicates where to place the associated component. <code>NORTH</code>
52
      will place the component in the title margin. </code>WEST</code> will
53
      place the component in the left column and <code>EAST</code> will
54
      place it in the right column. If <code>BOTH</code> is used, the component
55
      will straddle both columns. <code>WESTONLY</code> and <code>EASTONLY</code>
56
      will place the element accordingly but make sure that nothing is placed
57
      in the opposite column. */
58
  public int        position    = WEST;
59
  /** How to align the associated component, <code>LEFT</code>, <code>CENTER</code>
60
      or <code>RIGHT</code>. Note that this setting only taks effect in the
61
      component is placed in the title margin. */
62
  public int        align       = LEFT;
63
  /** If set to true, the indent setting in the layout manager will be applied. */
64
  public boolean    indent      = false;
65
  /** If set to true the associated component will be allowed to stretch to
66
      the width of the entire avaiable space. */
67
  public boolean    stretch     = false;
68

    
69
  /** for private use by the layout manager */
70
  Component         component   = null;
71

    
72
 /**
73
  * Creates a copy of this two column constraint.
74
  *
75
  * @return    a copy of this <code>TwoColumnConstraints</code>
76
  */
77
  public Object clone ()
78
  {
79
    TwoColumnConstraints newObject = new TwoColumnConstraints ();
80

    
81
    newObject.position  = position;
82
    newObject.align     = align;
83
    newObject.indent    = indent;
84
    newObject.stretch   = stretch;
85
    newObject.component = component;
86

    
87
    return (newObject);
88
  }
89
}
90
/*---------------------------------------------------------------------------*/