Ok… tried this and I still am getting absolute pathing in the SVG file:
Here is the SVG Stuff…
public void SVGWriteObject(DomDoc svgDoc, DomElement jGoElementGroup)
{
if (svgDoc.JGoXMLOutputEnabled()) {
DomElement multiPortNode = svgDoc.createJGoClassElement(“com.cloudshield.vppc.CSPortNode”, jGoElementGroup);
if (myIcon != null) {
JGoImage.setDefaultBase(VPPCApp.class.getResource(""));
svgDoc.registerReferencingNode(multiPortNode, "multiporticon", myIcon);
}
}
super.SVGWriteObject(svgDoc, jGoElementGroup);
}
public DomNode SVGReadObject(DomDoc svgDoc, JGoDocument jGoDoc, DomElement svgElement, DomElement jGoChildElement)
{
if (jGoChildElement != null) {
JGoImage.setDefaultBase(VPPCApp.class.getResource(""));
String multiporticon = jGoChildElement.getAttribute(“multiporticon”);
svgDoc.registerReferencingObject(this, “multiporticon”, multiporticon);
super.SVGReadObject(svgDoc, jGoDoc, svgElement, jGoChildElement.getNextSiblingElement());
}
return svgElement.getNextSibling();
}
public void SVGUpdateReference(String attr, Object referencedObject)
{
super.SVGUpdateReference(attr, referencedObject);
if (attr.equals(“multiporticon”)) {
JGoImage.setDefaultBase(VPPCApp.class.getResource(""));
myIcon = (JGoImage)referencedObject;
}
}
Here is how the image is originally created:
public CSPortNode( Point loc, VPPCView parent )
{
super();
view = parent;
init( loc );
}
public void init( Point loc )
{
: : : :
// Set the default pathing for JGoImages
JGoImage.setDefaultBase(VPPCApp.class.getResource(""));
// Load the CS2000 image to make this node look nice
myIcon = new JGoImage();
myIcon.loadImage(this.getClass().getResource(“images/cs2000Box.GIF”), true);
: : : :
}
The resultant SVG snippet:
: : : :
: : : :