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=64031e27d6b607e5475d081f93581960ef5a82b4;hp=3a2342802e8c8a76943173662722108d2a2a9bf8;hpb=5409a6e27afdeb1c318bd185e43b476a360625c7;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 3a234280..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,14 +14,13 @@ import net.mograsim.logic.ui.util.JsonHandler; public class GUIComponentCreator { private final static Map componentMapping; - private final static String componentMappingPath = "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) {