41 |
ilm |
1 |
/*
|
|
|
2 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
|
|
|
3 |
*
|
|
|
4 |
* Copyright 2011 OpenConcerto, by ILM Informatique. All rights reserved.
|
|
|
5 |
*
|
|
|
6 |
* The contents of this file are subject to the terms of the GNU General Public License Version 3
|
|
|
7 |
* only ("GPL"). You may not use this file except in compliance with the License. You can obtain a
|
|
|
8 |
* copy of the License at http://www.gnu.org/licenses/gpl-3.0.html See the License for the specific
|
|
|
9 |
* language governing permissions and limitations under the License.
|
|
|
10 |
*
|
|
|
11 |
* When distributing the software, include this License Header Notice in each file.
|
|
|
12 |
*/
|
|
|
13 |
|
|
|
14 |
package org.openconcerto.ui.group;
|
|
|
15 |
|
|
|
16 |
public class LayoutHints {
|
|
|
17 |
|
|
|
18 |
private boolean maximizeWidth;
|
|
|
19 |
private boolean maximizeHeight;
|
|
|
20 |
private boolean showLabel;
|
|
|
21 |
private boolean separated;
|
|
|
22 |
private boolean fill;
|
|
|
23 |
public static final LayoutHints DEFAULT_FIELD_HINTS = new LayoutHints(false, false, true, false);
|
|
|
24 |
public static final LayoutHints DEFAULT_LARGE_FIELD_HINTS = new LayoutHints(true, false, true, false);
|
|
|
25 |
public static final LayoutHints DEFAULT_LIST_HINTS = new LayoutHints(true, true, false, false, true);
|
|
|
26 |
public static final LayoutHints DEFAULT_GROUP_HINTS = new LayoutHints(false, false, false, false);
|
|
|
27 |
public static final LayoutHints DEFAULT_LARGE_GROUP_HINTS = new LayoutHints(true, false, false, false);
|
|
|
28 |
public static final LayoutHints DEFAULT_SEPARATED_GROUP_HINTS = new LayoutHints(true, false, false, true);
|
|
|
29 |
|
|
|
30 |
public LayoutHints(boolean maximizeWidth, boolean maximizeHeight, boolean showLabel, boolean separated) {
|
|
|
31 |
this.maximizeWidth = maximizeWidth;
|
|
|
32 |
this.maximizeHeight = maximizeHeight;
|
|
|
33 |
this.showLabel = showLabel;
|
|
|
34 |
this.separated = separated;
|
|
|
35 |
this.fill = false;
|
|
|
36 |
}
|
|
|
37 |
|
|
|
38 |
public LayoutHints(boolean maximizeWidth, boolean maximizeHeight, boolean showLabel, boolean separated, boolean fill) {
|
|
|
39 |
this.maximizeWidth = maximizeWidth;
|
|
|
40 |
this.maximizeHeight = maximizeHeight;
|
|
|
41 |
this.showLabel = showLabel;
|
|
|
42 |
this.separated = separated;
|
|
|
43 |
this.fill = fill;
|
|
|
44 |
}
|
|
|
45 |
|
|
|
46 |
public boolean maximizeWidth() {
|
|
|
47 |
return maximizeWidth;
|
|
|
48 |
}
|
|
|
49 |
|
|
|
50 |
public boolean maximizeHeight() {
|
|
|
51 |
return maximizeHeight;
|
|
|
52 |
}
|
|
|
53 |
|
|
|
54 |
public boolean showLabel() {
|
|
|
55 |
return showLabel;
|
|
|
56 |
}
|
|
|
57 |
|
|
|
58 |
public boolean isSeparated() {
|
|
|
59 |
return separated;
|
|
|
60 |
}
|
|
|
61 |
|
|
|
62 |
public boolean fill() {
|
|
|
63 |
return fill;
|
|
|
64 |
}
|
|
|
65 |
|
|
|
66 |
@Override
|
|
|
67 |
public String toString() {
|
|
|
68 |
String r = "";
|
|
|
69 |
if (maximizeHeight && maximizeWidth) {
|
|
|
70 |
r += "MaxW&H";
|
|
|
71 |
} else {
|
|
|
72 |
if (maximizeHeight) {
|
|
|
73 |
r += "MaxH";
|
|
|
74 |
}
|
|
|
75 |
if (maximizeWidth) {
|
|
|
76 |
r += "MaxW";
|
|
|
77 |
}
|
|
|
78 |
}
|
|
|
79 |
if (showLabel && separated) {
|
|
|
80 |
r += " SeparatedLabel";
|
|
|
81 |
} else {
|
|
|
82 |
if (showLabel) {
|
|
|
83 |
r += " StdLabel";
|
|
|
84 |
} else {
|
|
|
85 |
r += " NoLabel";
|
|
|
86 |
}
|
|
|
87 |
|
|
|
88 |
}
|
|
|
89 |
if (fill) {
|
|
|
90 |
r += " Fill";
|
|
|
91 |
}
|
|
|
92 |
return r;
|
|
|
93 |
}
|
|
|
94 |
}
|