Пример #1
0
 // Move the object to the regular layer, where it can be obscured by selected nodes,
 // unless this node is being deleted.
 public override void OnLostSelection(GoSelection selection)
 {
     if (!this.BeingRemoved)
     {
         this.Document.DefaultLayer.Add(this);
     }
     base.OnLostSelection(selection);
 }
Пример #2
0
        // Just change the GoTextNode's background brush color,
        // rather than adding selection handles.
        public override void RemoveSelectionHandles(GoSelection selection)
        {
            GoShape shape = this.Background as GoShape;

            if (shape != null)
            {
                //shape.FillHalfGradient(myNwoodsNamespaceColor);
            }
        }
Пример #3
0
 public override void OnLostSelection(GoSelection sel)
 {
     foreach (GoLink link in Links)
     {
         link.PenWidth          = 3;
         link.HighlightPenWidth = 0;
     }
     UnSelected(this, null);
     base.OnLostSelection(sel);
 }
Пример #4
0
        // Just change the GoTextNode's background brush color,
        // rather than adding selection handles.
        public override void AddSelectionHandles(GoSelection selection, GoObject selectedObject)
        {
            GoShape shape = this.Background as GoShape;

            if (shape != null)
            {
                //shape.BrushStyle = GoBrushStyle.Solid;
                //shape.BrushColor = Color.DeepPink;
            }
        }
 public void RemoveLinks(GoSelection links)
 {
     links.ToList().Each(link =>
     {
         if (isBaseLink(link) && isGoLink(link))
         {
             unlinkBaseNodes(link as IBaseLink, link as GoLink);
         }
         else if (link.IsAnImplementationOf <INeighborhoodNode>())
         {
             unlinkNeighborhoodNode(link);
         }
     });
 }
Пример #6
0
 private void RemoveEntityGroup([NotNull] IShape shape)
 {
     if (shape is IEntityShape entityShape &&
         (_diagram.Entities?.Contains(entityShape) ?? false) &&
         entityShape.Identity is IEntity entity)
     {
         var graphEntity = GetEntity(entity);
         if (graphEntity != null)
         {
             var selection = new GoSelection(null);
             selection.Add(graphEntity);
             _graph.DeleteSelection(selection);
         }
     }
Пример #7
0
        // only allow resizing vertically
        public override void AddSelectionHandles(GoSelection sel, GoObject selectedObj)
        {
            Lifeline line = this.Parent as Lifeline;

            if (line != null)
            {
                RemoveSelectionHandles(sel);
                sel.CreateResizeHandle(this, selectedObj, line.GetStepPoint(this.Begin), MiddleTop, true);
                sel.CreateResizeHandle(this, selectedObj, line.GetStepPoint(this.End), MiddleBottom, true);
            }
            else
            {
                base.AddSelectionHandles(sel, selectedObj);
            }
        }
Пример #8
0
 public override void OnGotSelection(GoSelection sel)
 {
     foreach (GoLink link in RightPort.Links)
     {
         link.PenWidth          = 5;
         link.HighlightPenWidth = 8;
         link.HighlightPenColor = System.Drawing.Color.Red;
     }
     foreach (GoLink link in LeftPort.Links)
     {
         link.HighlightPenWidth = 8;
         link.PenWidth          = 5;
         link.HighlightPenColor = System.Drawing.Color.Blue;
     }
     Selected(this, null);
     base.OnGotSelection(sel);
 }
Пример #9
0
 public override void OnGotSelection(GoSelection sel)
 {
     oldBrushColor           = header.Shape.BrushColor;
     header.Shape.BrushColor = Color.LightGreen;
     base.OnGotSelection(sel);
 }
Пример #10
0
 public override void OnLostSelection(GoSelection sel)
 {
     base.OnLostSelection(sel);
     Deselected?.Invoke(this, new GoSelectionEventArgs(this));
 }
Пример #11
0
 // only allow resizing vertically
 public override void AddSelectionHandles(GoSelection sel, GoObject selectedObj)
 {
     Lifeline line = this.Parent as Lifeline;
     if (line != null)
     {
         RemoveSelectionHandles(sel);
         sel.CreateResizeHandle(this, selectedObj, line.GetStepPoint(this.Begin), MiddleTop, true);
         sel.CreateResizeHandle(this, selectedObj, line.GetStepPoint(this.End), MiddleBottom, true);
     }
     else
     {
         base.AddSelectionHandles(sel, selectedObj);
     }
 }
Пример #12
0
 public override void OnGotSelection(GoSelection sel)
 {
     _link.RaiseSelectedEvent();
     DoBeginEdit(sel.View);
 }
Пример #13
0
 public override void OnLostSelection(GoSelection selection)
 {
     base.OnLostSelection(selection);
     this.SkipsUndoManager = true;
     this.HighlightPen = new Pen(Color.White, 6);
     this.SkipsUndoManager = false;
 }
Пример #14
0
 public override void OnGotSelection(GoSelection selection)
 {
     base.OnGotSelection(selection);
     this.SkipsUndoManager = true;
     Color c;
     if (selection.Primary == this)
         c = selection.View.PrimarySelectionColor;
     else
         c = selection.View.SecondarySelectionColor;
     this.HighlightPen = new Pen(c, 6);
     this.SkipsUndoManager = false;
 }
Пример #15
0
 public override void OnLostSelection(GoSelection sel)
 {
     header.Shape.BrushColor = oldBrushColor;
     base.OnGotSelection(sel);
 }
Пример #16
0
 public override void OnGotSelection(GoSelection sel)
 {
     oldBrushColor = header.Shape.BrushColor;
     header.Shape.BrushColor = Color.LightGreen;
     base.OnGotSelection(sel);
 }
Пример #17
0
 public override void OnLostSelection(GoSelection sel)
 {
     header.Shape.BrushColor = oldBrushColor;
     base.OnGotSelection(sel);
 }
Пример #18
0
 // can't get any selection handles
 public override void AddSelectionHandles(GoSelection sel, GoObject selectedObj)
 {
 }
Пример #19
0
 // Move the object to the top layer, so it is visible to the user.
 public override void OnGotSelection(GoSelection selection)
 {
     this.Document.Layers.Top.Add(this);
     base.OnGotSelection(selection);
 }