Willi Zschiebsch 4 anni fa
parent
commit
9b3a25de26

+ 26 - 14
src/main/java/mdd/client/Client.java

@@ -42,6 +42,24 @@ public class Client implements IGUIEventClient
         //System.out.println("State : " + jmsg.toString());
     }
 
+    private void processChangeResponse(JSONObject jchange){
+        String soper = (String)jchange.get("operation");
+        if (soper.equals("change")){
+            JSONObject jargs = (JSONObject) jchange.get("args");
+            if (jargs != null){
+                JSONObject jobj = (JSONObject) jargs.get("object");
+                if (jobj != null){
+                    if (jobj.containsKey("GUI")){
+                        _eventHandler.publishEvent(5,"change", jchange);
+                    }
+                }
+            }
+        }
+        else {
+            _eventHandler.publishEvent("change", jchange);
+        }
+    }
+
     private void listen(){
         while (!Thread.currentThread().isInterrupted()) {
             // Read envelope with address
@@ -65,22 +83,16 @@ public class Client implements IGUIEventClient
                     Platform.runLater(new Runnable() {
                                           @Override
                                           public void run() {
-                                              JSONObject jchange = (JSONObject) finalJmsg.get("change");
-                                              String soper = (String)jchange.get("operation");
-                                              if (soper.equals("change")){
-                                                  JSONObject jargs = (JSONObject) jchange.get("args");
-                                                  if (jargs != null){
-                                                      JSONObject jobj = (JSONObject) jargs.get("object");
-                                                      if (jobj != null){
-                                                          if (jobj.containsKey("GUI")){
-                                                              _eventHandler.publishEvent(5,"change", jchange);
-                                                          }
-                                                      }
+                                              if (finalJmsg.get("change") instanceof JSONArray){
+                                                  JSONArray jarray = (JSONArray) finalJmsg.get("change");
+                                                  for(int i = 0; i < jarray.size(); ++i){
+                                                      processChangeResponse((JSONObject)jarray.get(i));
                                                   }
+                                              }else{
+                                                  JSONObject jchange = (JSONObject) finalJmsg.get("change");
+                                                  processChangeResponse(jchange);
                                               }
-                                              else {
-                                                  _eventHandler.publishEvent("change", jchange);
-                                              }
+
                                               //System.out.println("[Client] " + "change: " + finalJmsg.toString());
                                               ++msg_counter;
                                           }

+ 45 - 16
src/main/java/mdd/client/Module.java

@@ -39,7 +39,7 @@ public class Module extends Group implements IGUIEventClient, ChangeListener<Bou
     private Point2D _pos = new Point2D(0.0f,0.0f);
     private Rectangle titlebar;
     private Rectangle background;
-    private Text caption;
+    private Label caption;
     protected GUIEventHandler _eventHandler;
 
     public String Name = "TEST";
@@ -59,6 +59,8 @@ public class Module extends Group implements IGUIEventClient, ChangeListener<Bou
     public VBox outputs = new VBox();
     public boolean isSelected = false;
 
+    protected boolean moveable = true;
+
     public Module(JSONObject json){
         setFocusTraversable(true);
         _eventHandler = GUIEventHandler.getEventHandler();
@@ -89,11 +91,11 @@ public class Module extends Group implements IGUIEventClient, ChangeListener<Bou
         background.setArcWidth(10.0f);
         background.setArcHeight(10.0f);
         background.setFill(Color.GRAY);
-        caption = new Text(Name);
+        caption = new Label();
+        caption.setText(Name);
         caption.setFont(new Font("Arial", 15));
         caption.getStyleClass().add("text");
-        caption.setX(10);
-        caption.setY(15);
+        caption.setTranslateX(10);
 
         Color color = Color.DARKCYAN;
         titlebar.setFill(color);
@@ -115,13 +117,16 @@ public class Module extends Group implements IGUIEventClient, ChangeListener<Bou
             e.consume();
         });
 
+
         addEventHandler(MouseEvent.MOUSE_DRAGGED, e -> {
             // System.out.println("[Module]: dragg event detected!");
             if(e.getButton() == MouseButton.PRIMARY) {
-                if (isSelected){
-                    setTranslateX(getTranslateX()+(e.getSceneX()-_pos.getX()));
-                    setTranslateY(getTranslateY()+(e.getSceneY()-_pos.getY()));
-                    _pos = new Point2D( e.getSceneX(),  e.getSceneY());
+                if (moveable) {
+                    if (isSelected) {
+                        setTranslateX(getTranslateX() + (e.getSceneX() - _pos.getX()));
+                        setTranslateY(getTranslateY() + (e.getSceneY() - _pos.getY()));
+                        _pos = new Point2D(e.getSceneX(), e.getSceneY());
+                    }
                 }
             }
             if(e.getButton() == MouseButton.SECONDARY) {
@@ -129,10 +134,11 @@ public class Module extends Group implements IGUIEventClient, ChangeListener<Bou
             }
         });
 
+
         addEventHandler(MouseEvent.MOUSE_RELEASED, e -> {
             // System.out.println("[Module]: dragg event detected!");
             if(e.getButton() == MouseButton.PRIMARY) {
-                if (isSelected){
+                if (isSelected && moveable){
                     JSONObject jgui_args = new JSONObject();
                     jgui_args.put("posX", getTranslateX());
                     jgui_args.put("posY", getTranslateY());
@@ -153,6 +159,7 @@ public class Module extends Group implements IGUIEventClient, ChangeListener<Bou
         });
 
         vlayout.layoutBoundsProperty().addListener(this);
+        //caption.layoutBoundsProperty().addListener(this);
     }
 
     public void configure(JSONObject json){
@@ -215,11 +222,13 @@ public class Module extends Group implements IGUIEventClient, ChangeListener<Bou
             if (jgui.containsKey("color")) {
                 titlebar.setFill(Color.web(((JSONObject)jgui.get("color")).get("value").toString()));
             }
-            if (jgui.containsKey("posX")){
-                setTranslateX((double)jgui.get("posX"));
-            }
-            if (jgui.containsKey("posY")) {
-                setTranslateY((double) jgui.get("posY"));
+            if (moveable) {
+                if (jgui.containsKey("posX")) {
+                    setTranslateX((double) jgui.get("posX"));
+                }
+                if (jgui.containsKey("posY")) {
+                    setTranslateY((double) jgui.get("posY"));
+                }
             }
         }
     }
@@ -356,9 +365,29 @@ public class Module extends Group implements IGUIEventClient, ChangeListener<Bou
 
     @Override
     public void changed(ObservableValue<? extends Bounds> observable, Bounds oldValue, Bounds newValue) {
-        titlebar.setWidth(newValue.getWidth()+10);
+        if (caption.getText().equals("Switch")){
+            double test0 = caption.getLayoutY();
+            double test1 = caption.getLayoutBounds().getWidth();
+            double test2 = caption.getWidth();
+            double test3 = caption.prefWidth(-1);
+            double test10 = vlayout.getLayoutBounds().getWidth();
+            int ftest = 0;
+        }
+        double width = caption.getWidth();
+        if (newValue.getWidth() > width){
+            width =newValue.getWidth();
+            width += 10;
+            outputs.setTranslateX(13);
+        }else{
+            //if (!caption.getText().equals("Switch") && !caption.getText().equals("Processor")){
+                width += 10;
+                outputs.setTranslateX(13+(width - vlayout.getLayoutBounds().getWidth()));
+                width +=10;
+            //}
+        }
+        titlebar.setWidth(width);
         titlebar.setHeight(20.0f);
-        background.setWidth(newValue.getWidth()+10);
+        background.setWidth(width);
         background.setHeight(newValue.getHeight()+vlayout.getTranslateY()+10);
     }
 }

+ 188 - 85
src/main/java/mdd/client/Processor.java

@@ -4,10 +4,8 @@ import javafx.collections.ObservableList;
 import javafx.scene.Group;
 import javafx.scene.Node;
 import javafx.scene.input.*;
-import mdd.client.connectable.Connectable;
-import mdd.client.connectable.Connection;
-import mdd.client.connectable.Input;
-import mdd.client.connectable.Output;
+import javafx.scene.layout.VBox;
+import mdd.client.connectable.*;
 import org.json.simple.JSONArray;
 import org.json.simple.JSONObject;
 import org.json.simple.parser.JSONParser;
@@ -16,9 +14,11 @@ import org.json.simple.parser.ParseException;
 import java.util.Vector;
 
 public class Processor extends Module{
-    private Group modules = new Group();
-    private Group connections = new Group();
-    public Group all = new Group(connections, modules);
+    public Group modules;
+    public VBox params_in;
+    public VBox params_out;
+    public Group connections;
+    public Group all;
 
 
     private boolean detected_drag = false;
@@ -30,32 +30,6 @@ public class Processor extends Module{
         super(json);
         Type = "processor";
 
-        if (json.containsKey("modules")){
-            for (Object o : (JSONArray) json.get("modules")){
-                JSONObject jobj = (JSONObject) o;
-                if (jobj.get("type").equals("module")){
-                    modules.getChildren().add(new Module(jobj));
-                }else if(jobj.get("type").equals("processor")){
-                    modules.getChildren().add(new Processor(jobj));
-                }
-            }
-        }
-
-        if (json.containsKey("connections")){
-            for (Object o : (JSONArray) json.get("connections")){
-                JSONObject jobj = (JSONObject) o;
-                JSONObject jout = (JSONObject)jobj.get("output");
-                for (Object ins : (JSONArray) jobj.get("inputs")){
-                    JSONObject jin = (JSONObject) ins;
-                    //TODO update prefix
-                    int lsize = ((JSONArray)jin.get("prefix")).size()-1;
-                    Input in = getModule(((JSONArray)jin.get("prefix")).get(lsize).toString()).getInput(jin.get("name").toString()+jin.get("appendix").toString());
-                    Output out = getModule(((JSONArray)jout.get("prefix")).get(lsize).toString()).getOutput(jout.get("name").toString()+jout.get("appendix").toString());
-                    connections.getChildren().add(new Connection(in, out));
-                }
-            }
-        }
-
         modules.addEventHandler(MouseEvent.DRAG_DETECTED, e -> {
             // System.out.println("[Module]: dragg event detected!");
             if(e.getButton() == MouseButton.PRIMARY) {
@@ -112,7 +86,7 @@ public class Processor extends Module{
                             String type = jobj.get("type").toString();
                             JSONArray jprefix = (JSONArray)jobj.get("prefix");
                             String sparent = jprefix.get(jprefix.size()-1).toString();
-                            String sID = jobj.get("name").toString()+jobj.get("appendix").toString();
+                            String sID = jobj.get("key").toString()+jobj.get("appendix").toString();
                             if (type.equals("input")) {
                                 System.out.println("[Processor] Dropped found type = " + "INPUT");
                                 in = getModule(sparent).getInput(sID);
@@ -148,6 +122,89 @@ public class Processor extends Module{
         });
     }
 
+    @Override
+    public void configure(JSONObject json){
+        super.configure(json);
+        if (!json.containsKey("modules") && !json.containsKey("params") && !json.containsKey("connections")){return;}
+        if (modules == null){
+            modules = new Group();
+            params_in = new VBox();
+            params_out = new VBox();
+            connections = new Group();
+            all = new Group();
+            all.getChildren().addAll(connections, modules);
+        }
+        else{
+            modules.getChildren().clear();
+            params_in.getChildren().clear();
+            params_out.getChildren().clear();
+            connections.getChildren().clear();
+        }
+
+        if (json.containsKey("modules")){
+            for (Object o : (JSONArray) json.get("modules")){
+                JSONObject jobj = (JSONObject) o;
+                if (jobj.get("type").equals("module")){
+                    modules.getChildren().add(new Module(jobj));
+                }else if(jobj.get("type").equals("processor")){
+                    modules.getChildren().add(new Processor(jobj));
+                }
+            }
+        }
+
+
+        if (json.containsKey("params")){
+            JSONObject jparam = (JSONObject)json.get("params");
+            //inputs
+            if (jparam.containsKey("inputs")){
+                if (jparam.get("inputs") != null){
+                    JSONArray jparam_in = (JSONArray)jparam.get("inputs");
+                    for (int i = 0; i < jparam_in.size(); ++i){
+                        JSONObject jmod = (JSONObject)jparam_in.get(i);
+                        jmod.put("inputs", null);
+                        params_in.getChildren().add(new Parameter(jmod));
+                    }
+                }
+            }
+            //outputs
+            if (jparam.containsKey("outputs")){
+                if (jparam.get("outputs") != null){
+                    JSONArray jparam_out = (JSONArray)jparam.get("outputs");
+                    for (int i = 0; i < jparam_out.size(); ++i){
+                        JSONObject jmod = (JSONObject)jparam_out.get(i);
+                        jmod.put("outputs", null);
+                        params_out.getChildren().add(new Parameter(jmod));
+                    }
+                }
+            }
+        }
+
+
+        if (json.containsKey("connections")){
+            for (Object o : (JSONArray) json.get("connections")){
+                JSONObject jobj = (JSONObject) o;
+                JSONObject jout = (JSONObject)jobj.get("output");
+                for (Object ins : (JSONArray) jobj.get("inputs")){
+                    JSONObject jin = (JSONObject) ins;
+                    //TODO update prefix
+                    int lsize = ((JSONArray)jin.get("prefix")).size()-1;
+                    Module min = getModule(((JSONArray)jin.get("prefix")).get(lsize).toString());
+                    Module mout = getModule(((JSONArray)jout.get("prefix")).get(lsize).toString());
+                    Input in = min.getInput(jin.get("key").toString()+jin.get("appendix").toString());
+                    Output out = mout.getOutput(jout.get("key").toString()+jout.get("appendix").toString());
+                    Connection con = new Connection(in, out);
+                    if (min instanceof Parameter || mout instanceof Parameter){
+                        con.setVisible(false);
+                        con.setManaged(false);
+                    }
+                    connections.getChildren().add(con);
+                }
+            }
+        }
+
+
+    }
+
     public Module getModule(String id){
         for (Node node : modules.getChildren()){
             if (node instanceof Module){
@@ -157,6 +214,22 @@ public class Processor extends Module{
                 }
             }
         }
+        for (Node node : params_in.getChildren()){
+            if (node instanceof Module){
+                Module m = (Module)node;
+                if (m.ID.equals(id)){
+                    return m;
+                }
+            }
+        }
+        for (Node node : params_out.getChildren()){
+            if (node instanceof Module){
+                Module m = (Module)node;
+                if (m.ID.equals(id)){
+                    return m;
+                }
+            }
+        }
         return null;
     }
 
@@ -181,6 +254,36 @@ public class Processor extends Module{
         }
     }
 
+    @Override
+    public void close() throws Exception {
+        super.close();
+        for (int i = 0; i < connections.getChildren().size(); ++i)
+        {
+            try {
+                ((Connectable)modules.getChildren().get(i)).close();
+            }
+            catch (Exception e){
+
+            }
+        }
+        for (int i = 0; i < modules.getChildren().size(); ++i)
+        {
+            try {
+                Object obj = modules.getChildren().get(i);
+                if (obj instanceof Processor){
+                    ((Processor)obj).close();
+                }
+                else {
+                    ((Module)obj).close();
+                }
+                modules.getChildren().remove(i);
+            }
+            catch (Exception e){
+
+            }
+        }
+    }
+
     @Override
     public void processGUIEvent(String event, JSONObject args) {
         super.processGUIEvent(event, args);
@@ -192,7 +295,6 @@ public class Processor extends Module{
                     JSONObject json = new JSONObject();
                     json.put("path", getAsPrefix());
                     _eventHandler.publishEvent("OPEN_PROCESSOR", json);
-                    System.out.println("[Processor]: published");
                 }
                 return;
             }
@@ -249,8 +351,8 @@ public class Processor extends Module{
                             JSONObject jin = (JSONObject)jobj.get("input");
                             JSONObject jout = (JSONObject)jobj.get("output");
                             int lsize = ((JSONArray)jin.get("prefix")).size()-1;
-                            Input in = getModule(((JSONArray)jin.get("prefix")).get(lsize).toString()).getInput(jin.get("name").toString()+jin.get("appendix").toString());
-                            Output out = getModule(((JSONArray)jout.get("prefix")).get(lsize).toString()).getOutput(jout.get("name").toString()+jout.get("appendix").toString());
+                            Input in = getModule(((JSONArray)jin.get("prefix")).get(lsize).toString()).getInput(jin.get("key").toString()+jin.get("appendix").toString());
+                            Output out = getModule(((JSONArray)jout.get("prefix")).get(lsize).toString()).getOutput(jout.get("key").toString()+jout.get("appendix").toString());
                             if (in != null && out != null) {
                                 if (in.isConnected()) {
                                     for (int i = 0; i < connections.getChildren().size(); ++i) {
@@ -266,70 +368,71 @@ public class Processor extends Module{
                             connections.getChildren().add(new Connection(in, out));
                             break;
                         case "module":
-                            modules.getChildren().add(new Module(jobj));
+                            if (jobj.get("key").toString().equals("Parameter")){
+                                params_in.getChildren().add(new Module(jobj));
+                            }else {
+                                modules.getChildren().add(new Module(jobj));
+                            }
                             break;
                         case "processor":
                             modules.getChildren().add(new Processor(jobj));
                             break;
                     }
                     break;
+                case "change":
+                    configure(jobj);
+                    break;
                 case "remove":
-                    switch (jobj.get("type").toString()) {
-                        case "module":
-                            ObservableList gmodule = modules.getChildren();
-                            for (int i = 0; i < gmodule.size(); ++i) {
-                                JSONObject json = ((Module) gmodule.get(i)).getJSONIdentifier();
-                                if (json.equals(jobj)) {
-                                    ObservableList gin = ((Module) gmodule.get(i)).inputs.getChildren();
-                                    for (int j = 0; j < gin.size(); ++j){
-                                        Input in = (Input)gin.get(j);
-                                        if (in.isConnected()){
-                                            ObservableList gcon = connections.getChildren();
-                                            for (int k = 0; k < gcon.size(); ++k){
-                                                Connection con = (Connection)gcon.get(k);
-                                                if (con.in == in){
-                                                    try {
-                                                        con.close();
-                                                    } catch (Exception e) {
-                                                        //e.printStackTrace();
-                                                    }
-                                                    gcon.remove(k);
-                                                    break;
-                                                }
+                    ObservableList gmodule = modules.getChildren();
+                    for (int i = 0; i < gmodule.size(); ++i) {
+                        JSONObject json = ((Module) gmodule.get(i)).getJSONIdentifier();
+                        if (json.equals(jobj)) {
+                            ObservableList gin = ((Module) gmodule.get(i)).inputs.getChildren();
+                            for (int j = 0; j < gin.size(); ++j){
+                                Input in = (Input)gin.get(j);
+                                if (in.isConnected()){
+                                    ObservableList gcon = connections.getChildren();
+                                    for (int k = 0; k < gcon.size(); ++k){
+                                        Connection con = (Connection)gcon.get(k);
+                                        if (con.in == in){
+                                            try {
+                                                con.close();
+                                            } catch (Exception e) {
+                                                //e.printStackTrace();
                                             }
+                                            gcon.remove(k);
+                                            break;
                                         }
                                     }
-                                    ObservableList gout = ((Module) gmodule.get(i)).outputs.getChildren();
-                                    for (int j = 0; j < gout.size(); ++j){
-                                        Output out = (Output)gout.get(j);
-                                        if (out.isConnected()){
-                                            ObservableList gcon = connections.getChildren();
-                                            for (int k = 0; k < gcon.size(); ++k){
-                                                Connection con = (Connection)gcon.get(k);
-                                                if (con.out == out){
-                                                    try {
-                                                        con.close();
-                                                    } catch (Exception e) {
-                                                        //e.printStackTrace();
-                                                    }
-                                                    gcon.remove(k);
-                                                }
+                                }
+                            }
+                            ObservableList gout = ((Module) gmodule.get(i)).outputs.getChildren();
+                            for (int j = 0; j < gout.size(); ++j){
+                                Output out = (Output)gout.get(j);
+                                if (out.isConnected()){
+                                    ObservableList gcon = connections.getChildren();
+                                    for (int k = 0; k < gcon.size(); ++k){
+                                        Connection con = (Connection)gcon.get(k);
+                                        if (con.out == out){
+                                            try {
+                                                con.close();
+                                            } catch (Exception e) {
+                                                //e.printStackTrace();
                                             }
+                                            gcon.remove(k);
                                         }
                                     }
-                                    try {
-                                        ((Module) gmodule.get(i)).close();
-                                    } catch (Exception e) {
-                                        //e.printStackTrace();
-                                    }
-                                    modules.getChildren().remove(i);
-                                    break;
                                 }
                             }
+                            try {
+                                ((Module) gmodule.get(i)).close();
+                            } catch (Exception e) {
+                                //e.printStackTrace();
+                            }
+
+                            modules.getChildren().remove(i);
                             break;
-                        case "processor":
-                            modules.getChildren().add(new Processor(jobj));
-                            break;
+                        }
                     }
                     break;
                 }

+ 13 - 2
src/main/java/mdd/client/WorkBench.java

@@ -1,9 +1,14 @@
 package mdd.client;
 
+import javafx.beans.value.ChangeListener;
+import javafx.beans.value.ObservableValue;
 import javafx.geometry.Point2D;
 import javafx.scene.control.ScrollPane;
+import javafx.scene.control.SplitPane;
 import javafx.scene.control.Tab;
 import javafx.scene.input.*;
+import javafx.scene.layout.GridPane;
+import mdd.client.connectable.ParameterList;
 import org.json.simple.JSONObject;
 import org.json.simple.parser.JSONParser;
 import org.json.simple.parser.ParseException;
@@ -13,6 +18,8 @@ public class WorkBench extends Tab implements IGUIEventClient{
     public Processor _processor;
     private Point2D _pos = new Point2D(0.0f,0.0f);
     private GUIEventHandler _eventHandler;
+    private SplitPane _sp_in_main_out;
+    private ParameterList _gp_in, _gp_out;
 
     public WorkBench(Processor processor){
         super(processor.Name);
@@ -21,9 +28,13 @@ public class WorkBench extends Tab implements IGUIEventClient{
         _eventHandler.addEventListener(this);
         _processor = processor;
         setId(_processor.getAsPrefix().toString());
+        _sp_in_main_out = new SplitPane();
         _scrollPane = new ScrollPane(_processor.all);
-        setContent(_scrollPane);
-        //setContent(_processor.all);
+        _gp_in = new ParameterList(_processor, "input");
+        _gp_out = new ParameterList(_processor, "output");
+        _sp_in_main_out.getItems().addAll(_gp_in, _scrollPane,_gp_out);
+        _sp_in_main_out.setDividerPositions(0.1f, 0.9f);
+        setContent(_sp_in_main_out);
 
         _scrollPane.addEventHandler(DragEvent.DRAG_DROPPED, e -> {
             Dragboard db = e.getDragboard();

+ 19 - 0
src/main/java/mdd/client/Workshop.java

@@ -100,6 +100,25 @@ public class Workshop extends TabPane implements IGUIEventClient {
             _main_processor = new Processor(args);
             showMainProcessor();
         }
+        if (event.equals("change")) {
+            if (!args.containsKey("operation")) {
+                return;
+            }
+            if (args.get("operation").toString().equals("remove")) {
+                if (!args.containsKey("args")) {
+                    return;
+                }
+                JSONObject jargs = (JSONObject) args.get("args");
+                JSONObject jobj = (JSONObject) jargs.get("object");
+                for (int i = 0; i < getTabs().size(); ++i){
+                    JSONObject json = ((WorkBench)getTabs().get(i))._processor.getJSONIdentifier();
+                    if (json.equals(jobj)) {
+                        getTabs().remove(i);
+                        break;
+                    }
+                }
+            }
+        }
 
     }
 }

+ 12 - 0
src/main/java/mdd/client/connectable/Parameter.java

@@ -0,0 +1,12 @@
+package mdd.client.connectable;
+
+import mdd.client.Module;
+import org.json.simple.JSONObject;
+
+public class Parameter extends Module {
+
+    public Parameter(JSONObject json){
+        super(json);
+        moveable = false;
+    }
+}

+ 106 - 0
src/main/java/mdd/client/connectable/ParameterList.java

@@ -0,0 +1,106 @@
+package mdd.client.connectable;
+
+import javafx.scene.Group;
+import javafx.scene.control.ScrollPane;
+import javafx.scene.input.DragEvent;
+import javafx.scene.input.Dragboard;
+import javafx.scene.input.TransferMode;
+import javafx.scene.layout.GridPane;
+import javafx.scene.layout.VBox;
+import mdd.client.GUIEventHandler;
+import mdd.client.IGUIEventClient;
+import mdd.client.Module;
+import mdd.client.Processor;
+import org.json.simple.JSONArray;
+import org.json.simple.JSONObject;
+import org.json.simple.parser.JSONParser;
+import org.json.simple.parser.ParseException;
+
+
+public class ParameterList extends ScrollPane implements IGUIEventClient {
+    private GUIEventHandler _eventHandler;
+    public Processor _processor;
+    private VBox params = new VBox();
+    private String _type;
+
+    public ParameterList(Processor processor, String type){
+        _type = type;
+        _processor = processor;
+        _eventHandler = GUIEventHandler.getEventHandler();
+        if (_type.equals("input")){
+            params = _processor.params_in;
+        }else {
+            params = _processor.params_out;
+        }
+
+        this.setContent(params);
+
+        addEventHandler(DragEvent.DRAG_OVER, e -> {
+            Dragboard db = e.getDragboard();
+            if (db.hasString()) {
+                JSONParser parser = new JSONParser();
+                JSONObject jmsg = null;
+                try {
+                    jmsg = (JSONObject)parser.parse(db.getString());
+                } catch (ParseException parseException) {
+                    parseException.printStackTrace();
+                }
+                if (!jmsg.containsKey("type")){
+                    return;
+                }
+                if (!jmsg.get("type").toString().equals(_type)){
+                    return;
+                }
+                e.acceptTransferModes(TransferMode.MOVE);
+            }
+            e.consume();
+        });
+
+        _eventHandler.addEventListener(this);
+        addEventHandler(DragEvent.DRAG_DROPPED, e -> {
+            Dragboard db = e.getDragboard();
+            boolean success = false;
+            if (db.hasString()) {
+                JSONParser parser = new JSONParser();
+                JSONObject jmsg = null;
+                try {
+                    jmsg = (JSONObject)parser.parse(db.getString());
+                    if (!jmsg.containsKey("prefix")){return;}
+                    JSONArray jprefix = (JSONArray)jmsg.get("prefix");
+                    JSONArray jprocessor = (JSONArray)_processor.getJSONIdentifier().get("prefix");
+                    if (jprocessor.size() + 2 != jprefix.size()){return;}
+                    for (int i = 0; i < jprocessor.size(); ++i){
+                        if(!jprocessor.get(i).toString().equals(jprefix.get(i).toString())){
+                            return;
+                        }
+                    }
+                    if(!_processor.ID.equals(jprefix.get(jprefix.size()-2).toString())){
+                        return;
+                    }
+                } catch (ParseException parseException) {
+                    parseException.printStackTrace();
+                }
+                JSONObject jtry = new JSONObject();
+                jtry.put("operation", "add");
+                JSONObject jargs = new JSONObject();
+                jargs.put("subject",  _processor.getJSONIdentifier());
+                jargs.put("object",   jmsg);
+                jtry.put("args", jargs);
+                _eventHandler.publishEvent(10,"try", jtry);
+            }
+        });
+    }
+
+    public void add(Module mod){
+        params.getChildren().add(mod);
+    }
+
+    @Override
+    public void processGUIEvent(String event, JSONObject args) {
+    }
+
+    @Override
+    public void close() throws Exception {
+
+    }
+}