try {
for (int i = 0; i < horizCount; i++)
h[i] = Integer.parseInt(horiz.nextToken());
for (int i = 0; i < vertCount; i++)
v[i] = Integer.parseInt(vert.nextToken());
HIGLayout layout = new HIGLayout(h, v);
if (!layoutNode.getAttribute("hweights").equals("")) {
StringTokenizer hweights = new StringTokenizer(layoutNode.getAttribute("hweights"), ",");
int hweightsCount = hweights.countTokens();
for (int i = 0; i < hweightsCount; i++) {
layout.setColumnWeight(i + 1, Integer.parseInt(hweights.nextToken()));
}
}
if (!layoutNode.getAttribute("vweights").equals("")) {
StringTokenizer vweights = new StringTokenizer(layoutNode.getAttribute("vweights"), ",");
int vweightsCount = vweights.countTokens();
for (int i = 0; i < vweightsCount; i++) {
layout.setRowWeight(i + 1, Integer.parseInt(vweights.nextToken()));
}
}
return layout;
} catch (NumberFormatException e) {
throw new GUIException("Invalid layout data", e);