// construction public Node(Representation parent, bool isInput, int groupNum, Datatype datatype) // PASS IN X AND Y OF REPRESENTATION { m_parent = parent; m_isInput = isInput; m_groupNum = groupNum; m_datatype = datatype; m_graphic = GraphicFactory.createNodeGraphic(this); }
// construction // TODO: overloaded part, make this a function that takes a lot more, than constructors just call different ones with some default parameters instead public RepresentationGraphic(Representation parent, int numIn, int numOut) { m_parent = parent; m_id = parent.getID(); m_name = parent.getName(); m_version = parent.getVersion(); m_algorithm = parent.getAlgorithm(); createDrawing(100, 100, numIn, numOut, m_baseColor); // get starting offset points for nodes m_inOffStartPoint = (int)((m_body.Width - (numIn * GraphicContainer.NODE_SIZE)) / 2); m_outOffStartPoint = (int)((m_body.Width - (numOut * GraphicContainer.NODE_SIZE)) / 2); }
// create representation (eventually this should be based SOLELY on an imported algorithm, not created manually) /*private void addRep(int inputs, int outputs) { Representation r = new Representation(inputs, outputs); m_representations.Add(r.getID(), r); }*/ private void addRep(Datatype[] inputs, Datatype[] outputs) { Representation r = new Representation(inputs, outputs); m_representations.Add(r.getID(), r); }
public static RepresentationGraphic createRepresentationGraphic(Representation parent) { RepresentationGraphic rg = new RepresentationGraphic(parent, 1, 1); Master.getGraphicContainer().addRepresentationGraphic(rg); return rg; }