Exemplo n.º 1
0
        public override void MouseDown(NSEvent theEvent)
        {
            base.MouseDown(theEvent);

            CurrentStartNode = GetInteractingNodePort();

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

                CurrentStartPosition = CurrentStartNode.GetNodePortMidPoint();
                CurrentStartNode.SetHasConnection(true);
            }
        }
Exemplo n.º 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();
            }
        }
Exemplo n.º 3
0
 public abstract bool CanConnectToNode(BaseNodeView other);
Exemplo n.º 4
0
 void ResetDragStates()
 {
     DrawingLayer.Path    = null;
     CurrentStartPosition = CurrentEndPosition = new CGPoint(0, 0);
     CurrentStartNode     = CurrentEndNode = null;
 }
Exemplo n.º 5
0
 public override bool CanConnectToNode(BaseNodeView other)
 {
     return
         (other != this &&
          other is TargetNodeView);
 }