1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.apache.commons.jelly.tags.swing;
17
18 import java.awt.BorderLayout;
19 import java.awt.LayoutManager;
20
21 import org.apache.commons.logging.Log;
22 import org.apache.commons.logging.LogFactory;
23
24 /***
25 * A Layout tag which uses nested <borderAlign> tags to implement a BorderLayout
26 *
27 * @author <a href="mailto:jstrachan@apache.org">James Strachan</a>
28 * @version $Revision: 155420 $
29 */
30 public class BorderLayoutTag extends LayoutTagSupport {
31
32 /*** The Log to which logging calls will be made. */
33 private static final Log log = LogFactory.getLog(LayoutTagSupport.class);
34
35 private int hgap;
36 private int vgap;
37
38 public BorderLayoutTag() {
39 }
40
41
42
43
44 /***
45 * Returns the hgap.
46 * @return int
47 */
48 public int getHgap() {
49 return hgap;
50 }
51
52 /***
53 * Returns the vgap.
54 * @return int
55 */
56 public int getVgap() {
57 return vgap;
58 }
59
60 /***
61 * Sets the horizontal gap in pixels.
62 */
63 public void setHgap(int hgap) {
64 this.hgap = hgap;
65 }
66
67 /***
68 * Sets the vertical gap in pixels
69 */
70 public void setVgap(int vgap) {
71 this.vgap = vgap;
72 }
73
74
75
76
77 /***
78 * Creates a BorderLayout
79 */
80 protected LayoutManager createLayoutManager() {
81 return new BorderLayout(hgap, vgap);
82 }
83 }