X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=net.mograsim.logic.ui%2Fsrc%2Fnet%2Fmograsim%2Flogic%2Fui%2Fmodel%2Fcomponents%2FGUIComponentCreator.java;h=76b89190165bffb5ea081859f1814810085127f0;hb=4ac977cb31feb34f24e05e9d5e7976951dccf557;hp=c8e333335a3c12521c55bccb6cdb1396f8e62864;hpb=70d9098dd01dfe29142a4184438175d5a013bb5b;p=Mograsim.git diff --git a/net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/GUIComponentCreator.java b/net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/GUIComponentCreator.java index c8e33333..76b89190 100644 --- a/net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/GUIComponentCreator.java +++ b/net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/GUIComponentCreator.java @@ -1,6 +1,7 @@ package net.mograsim.logic.ui.model.components; import java.io.IOException; +import java.io.InputStream; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import java.util.HashMap; @@ -13,15 +14,13 @@ import net.mograsim.logic.ui.util.JsonHandler; public class GUIComponentCreator { private final static Map componentMapping; - private final static String componentMappingPath = "../net.mograsim.logic.ui.am2900/components/mapping.json"; // TODO: manage this - // somewhere else static { Map tmp; - try + try (InputStream s = GUIComponentCreator.class.getResourceAsStream("./mapping.json")) { - tmp = JsonHandler.readJson(componentMappingPath, Map.class); + tmp = JsonHandler.readJson(s, Map.class); } catch (IOException e) {