There is an error in the JGoSubGraph SVGReadObject method. You will need to changes the lines in red to be as shown. The variable “jGoChildElement” has been substitute for “svgElement” in these lines. This fix will be in the next release of JGo.
public DomNode SVGReadObject(DomDoc svgDoc, JGoDocument jGoDoc, DomElement svgElement, DomElement jGoChildElement)
{
if (jGoChildElement != null) {
// This is a ListArea element
myLabelSpot = Integer.parseInt(jGoChildElement.getAttribute("labelspot"));
String sCollapsedLabelSpot = jGoChildElement.getAttribute("collapsedlabelspot");
if (sCollapsedLabelSpot.length() > 0)
myCollapsedLabelSpot = Integer.parseInt(sCollapsedLabelSpot);
String sColor = jGoChildElement.getAttribute("backgroundcolor");
if ((sColor.length() > 0) && (sColor.startsWith("rgbalpha"))) {
int nAttStart = sColor.indexOf("(") + 1;
int nAttEnd = sColor.indexOf(",", nAttStart);
String red = sColor.substring(nAttStart, nAttEnd);
nAttStart = nAttEnd + 1;
nAttEnd = sColor.indexOf(",", nAttStart);
String green = sColor.substring(nAttStart, nAttEnd);
nAttStart = nAttEnd + 1;
nAttEnd = sColor.indexOf(",", nAttStart);
String blue = sColor.substring(nAttStart, nAttEnd);
nAttStart = nAttEnd + 1;
nAttEnd = sColor.indexOf(")", nAttStart);
String alpha = sColor.substring(nAttStart, nAttEnd);
myBackgroundColor = new Color( Integer.parseInt(red), Integer.parseInt(green), Integer.parseInt(blue), Integer.parseInt(alpha));
}
String opacity = jGoChildElement.getAttribute("opacity");
if (opacity.length() > 0) {
myOpacity = Double.parseDouble(opacity);
}
String s = jGoChildElement.getAttribute("expanded");
if (s.length() > 0) setState(s.equals("true") ? StateExpanded : StateCollapsed);
s = jGoChildElement.getAttribute("wasexpanded");
if (s.length() > 0) setWasExpanded(s.equals("true"));
s = jGoChildElement.getAttribute("expandedresizable");
if (s.length() > 0) setExpandedResizable(s.equals("true"));
s = jGoChildElement.getAttribute("collapsible");
if (s.length() > 0) setCollapsible(s.equals("true"));
String insets_top = jGoChildElement.getAttribute("insets_top");
if (insets_top.length() > 0) {
myInsets.top = Integer.parseInt(insets_top);
}
String insets_left = jGoChildElement.getAttribute("insets_left");
if (insets_left.length() > 0) {
myInsets.left = Integer.parseInt(insets_left);
}
String insets_bottom = jGoChildElement.getAttribute("insets_bottom");
if (insets_bottom.length() > 0) {
myInsets.bottom = Integer.parseInt(insets_bottom);
}
String insets_right = jGoChildElement.getAttribute("insets_right");
if (insets_right.length() > 0) {
myInsets.right = Integer.parseInt(insets_right);
}
String collapsed_insets_top = jGoChildElement.getAttribute("collapsed_insets_top");
if (collapsed_insets_top.length() > 0) {
myCollapsedInsets.top = Integer.parseInt(collapsed_insets_top);
}
String collapsed_insets_left = jGoChildElement.getAttribute("collapsed_insets_left");
if (collapsed_insets_left.length() > 0) {
myCollapsedInsets.left = Integer.parseInt(collapsed_insets_left);
}
String collapsed_insets_bottom = jGoChildElement.getAttribute("collapsed_insets_bottom");
if (collapsed_insets_bottom.length() > 0) {
myCollapsedInsets.bottom = Integer.parseInt(collapsed_insets_bottom);
}
String collapsed_insets_right = jGoChildElement.getAttribute("collapsed_insets_right");
if (collapsed_insets_right.length() > 0) {
myCollapsedInsets.right = Integer.parseInt(collapsed_insets_right);
}
String subgraphlabel = jGoChildElement.getAttribute("subgraphlabel");
svgDoc.registerReferencingObject(this, "subgraphlabel", subgraphlabel);
String subgraphhandle = jGoChildElement.getAttribute("subgraphhandle");
svgDoc.registerReferencingObject(this, "subgraphhandle", subgraphhandle);
String subgraphport = jGoChildElement.getAttribute("subgraphport");
svgDoc.registerReferencingObject(this, "subgraphport", subgraphport);
String collapsedobject = jGoChildElement.getAttribute("collapsedobject");
svgDoc.registerReferencingObject(this, "collapsedobject", collapsedobject);
if (jGoChildElement.getAttribute("embeddedborderpen").equals("true")) {
svgDoc.SVGTraverseChildren(jGoDoc, jGoChildElement, null, false);
}
String borderpen = jGoChildElement.getAttribute("borderpen");
svgDoc.registerReferencingObject(this, "borderpen", borderpen);
// Read in myBoundsHashtable from three separate lists:
// hashtableobjs: a list of the JGoObjects keys of the hash table
// xPoints: a list of the corresponding x values for the object locations
// yPoints: a list of the corresponding y values for the object locations
String sHashTableObjs = jGoChildElement.getAttribute("hashtableobjs");
while (sHashTableObjs.length() > 0) {
int nEnd = sHashTableObjs.indexOf(" ");
if (nEnd == -1)
nEnd = sHashTableObjs.length();
String sHashTableObj = sHashTableObjs.substring(0, nEnd);
if (nEnd >= sHashTableObjs.length())
sHashTableObjs = "";
else
sHashTableObjs = sHashTableObjs.substring(nEnd + 1);
svgDoc.registerReferencingObject(this, "hashtableobjs", sHashTableObj);
}
int i = 0;
String xPoints = jGoChildElement.getAttribute("xpoints");
String yPoints = jGoChildElement.getAttribute("ypoints");
String wDimensions = jGoChildElement.getAttribute("wdimensions");
String hDimensions = jGoChildElement.getAttribute("hdimensions");
while ((xPoints.length() > 0) && (yPoints.length() > 0)) {
int nEnd = xPoints.indexOf(" ");
if (nEnd == -1)
nEnd = xPoints.length();
String sX = xPoints.substring(0, nEnd);
if (nEnd >= xPoints.length())
xPoints = "";
else
xPoints = xPoints.substring(nEnd + 1);
nEnd = yPoints.indexOf(" ");
if (nEnd == -1)
nEnd = yPoints.length();
String sY = yPoints.substring(0, nEnd);
if (nEnd >= yPoints.length())
yPoints = "";
else
yPoints = yPoints.substring(nEnd + 1);
nEnd = wDimensions.indexOf(" ");
if (nEnd == -1)
nEnd = wDimensions.length();
String sW = wDimensions.substring(0, nEnd);
if (nEnd >= wDimensions.length())
wDimensions = "";
else
wDimensions = wDimensions.substring(nEnd + 1);
nEnd = hDimensions.indexOf(" ");
if (nEnd == -1)
nEnd = hDimensions.length();
String sH = hDimensions.substring(0, nEnd);
if (nEnd >= hDimensions.length())
hDimensions = "";
else
hDimensions = hDimensions.substring(nEnd + 1);
Rectangle r = new Rectangle(Integer.parseInt(sX), Integer.parseInt(sY), Integer.parseInt(sW), Integer.parseInt(sH));
getSavedBounds().put(new Integer(i++), r);
}
super.SVGReadObject(svgDoc, jGoDoc, svgElement, jGoChildElement.getNextSiblingJGoClassElement());
}
return svgElement.getNextSibling();
}