|
@@ -137,7 +137,8 @@ public class LoadController {
|
|
|
private void forwardFiles(File folder, String trim) throws IOException {
|
|
|
// TODO Auto-generated method stub
|
|
|
for (File file : folder.listFiles()) {
|
|
|
- File dst = new File(System.getProperty("user.home") + "/.config/HolonGUI/" + file.getPath().replace(trim, ""));
|
|
|
+ File dst = new File(
|
|
|
+ System.getProperty("user.home") + "/.config/HolonGUI/" + file.getPath().replace(trim, ""));
|
|
|
|
|
|
if (file.getName().contains(".json"))
|
|
|
readJson(file.getPath());
|
|
@@ -208,7 +209,7 @@ public class LoadController {
|
|
|
loadUnitGraph(GRAPHTYPE.ELEMENT, json.get(key), null, eleDispatch);
|
|
|
if (key.contains("TRACKED"))
|
|
|
loadTracked(json.get(key), objDispatch);
|
|
|
- if(key.contains("STATSGRAPH"))
|
|
|
+ if (key.contains("STATSGRAPH"))
|
|
|
loadStatisticGraph(json.get(key), objDispatch);
|
|
|
}
|
|
|
|
|
@@ -229,6 +230,7 @@ public class LoadController {
|
|
|
model.setEdgesOnCanvas(new ArrayList<CpsEdge>());
|
|
|
model.setTrackingObj(new ArrayList<>());
|
|
|
model.setStatisticData(new ArrayList<>());
|
|
|
+ model.setHashcodeMap(new HashMap<>());
|
|
|
model.setCanvasX(json.get("CANVAS_SIZE_X").getAsInt());
|
|
|
model.setCanvasX(json.get("CANVAS_SIZE_Y").getAsInt());
|
|
|
IdCounter.setCounter(json.get("IDCOUNTER").getAsInt());
|
|
@@ -238,6 +240,7 @@ public class LoadController {
|
|
|
model.setCvsObjIdx(new HashMap<Integer, Integer>());
|
|
|
model.setObjectsOnCanvas(new ArrayList<AbstractCpsObject>());
|
|
|
model.setEdgesOnCanvas(new ArrayList<CpsEdge>());
|
|
|
+ model.setHashcodeMap(new HashMap<>());
|
|
|
model.setCanvasX(json.get("CANVAS_SIZE_X").getAsInt());
|
|
|
model.setCanvasX(json.get("CANVAS_SIZE_Y").getAsInt());
|
|
|
IdCounter.setCounter(json.get("IDCOUNTER").getAsInt());
|
|
@@ -305,6 +308,10 @@ public class LoadController {
|
|
|
AbstractCpsObject temp = model.getGson().fromJson(jsonElement.getAsJsonObject(), AbstractCpsObject.class);
|
|
|
initObjects(temp);
|
|
|
temp.setImage(checkOS(temp.getImage()));
|
|
|
+ if (temp instanceof CpsUpperNode) {
|
|
|
+ model.getHashcodeMap().put(jsonElement.getAsJsonObject().get("hash").getAsInt(), (CpsUpperNode) temp);
|
|
|
+ ((CpsUpperNode) temp).setLeftBorder(jsonElement.getAsJsonObject().get("properties").getAsJsonObject().get("leftBorder").getAsInt());
|
|
|
+ }
|
|
|
// if its stored before on the canvas just put it there
|
|
|
if (temp.getSav().equals("CVS")) {
|
|
|
cvsC.addObject(temp);
|
|
@@ -465,8 +472,6 @@ public class LoadController {
|
|
|
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
private File readArchive(String path, File src) throws IOException, ArchiveException {
|
|
|
File tmp = Files.createTempDirectory("tmpHolon").toFile();
|
|
|
tmp.deleteOnExit();
|
|
@@ -503,7 +508,8 @@ public class LoadController {
|
|
|
|
|
|
if (os.contains("windows")) {
|
|
|
ret = ret.replace("/", "\\");
|
|
|
- ret = System.getProperty("user.home") + "\\.config" + ret.substring(ret.indexOf("\\HolonGUI\\"), ret.length());
|
|
|
+ ret = System.getProperty("user.home") + "\\.config"
|
|
|
+ + ret.substring(ret.indexOf("\\HolonGUI\\"), ret.length());
|
|
|
|
|
|
}
|
|
|
if (os.contains("mac")) {
|