public ConnectionPoint(GraphEntity node, ConnectionPointDirection direction, Connection connection) { if (nodeGraph == null) { throw new System.Exception("ConnectionPoint.nodeGraph MUST be set!"); } if (connection == null) { throw new System.Exception("Connection may not be null"); } nodeWindow = node; connectionDirection = direction; data = ConnectionPointData.GetControlPointData(connection.type); currentStyle = data.connectionPointStyle.unconnectedStyle; rect = new Rect(0, 0, currentStyle.normal.background.width, currentStyle.normal.background.height); GUID = connection.GUID; this.connection = connection; nodeGraph.RefreshConnectionPoint(this); }
public void SetData(ConnectionPointData connectionPointData) { data = ConnectionPointData.GetControlPointData(connection.type); SetCurrentStyle(); rect = new Rect(0, 0, currentStyle.normal.background.width, currentStyle.normal.background.height); }
public static ConnectionPointData GetFloatTypeData() { if (floatType == null) { floatType = new ConnectionPointData() { type = ConnectionType.Float, connectionPointStyle = new ConnectionPointStyle() { unconnectedStyle = CreateStyle(ImageLinks.dataTypeUnconnected), unconnectedHoverStyle = CreateStyle(ImageLinks.dataTypeUnconnectedHover), connectedStyle = CreateStyle(ImageLinks.dataTypeConnected), connectedHoverStyle = CreateStyle(ImageLinks.dataTypeConnectedHover), connectionColor = Color.cyan, }, wireThickness = 6, allowsMultipleInputs = false, allowsMultipleOutputs = true, }; } return(floatType); }
public static ConnectionPointData GetControlFlowTypeData() { if (controlFlowType == null) { controlFlowType = new ConnectionPointData() { type = ConnectionType.ControlFlow, connectionPointStyle = new ConnectionPointStyle() { unconnectedStyle = CreateStyle(ImageLinks.controlFlowUnconnected), unconnectedHoverStyle = CreateStyle(ImageLinks.controlFlowUnconnectedHover), connectedStyle = CreateStyle(ImageLinks.controlFlowConnected), connectedHoverStyle = CreateStyle(ImageLinks.controlFlowConnectedHover), connectionColor = Color.white, }, wireThickness = 10, allowsMultipleInputs = true, allowsMultipleOutputs = false, }; } return(controlFlowType); }