// construction public Representation(Datatype[] inputs, Datatype[] outputs) { Master.log("----Creating representation----"); m_id = Master.getNextRepID(); Master.log("ID: " + m_id, Colors.GreenYellow); this.m_inputs = inputs; this.m_outputs = outputs; m_graphic = GraphicFactory.createRepresentationGraphic(this, inputs.Length, outputs.Length); // create nodes for (int i = 0; i < m_inputs.Length; i++) { m_nodes.Add(new Node(this, true, i, m_inputs[i])); } for (int i = 0; i < m_outputs.Length; i++) { m_nodes.Add(new Node(this, false, i, m_outputs[i])); } }
public void setDraggingRepresentation(bool dragging, RepresentationGraphic rep) { m_isDraggingRepresentation = dragging; m_draggingRepresentation = rep; }
public void addRepresentationGraphic(RepresentationGraphic rg) { m_repGraphics.Add(rg.getParent().getID(), rg); }
public static Canvas getCanvas() { return win.getMainCanvas(); } // I know the name for this now!! Delegation! public static void setDraggingRepresentation(bool dragging, RepresentationGraphic dragRep) { win.getGraphicContainer().setDraggingRepresentation(dragging, dragRep); }
public static RepresentationGraphic createRepresentationGraphic(Representation parent) { RepresentationGraphic rg = new RepresentationGraphic(parent, 1, 1); Master.getGraphicContainer().addRepresentationGraphic(rg); return rg; }