示例#1
0
        public override void MouseDown(NSEvent theEvent)
        {
            base.MouseDown(theEvent);

            CurrentStartNode = GetInteractingNodePort();

            if (CurrentStartNode != null)
            {
                SetNodeColors();
                SetDrawingLayerColor();

                CurrentStartPosition = CurrentStartNode.GetNodePortMidPoint();
                CurrentStartNode.SetHasConnection(true);
            }
        }
示例#2
0
        void SetDefaultConnections()
        {
            var settings = SynthSettings.Instance;

            var sourceNodes = Nodes.Where(n => n is SourceNodeView);
            var targetNodes = Nodes.Where(n => n is TargetNodeView);

            foreach (var targetModifier in Enum.GetValues(typeof(TargetModifier)).Cast <TargetModifier>())
            {
                var source = settings.GetSourceForTarget(targetModifier);

                CurrentStartNode = sourceNodes.First(n => (n as SourceNodeView).ColorComponent == source);
                CurrentEndNode   = targetNodes.First(n => (n as TargetNodeView).TargetModifier == targetModifier);

                CurrentStartPosition = CurrentStartNode.GetNodePortMidPoint();
                CurrentEndPosition   = CurrentEndNode.GetNodePortMidPoint();

                ValidConnectionMade();
            }
        }
示例#3
0
 public abstract bool CanConnectToNode(BaseNodeView other);
示例#4
0
 void ResetDragStates()
 {
     DrawingLayer.Path    = null;
     CurrentStartPosition = CurrentEndPosition = new CGPoint(0, 0);
     CurrentStartNode     = CurrentEndNode = null;
 }
示例#5
0
 public override bool CanConnectToNode(BaseNodeView other)
 {
     return
         (other != this &&
          other is TargetNodeView);
 }