2 |
26 Feb 07 |
jari |
1 |
/* |
2 |
26 Feb 07 |
jari |
Copyright @ 2001-2003, The Institute for Genomic Research (TIGR). |
2 |
26 Feb 07 |
jari |
All rights reserved. |
2 |
26 Feb 07 |
jari |
4 |
*/ |
2 |
26 Feb 07 |
jari |
5 |
|
2 |
26 Feb 07 |
jari |
6 |
package org.tigr.util.awt; |
2 |
26 Feb 07 |
jari |
7 |
|
2 |
26 Feb 07 |
jari |
8 |
import java.awt.Component; |
2 |
26 Feb 07 |
jari |
9 |
import java.awt.Container; |
2 |
26 Feb 07 |
jari |
10 |
import java.awt.GridBagConstraints; |
2 |
26 Feb 07 |
jari |
11 |
import java.awt.Insets; |
2 |
26 Feb 07 |
jari |
12 |
import java.io.Serializable; |
2 |
26 Feb 07 |
jari |
13 |
|
2 |
26 Feb 07 |
jari |
14 |
public final class GBA implements Serializable { |
2 |
26 Feb 07 |
jari |
15 |
public static final int B = GridBagConstraints.BOTH; |
2 |
26 Feb 07 |
jari |
16 |
public static final int C = GridBagConstraints.CENTER; |
2 |
26 Feb 07 |
jari |
17 |
public static final int E = GridBagConstraints.EAST; |
2 |
26 Feb 07 |
jari |
18 |
public static final int H = GridBagConstraints.HORIZONTAL; |
2 |
26 Feb 07 |
jari |
19 |
public static final int NONE = GridBagConstraints.NONE; |
2 |
26 Feb 07 |
jari |
20 |
public static final int N = GridBagConstraints.NORTH; |
2 |
26 Feb 07 |
jari |
21 |
public static final int NE = GridBagConstraints.NORTHEAST; |
2 |
26 Feb 07 |
jari |
22 |
public static final int NW = GridBagConstraints.NORTHWEST; |
2 |
26 Feb 07 |
jari |
23 |
public static final int RELATIVE = GridBagConstraints.RELATIVE; |
2 |
26 Feb 07 |
jari |
24 |
public static final int REMAINDER = GridBagConstraints.REMAINDER; |
2 |
26 Feb 07 |
jari |
25 |
public static final int S = GridBagConstraints.SOUTH; |
2 |
26 Feb 07 |
jari |
26 |
public static final int SE = GridBagConstraints.SOUTHEAST; |
2 |
26 Feb 07 |
jari |
27 |
public static final int SW= GridBagConstraints.SOUTHWEST; |
2 |
26 Feb 07 |
jari |
28 |
public static final int V = GridBagConstraints.VERTICAL; |
2 |
26 Feb 07 |
jari |
29 |
public static final int W = GridBagConstraints.WEST; |
2 |
26 Feb 07 |
jari |
30 |
|
2 |
26 Feb 07 |
jari |
31 |
private static GridBagConstraints c = new GridBagConstraints(); |
2 |
26 Feb 07 |
jari |
32 |
|
2 |
26 Feb 07 |
jari |
33 |
public void add(Container container, Component component, int x, int y, int width, int height) |
2 |
26 Feb 07 |
jari |
34 |
{ |
2 |
26 Feb 07 |
jari |
35 |
c.gridx = x; |
2 |
26 Feb 07 |
jari |
36 |
c.gridy = y; |
2 |
26 Feb 07 |
jari |
37 |
c.gridwidth = width; |
2 |
26 Feb 07 |
jari |
38 |
c.gridheight = height; |
2 |
26 Feb 07 |
jari |
39 |
c.weightx = 0; |
2 |
26 Feb 07 |
jari |
40 |
c.weighty = 0; |
2 |
26 Feb 07 |
jari |
41 |
c.fill = GBA.NONE; |
2 |
26 Feb 07 |
jari |
42 |
c.anchor = GBA.C; |
2 |
26 Feb 07 |
jari |
43 |
c.insets = new Insets(0, 0, 0, 0); |
2 |
26 Feb 07 |
jari |
44 |
c.ipadx = 0; |
2 |
26 Feb 07 |
jari |
45 |
c.ipady = 0; |
2 |
26 Feb 07 |
jari |
46 |
container.add(component, c); |
2 |
26 Feb 07 |
jari |
47 |
} |
2 |
26 Feb 07 |
jari |
48 |
|
2 |
26 Feb 07 |
jari |
49 |
public void add(Container container, Component component, int x, int y, int width, int height, |
2 |
26 Feb 07 |
jari |
50 |
int weightx, int weighty, int fill, int anchor) |
2 |
26 Feb 07 |
jari |
51 |
{ |
2 |
26 Feb 07 |
jari |
52 |
c.gridx = x; |
2 |
26 Feb 07 |
jari |
53 |
c.gridy = y; |
2 |
26 Feb 07 |
jari |
54 |
c.gridwidth = width; |
2 |
26 Feb 07 |
jari |
55 |
c.gridheight = height; |
2 |
26 Feb 07 |
jari |
56 |
c.weightx = weightx; |
2 |
26 Feb 07 |
jari |
57 |
c.weighty = weighty; |
2 |
26 Feb 07 |
jari |
58 |
c.fill = fill; |
2 |
26 Feb 07 |
jari |
59 |
c.anchor = anchor; |
2 |
26 Feb 07 |
jari |
60 |
c.insets = new Insets(0, 0, 0, 0); |
2 |
26 Feb 07 |
jari |
61 |
c.ipadx = 0; |
2 |
26 Feb 07 |
jari |
62 |
c.ipady = 0; |
2 |
26 Feb 07 |
jari |
63 |
container.add(component, c); |
2 |
26 Feb 07 |
jari |
64 |
} |
2 |
26 Feb 07 |
jari |
65 |
|
2 |
26 Feb 07 |
jari |
66 |
public void add(Container container, Component component, int x, int y, int width, int height, |
2 |
26 Feb 07 |
jari |
67 |
int weightx, int weighty, int fill, int anchor, Insets insets, int ipadx, int ipady) |
2 |
26 Feb 07 |
jari |
68 |
{ |
2 |
26 Feb 07 |
jari |
69 |
c.gridx = x; |
2 |
26 Feb 07 |
jari |
70 |
c.gridy = y; |
2 |
26 Feb 07 |
jari |
71 |
c.gridwidth = width; |
2 |
26 Feb 07 |
jari |
72 |
c.gridheight = height; |
2 |
26 Feb 07 |
jari |
73 |
c.weightx = weightx; |
2 |
26 Feb 07 |
jari |
74 |
c.weighty = weighty; |
2 |
26 Feb 07 |
jari |
75 |
c.fill = fill; |
2 |
26 Feb 07 |
jari |
76 |
c.anchor = anchor; |
2 |
26 Feb 07 |
jari |
77 |
c.insets = insets; |
2 |
26 Feb 07 |
jari |
78 |
c.ipadx = ipadx; |
2 |
26 Feb 07 |
jari |
79 |
c.ipady = ipady; |
2 |
26 Feb 07 |
jari |
80 |
container.add(component, c); |
2 |
26 Feb 07 |
jari |
81 |
} |
2 |
26 Feb 07 |
jari |
82 |
|
2 |
26 Feb 07 |
jari |
83 |
public void add(Container container, Component component, int x, int y, int width, int height, |
2 |
26 Feb 07 |
jari |
84 |
int weightx, int weighty, int fill, int anchor, int top, int left, int bottom, int right) |
2 |
26 Feb 07 |
jari |
85 |
{ |
2 |
26 Feb 07 |
jari |
86 |
c.gridx = x; |
2 |
26 Feb 07 |
jari |
87 |
c.gridy = y; |
2 |
26 Feb 07 |
jari |
88 |
c.gridwidth = width; |
2 |
26 Feb 07 |
jari |
89 |
c.gridheight = height; |
2 |
26 Feb 07 |
jari |
90 |
c.weightx = weightx; |
2 |
26 Feb 07 |
jari |
91 |
c.weighty = weighty; |
2 |
26 Feb 07 |
jari |
92 |
c.fill = fill; |
2 |
26 Feb 07 |
jari |
93 |
c.anchor = anchor; |
2 |
26 Feb 07 |
jari |
94 |
c.insets = new Insets(top, left, bottom, right); |
2 |
26 Feb 07 |
jari |
95 |
c.ipadx = 0; |
2 |
26 Feb 07 |
jari |
96 |
c.ipady = 0; |
2 |
26 Feb 07 |
jari |
97 |
container.add(component, c); |
2 |
26 Feb 07 |
jari |
98 |
} |
2 |
26 Feb 07 |
jari |
99 |
|
2 |
26 Feb 07 |
jari |
100 |
public void add(Container container, Component component, int x, int y, int width, int height, |
2 |
26 Feb 07 |
jari |
101 |
int weightx, int weighty, int fill, int anchor, int top, int left, int bottom, int right, |
2 |
26 Feb 07 |
jari |
102 |
int ipadx, int ipady) |
2 |
26 Feb 07 |
jari |
103 |
{ |
2 |
26 Feb 07 |
jari |
104 |
c.gridx = x; |
2 |
26 Feb 07 |
jari |
105 |
c.gridy = y; |
2 |
26 Feb 07 |
jari |
106 |
c.gridwidth = width; |
2 |
26 Feb 07 |
jari |
107 |
c.gridheight = height; |
2 |
26 Feb 07 |
jari |
108 |
c.weightx = weightx; |
2 |
26 Feb 07 |
jari |
109 |
c.weighty = weighty; |
2 |
26 Feb 07 |
jari |
110 |
c.fill = fill; |
2 |
26 Feb 07 |
jari |
111 |
c.anchor = anchor; |
2 |
26 Feb 07 |
jari |
112 |
c.insets = new Insets(top, left, bottom, right); |
2 |
26 Feb 07 |
jari |
113 |
c.ipadx = ipadx; |
2 |
26 Feb 07 |
jari |
114 |
c.ipady = ipady; |
2 |
26 Feb 07 |
jari |
115 |
container.add(component, c); |
2 |
26 Feb 07 |
jari |
116 |
} |
2 |
26 Feb 07 |
jari |
117 |
} |