View Javadoc

1   /*
2    * Copyright 2002,2004 The Apache Software Foundation.
3    *
4    * Licensed under the Apache License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    *      http://www.apache.org/licenses/LICENSE-2.0
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package org.apache.commons.jelly.tags.swing.impl;
17  
18  import java.awt.Component;
19  import java.awt.GridBagConstraints;
20  
21  /***
22   * A simple class to represent the information for a single cell in a table
23   * when using the GridBagLayout
24   *
25   * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
26   * @version $Revision: 155420 $
27   */
28  public class Cell {
29      private GridBagConstraints constraints;
30      private Component component;
31  
32      public Cell() {
33      }
34  
35      public Cell(GridBagConstraints constraints, Component component) {
36          this.constraints = constraints;
37          this.component = component;
38      }
39  
40      /***
41       * Returns the component.
42       * @return Component
43       */
44      public Component getComponent() {
45          return component;
46      }
47  
48      /***
49       * Returns the constraints.
50       * @return GridBagConstraints
51       */
52      public GridBagConstraints getConstraints() {
53          return constraints;
54      }
55  
56      /***
57       * Sets the component.
58       * @param component The component to set
59       */
60      public void setComponent(Component component) {
61          this.component = component;
62      }
63  
64      /***
65       * Sets the constraints.
66       * @param constraints The constraints to set
67       */
68      public void setConstraints(GridBagConstraints constraints) {
69          this.constraints = constraints;
70      }
71  
72  }