public ReddotNode(string key, string name = "Reddot") { title = "Reddot"; inputPort = ReddotPort.Create <Edge>(Orientation.Horizontal, Direction.Input, Port.Capacity.Multi, typeof(string)); inputPort.portName = "parents"; inputContainer.Add(inputPort); outputPort = ReddotPort.Create <Edge>(Orientation.Horizontal, Direction.Output, Port.Capacity.Multi, typeof(string)); outputPort.portName = "children"; outputContainer.Add(outputPort); keyText = new TextField(); keyText.value = key; mainContainer.Add(keyText); titleContainer.RemoveAt(0); nameText = new TextField(); nameText.value = name; nameText.style.minWidth = 100; nameText.style.maxWidth = 100; var inputElement = nameText.ElementAt(0); var color = new StyleColor(Color.clear); inputElement.style.backgroundColor = color; inputElement.style.borderLeftColor = color; inputElement.style.borderRightColor = color; inputElement.style.borderTopColor = color; inputElement.style.borderBottomColor = color; titleContainer.Insert(0, nameText); }
public static new ReddotPort Create <TEdge>(Orientation orientation, Direction direction, Capacity capacity, Type type) where TEdge : Edge, new() { EdgeConnectorListener listener = new EdgeConnectorListener(); ReddotPort port = new ReddotPort(orientation, direction, capacity, type) { m_EdgeConnector = new EdgeConnector <TEdge>(listener) }; port.AddManipulator(port.m_EdgeConnector); return(port); }