Skip to content

Commit

Permalink
save PreviewWidgets to workflow.ifw
Browse files Browse the repository at this point in the history
  • Loading branch information
Dahie committed Apr 21, 2011
1 parent 67bfc39 commit eb537e0
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/de/danielsenff/imageflow/controller/WorkflowXMLBuilder.java
Expand Up @@ -491,11 +491,11 @@ public void write(final File file) throws IOException {
UnitElement unit = (UnitElement) node;
if(unit.hasWidget()) { // properties widget
widgetElement = new Element("Widget");
writeXMLWidget(unit, widgetElement);
writeXMLWidget(unit, widgetElement, unit.getWidget());
widgets.addContent(widgetElement);
} else if(unit.hasPreviewWidget()) { // preview widget
widgetElement = new Element("PreviewWidget");
writeXMLWidget(unit, widgetElement);
writeXMLWidget(unit, widgetElement, unit.getPreviewWidget());
widgets.addContent(widgetElement);
}
}
Expand All @@ -508,8 +508,7 @@ public void write(final File file) throws IOException {
}


private void writeXMLWidget(UnitElement unit, Element widgetElement) {
JComponent widget = unit.getWidget();
private void writeXMLWidget(UnitElement unit, Element widgetElement, JComponent widget) {

// id of the unit this widget is attached to
Element unitID = new Element("UnitID");
Expand All @@ -518,14 +517,12 @@ private void writeXMLWidget(UnitElement unit, Element widgetElement) {

// id of the unit this widget is attached to
Element xPos = new Element("XPos");
xPos.addContent(widget.getLocation().y+"");
xPos.addContent(widget.getLocation().x+"");
widgetElement.addContent(xPos);

Element yPos = new Element("YPos");
yPos.addContent(widget.getLocation().y+"");
widgetElement.addContent(yPos);


}


Expand Down

0 comments on commit eb537e0

Please sign in to comment.