コード例 #1
0
        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);
        }
コード例 #2
0
 public void SetData(ConnectionPointData connectionPointData)
 {
     data = ConnectionPointData.GetControlPointData(connection.type);
     SetCurrentStyle();
     rect = new Rect(0, 0,
                     currentStyle.normal.background.width,
                     currentStyle.normal.background.height);
 }
コード例 #3
0
        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);
        }
コード例 #4
0
        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);
        }