Esempio n. 1
0
        public override void Execute()
        {
            if (string.IsNullOrWhiteSpace(_starType) || TargetDrawing == null)
            {
                return;
            }

            Size starSize = new Size()
            {
                Width  = Convert.ToInt16(Math.Round(NormalWidth * _scale, 0)),
                Height = Convert.ToInt16(Math.Round(NormalHeight * _scale, 0))
            };

            Point starLocation = new Point(_location.X - starSize.Width / 2, _location.Y - starSize.Height / 2);

            StarExtrinsicState extrinsicState = new StarExtrinsicState()
            {
                StarType = _starType,
                Location = starLocation,
                Size     = starSize
            };

            var star = TargetDrawing.Factory.GetStar(extrinsicState);

            TargetDrawing.Add(star);
        }
        public override bool Execute()
        {
            if (string.IsNullOrWhiteSpace(assocationType) || TargetDrawing == null)
            {
                return(false);
            }

            var assocationSize = new Size()
            {
                Width  = WIDTH,
                Height = HEIGHT
            };
            var assocationLocation = new Point(location.X - assocationSize.Width / 2, location.Y - assocationSize.Height / 2);

            var extrinsicState = new AssociationExtrinsicState()
            {
                AssocationType = assocationType,
                Location       = assocationLocation,
                Size           = assocationSize
            };

            assocationAdded = AssociationFactory.Instance.GetAssocation(extrinsicState);
            TargetDrawing.Add(assocationAdded);

            return(true);
        }
        public override bool Execute()
        {
            if (string.IsNullOrWhiteSpace(_treeType) || TargetDrawing == null)
            {
                return(false);
            }

            var treeSize = new Size()
            {
                Width  = Convert.ToInt16(Math.Round(NormalWidth * _scale, 0)),
                Height = Convert.ToInt16(Math.Round(NormalHeight * _scale, 0))
            };
            var treeLocation = new Point(_location.X - treeSize.Width / 2, _location.Y - treeSize.Height / 2);

            var extrinsicState = new ClassDiagramExtrinsicState()
            {
                TreeType = _treeType,
                Location = treeLocation,
                Size     = treeSize
            };

            _treeAdded = ClassDiagramFactory.Instance.GetTree(extrinsicState);
            TargetDrawing.Add(_treeAdded);

            return(true);
        }
Esempio n. 4
0
 public override void Undo()
 {
     if (deletedStars != null)
     {
         foreach (Star item in deletedStars)
         {
             TargetDrawing.Add(item);
         }
     }
 }
Esempio n. 5
0
        internal override void Undo()
        {
            if (_previousElements == null || _previousElements.Count == 0)
            {
                return;
            }

            foreach (var element in _previousElements)
            {
                TargetDrawing?.Add(element);
            }
        }
Esempio n. 6
0
        internal override void Undo()
        {
            if (deletedElements == null || deletedElements.Count == 0)
            {
                return;
            }

            foreach (var element in deletedElements)
            {
                TargetDrawing?.Add(element);
            }
        }
        public override bool Execute()
        {
            if (label == null || corner == null || size == null)
            {
                return(false);
            }

            umlClass = new UmlClass()
            {
                Corner = (Point)corner, Size = (Size)size, Label = label
            };
            TargetDrawing.Add(umlClass);

            return(true);
        }
Esempio n. 8
0
        public override bool Execute()
        {
            if (_start == null || _end == null)
            {
                return(false);
            }

            _line = new Line()
            {
                Start = (Point)_start, End = (Point)_end
            };
            TargetDrawing.Add(_line);

            return(true);
        }
Esempio n. 9
0
        public override bool Execute()
        {
            if (_label == null || _corner == null || _size == null)
            {
                return(false);
            }

            _labelBox = new LabeledBox()
            {
                Corner = (Point)_corner, Size = (Size)_size, Label = _label
            };
            TargetDrawing.Add(_labelBox);

            return(true);
        }
Esempio n. 10
0
        public override bool Execute()
        {
            if (_start == null || _end == null)
            {
                return(false);
            }

            _line = new Line()
            {
                Start = (Point)_start, End = (Point)_end, LineType = (string)_type, label = (string)_label
            };
            TargetDrawing.Add(_line, _type);

            return(true);
        }
Esempio n. 11
0
 public override void Undo()
 {
     //TargetDrawing._ClassSymbols = OldClassSymbols;
     foreach (var s in OldClassSymbols)
     {
         TargetDrawing.Add(s);
     }
     //TargetDrawing._RelationShipLines = OldRelationships;
     foreach (var l in OldRelationships)
     {
         TargetDrawing.Add(l);
     }
     TargetDrawing.DrawingName       = OldName;
     TargetDrawing.BackGroundColor   = OldBackgroundColor;
     TargetDrawing.ForeGroundColor   = OldForegroundColor;
     TargetDrawing.DefaultClassColor = OldClassColor;
     TargetDrawing.IsDirty           = true;
 }
Esempio n. 12
0
        public override void Execute()
        {
            var star = TargetDrawing?.FindStarAtPosition(_location);

            if (star != null)
            {
                // this creates a new point offset from the current location by 10 (should be lower and to the right)
                _location = new Point((star.Location.X - star.Size.Width / 2) + 10, (star.Location.Y - star.Size.Height / 2) + 10);

                StarExtrinsicState extrinsicState = new StarExtrinsicState()
                {
                    StarType   = TargetDrawing.Factory.StarType,
                    Location   = _location,
                    Size       = star.Size,
                    IsSelected = true
                };

                var starDopple = TargetDrawing.Factory.GetStar(extrinsicState);

                TargetDrawing.Add(starDopple);

                TargetDrawing.IsDirty = true;
            }
        }
Esempio n. 13
0
 internal override void Redo()
 {
     TargetDrawing.Add(_classBox, "Class");
 }
Esempio n. 14
0
 internal override void Redo()
 {
     TargetDrawing.Add(_labelBox);
 }
 internal override void Redo()
 {
     TargetDrawing.Add(_treeAdded);
 }
Esempio n. 16
0
 internal override void Redo()
 {
     TargetDrawing.Add(_line);
 }
Esempio n. 17
0
 public override void Undo()
 {
     TargetDrawing.Add(DeletedSymbol);
     TargetDrawing.IsDirty = true;
 }
 internal override void Redo()
 {
     TargetDrawing.Add(umlClass);
 }
 internal override void Redo()
 {
     TargetDrawing.Add(assocationAdded);
 }
Esempio n. 20
0
 public override bool Execute()
 {
     TargetDrawing.Add(Symbol);
     TargetDrawing.IsDirty = true;
     return(true);
 }