mirror of
https://github.com/bancika/diy-layout-creator
synced 2026-11-11 01:32:08 +10:00
Fixed some issues with exporting and importing building blocks and
variants
This commit is contained in:
@@ -30,6 +30,9 @@ public class BuildingBlockPackage {
|
||||
|
||||
private Map<String, List<IDIYComponent<?>>> block;
|
||||
private String owner;
|
||||
|
||||
public BuildingBlockPackage() {
|
||||
}
|
||||
|
||||
public BuildingBlockPackage(Map<String, List<IDIYComponent<?>>> blocks, String owner) {
|
||||
super();
|
||||
|
||||
@@ -30,6 +30,9 @@ public class VariantPackage {
|
||||
|
||||
private Map<String, List<Template>> variants;
|
||||
private String owner;
|
||||
|
||||
public VariantPackage() {
|
||||
}
|
||||
|
||||
public VariantPackage(Map<String, List<Template>> variants, String owner) {
|
||||
super();
|
||||
|
||||
@@ -3009,7 +3009,17 @@ public class Presenter implements IPlugInPort {
|
||||
BufferedInputStream in = new BufferedInputStream(new FileInputStream(fileName));
|
||||
XStream xStream = new XStream(new DomDriver());
|
||||
|
||||
VariantPackage pkg = (VariantPackage) xStream.fromXML(in);
|
||||
VariantPackage pkg;
|
||||
|
||||
try {
|
||||
// old way
|
||||
pkg = (VariantPackage) xStream.fromXML(in);
|
||||
} catch (Exception e) {
|
||||
// new way
|
||||
in = new BufferedInputStream(new FileInputStream(fileName));
|
||||
ProjectFileManager.configure(xStream);
|
||||
pkg = (VariantPackage) xStream.fromXML(in);
|
||||
}
|
||||
|
||||
in.close();
|
||||
|
||||
@@ -3048,7 +3058,17 @@ public class Presenter implements IPlugInPort {
|
||||
BufferedInputStream in = new BufferedInputStream(new FileInputStream(fileName));
|
||||
XStream xStream = new XStream(new DomDriver());
|
||||
|
||||
BuildingBlockPackage pkg = (BuildingBlockPackage) xStream.fromXML(in);
|
||||
BuildingBlockPackage pkg;
|
||||
|
||||
try {
|
||||
// old way
|
||||
pkg = (BuildingBlockPackage) xStream.fromXML(in);
|
||||
} catch (Exception e) {
|
||||
// new way
|
||||
in = new BufferedInputStream(new FileInputStream(fileName));
|
||||
ProjectFileManager.configure(xStream);
|
||||
pkg = (BuildingBlockPackage) xStream.fromXML(in);
|
||||
}
|
||||
|
||||
in.close();
|
||||
|
||||
|
||||
@@ -3418,17 +3418,21 @@
|
||||
<releaseDate>2020-12-28 00:00:00.000 CET</releaseDate>
|
||||
<name></name>
|
||||
<changes>
|
||||
<org.diylc.appframework.update.Change>
|
||||
<changeType>IMPROVEMENT</changeType>
|
||||
<description>When editing component properties, group Length and Width properties together</description>
|
||||
</org.diylc.appframework.update.Change>
|
||||
<org.diylc.appframework.update.Change>
|
||||
<changeType>NEW_FEATURE</changeType>
|
||||
<description>Português translation added (thanks Pedro Rizzi!)</description>
|
||||
</org.diylc.appframework.update.Change>
|
||||
<org.diylc.appframework.update.Change>
|
||||
<changeType>IMPROVEMENT</changeType>
|
||||
<description>When editing component properties, group Length and Width properties together</description>
|
||||
</org.diylc.appframework.update.Change>
|
||||
<org.diylc.appframework.update.Change>
|
||||
<changeType>BUG_FIX</changeType>
|
||||
<description>Rotating 'Neutrik Jack' produces rendering issues</description>
|
||||
</org.diylc.appframework.update.Change>
|
||||
<org.diylc.appframework.update.Change>
|
||||
<changeType>BUG_FIX</changeType>
|
||||
<description>Fixed some issues with exporting and importing building blocks and variants. If you still have issues, your variant/building block files might need to be manually updated to keep working</description>
|
||||
</org.diylc.appframework.update.Change>
|
||||
</changes>
|
||||
<url>https://github.com/bancika/diy-layout-creator/releases</url>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -74,6 +74,7 @@ import org.diylc.netlist.Group;
|
||||
import org.diylc.netlist.Netlist;
|
||||
import org.diylc.netlist.Summary;
|
||||
import org.diylc.presenter.Presenter;
|
||||
import org.diylc.serialization.ProjectFileManager;
|
||||
import org.diylc.swing.gui.DialogFactory;
|
||||
import org.diylc.swing.gui.editor.PropertyEditorDialog;
|
||||
import org.diylc.swing.images.IconLoader;
|
||||
@@ -856,6 +857,7 @@ public class ActionFactory {
|
||||
try {
|
||||
BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(file));
|
||||
XStream xStream = new XStream(new DomDriver());
|
||||
ProjectFileManager.configure(xStream);
|
||||
xStream.toXML(variantPkg, out);
|
||||
out.close();
|
||||
LOG.info("Exported variants succesfully");
|
||||
@@ -1012,6 +1014,7 @@ public class ActionFactory {
|
||||
try {
|
||||
BufferedOutputStream out = new BufferedOutputStream(new FileOutputStream(file));
|
||||
XStream xStream = new XStream(new DomDriver());
|
||||
ProjectFileManager.configure(xStream);
|
||||
xStream.toXML(variantPkg, out);
|
||||
out.close();
|
||||
LOG.info("Exported building blocks succesfully");
|
||||
|
||||
Reference in New Issue
Block a user