[izpack-changes] r1526 - in izpack-src/trunk/src/lib/com/izforge/izpack: gui installer
noreply at berlios.de
noreply at berlios.de
Tue Aug 8 16:41:43 CEST 2006
Author: bartzkau
Date: 2006-08-08 16:41:42 +0200 (Tue, 08 Aug 2006)
New Revision: 1526
Modified:
izpack-src/trunk/src/lib/com/izforge/izpack/gui/IzPanelLayout.java
izpack-src/trunk/src/lib/com/izforge/izpack/installer/LayoutHelper.java
Log:
Bugs in the new layout stuff fixed.
Modified: izpack-src/trunk/src/lib/com/izforge/izpack/gui/IzPanelLayout.java
===================================================================
--- izpack-src/trunk/src/lib/com/izforge/izpack/gui/IzPanelLayout.java 2006-08-08 13:35:39 UTC (rev 1525)
+++ izpack-src/trunk/src/lib/com/izforge/izpack/gui/IzPanelLayout.java 2006-08-08 14:41:42 UTC (rev 1526)
@@ -60,6 +60,14 @@
private Insets oldParentInsets;
+ protected static int[] DEFAULT_Y_GAPS = { -1, 0, 5, 5, 10, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0};
+
+ protected static int[] DEFAULT_X_GAPS = { -1, 0, 0, 0, 0, 0, 10, 10, 10, 10, 10, 10, 10, 0};
+
+ protected static int[] DEFAULT_X_ALIGNMENT = { LEFT, LEFT, LEFT, LEFT};
+
+ protected static int[] DEFAULT_Y_ALIGNMENT = { CENTER, CENTER, CENTER, CENTER};
+
/** Array with some default constraints. */
private static IzPanelConstraints DEFAULT_CONSTRAINTS[] = {
// Default constraints for labels.
@@ -86,14 +94,6 @@
};
- protected static int[] DEFAULT_Y_GAPS = { -1, 0, 5, 5, 10, 5, 5, 5, 5, 5, 5, 5, 5, 5, 0};
-
- protected static int[] DEFAULT_X_GAPS = { -1, 0, 0, 0, 0, 0, 10, 10, 10, 10, 10, 10, 10, 0};
-
- protected static int[] DEFAULT_X_ALIGNMENT = { LEFT, LEFT, LEFT, LEFT};
-
- protected static int[] DEFAULT_Y_ALIGNMENT = { CENTER, CENTER, CENTER, CENTER};
-
/** Anchor to be used for the controls in all panels. */
private static int ANCHOR = CENTER;
@@ -626,10 +626,10 @@
offset += curPixel;
if (needsReEvaluation(colConstraints[i].component))
{
- if (oldDim.height != colConstraints[i].component.getPreferredSize().height
- && oldOnceAgain == onceAgain) onceAgain++;
+ if (oldOnceAgain == onceAgain) onceAgain++;
}
}
+
}
// Seems so that height has changed. Reevaluate only one time else it is possible
// to go in a endless loop.
@@ -777,7 +777,6 @@
public void addLayoutComponent(Component comp, Object constraints)
{
if (comp == null) throw new NullPointerException("component has to be not null");
- IzPanelConstraints cc;
if (!(constraints instanceof IzPanelConstraints))
{
Object oldVal = constraints;
@@ -792,10 +791,8 @@
((IzPanelConstraints) constraints).setXPos(0);
((IzPanelConstraints) constraints).setYPos(NEXT_ROW);
}
- cc = (IzPanelConstraints) constraints;
}
- else
- cc = (IzPanelConstraints) ((IzPanelConstraints) constraints).clone();
+ IzPanelConstraints cc = (IzPanelConstraints) ((IzPanelConstraints) constraints).clone();
cc.component = comp;
int i;
// Modify positions if constraint value is one of the symbolic ints.
@@ -1080,7 +1077,7 @@
public static int verifyGapId(int gapId)
{
if (gapId < 0) gapId = -gapId;
- if (gapId <= GAP_LOAD_MARKER || gapId >= DEFAULT_X_GAPS.length)
+ if ( gapId >= DEFAULT_X_GAPS.length)
throw new IndexOutOfBoundsException("gapId is not in the default gap container.");
return (gapId);
}
Modified: izpack-src/trunk/src/lib/com/izforge/izpack/installer/LayoutHelper.java
===================================================================
--- izpack-src/trunk/src/lib/com/izforge/izpack/installer/LayoutHelper.java 2006-08-08 13:35:39 UTC (rev 1525)
+++ izpack-src/trunk/src/lib/com/izforge/izpack/installer/LayoutHelper.java 2006-08-08 14:41:42 UTC (rev 1526)
@@ -76,17 +76,19 @@
* Look-up table for gap identifier to gap names for the x direction. The gap names can be used
* in the XML installation configuration file. Be aware that case sensitivity should be used.
*/
- public final static String[] X_GAP_NAME_LOOK_UP = { "noXGap", "labelXGap", "paragraphXGap",
- "textXGab", "controlXGap", "labelToTextXGap", "labelToControlXGap", "textToLabelXGap",
- "controlToLabelXGap", "controlToTextXGap", "textToControlXGap", "firstXGap"};
+ public final static String[] X_GAP_NAME_LOOK_UP = { "noXGap", "labelXGap", "textXGab",
+ "controlXGap", "paragraphXGap", "labelToTextXGap", "labelToControlXGap",
+ "textToLabelXGap", "controlToLabelXGap", "controlToTextXGap", "textToControlXGap",
+ "firstXGap"};
/**
* Look-up table for gap identifier to gap names for the y direction. The gap names can be used
* in the XML installation configuration file. Be aware that case sensitivity should be used.
*/
- public final static String[] Y_GAP_NAME_LOOK_UP = { "noYGap", "labelYGap", "paragraphYGap",
- "textYGab", "controlYGap", "labelToTextYGap", "labelToControlYGap", "textToLabelYGap",
- "controlToLabelYGap", "controlToTextYGap", "textToControlYGap", "firstYGap"};
+ public final static String[] Y_GAP_NAME_LOOK_UP = { "noYGap", "labelYGap", "textYGab",
+ "controlYGap", "paragraphYGap", "labelToTextYGap", "labelToControlYGap",
+ "textToLabelYGap", "controlToLabelYGap", "controlToTextYGap", "textToControlYGap",
+ "firstYGap"};
/** Identifier of x gap for all default x gaps. */
public final static String ALL_X_GAP = "allXGap";
More information about the izpack-changes
mailing list