Beispiel #1
0
 public UmlAssociationModel(ConnectionType type, IBoundedSketchItemModel from, IBoundedSketchItemModel to,
                            Point connectorStartHint, Point connectorEndHint,
                            ISketchItemContainer container)
     : base(type, from, to, connectorStartHint, connectorEndHint, container)
 {
     UpdateGeometry();
 }
Beispiel #2
0
 public UmlStateModel(Point p, ISketchItemContainer container)
     : base(p, container, new Size(DefaultWidth, DefaultHeight))
 {
     IsSelected    = true;
     CanChangeSize = true;
     Label         = "new state";
 }
Beispiel #3
0
 public UmlChoiceModel(Point p, ISketchItemContainer container)
     : base(p, container, new Size(UmlChoiceModel.DefaultWidth,
                                   UmlChoiceModel.DefaultHeight),
            "Choice", Colors.Snow)
 {
     CanChangeSize = false;
 }
Beispiel #4
0
 public UmlDependencyModel(ConnectionType type, IBoundedSketchItemModel from, IBoundedSketchItemModel to,
                           Point connectorStartHint, Point connectorEndHint,
                           ISketchItemContainer container)
     : base(type, from, to, connectorStartHint, connectorEndHint, container)
 {
     StrokeDashArray = new DoubleCollection(_dashPattern);
 }
Beispiel #5
0
 public PictureModel(System.Windows.Point p, ISketchItemContainer container)
     : base(p, container, new Size(PictureModel.DefaultWidth, PictureModel.DefaultHeight),
            "new image", Colors.Snow)
 {
     CanChangeSize = true;
     UpdateGeometry();
 }
Beispiel #6
0
        //EllipseGeometry _geometry;

        public UmlInitialStateModel(Point p, ISketchItemContainer container)
            : base(p, container, new Size(DefaultHeight, DefaultWidth), "Initial-State", Colors.Black)
        {
            CanEditLabel  = false;
            CanChangeSize = false;
            LabelArea     = Rect.Empty;
            IsSelected    = true;
        }
Beispiel #7
0
 public UmlMessageModel(ConnectionType type, IBoundedSketchItemModel from, IBoundedSketchItemModel to,
                        Point connectorStartHint, Point connectorEndHint,
                        ISketchItemContainer container)
     : base(ConnectionType.StrightLine, from, to, connectorStartHint, connectorEndHint, container)
 {
     Label = "message()";
     UpdateGeometry();
 }
Beispiel #8
0
 public UmlPackageModel(Point p, ISketchItemContainer container)
     : base(p, container, new Size(DefaultWidth, DefaultHeight))
 {
     IsSelected    = true;
     CanChangeSize = true;
     Label         = "new package";
     UpdateGeometry();
 }
Beispiel #9
0
 public UmlAwaitEventModel(Point p, ISketchItemContainer container)
     : base(p, container, new Size(DefaultWidth, DefaultHeight), "await event", ConnectableBase.DefaultColor)
 {
     IsSelected    = true;
     CanChangeSize = true;
     RotationAngle = 0.0;
     Commands      = GetUmlWaitForEventCommands();
 }
Beispiel #10
0
        //readonly PathFigure[] _notePath = new PathFigure[1];


        public UmlNoteModel(Point p, ISketchItemContainer container)
            : base(p, container, new Size(DefaultWidth, DefaultHeight),
                   "a note",
                   Colors.White)
        {
            CanChangeSize = true;
            CanEditLabel  = true;
            Note          = "a note";
        }
Beispiel #11
0
 public UmlActionConnector(Point p, ISketchItemContainer container)
     : base(p, container, new Size(DefaultHeight, DefaultWidth), "A",
            Colors.White)
 {
     CanEditLabel    = true;
     CanChangeSize   = false;
     StrokeThickness = 3;
     UpdateGeometry();
 }
Beispiel #12
0
 public UmlActivityModel(Point p, ISketchItemContainer container)
     : base(p, container, new Size(DefaultWidth, DefaultHeight))
 {
     IsSelected    = true;
     CanChangeSize = true;
     Label         = "new action";
     RotationAngle = 0.0;
     //Commands = GetUmlActivityModelCommands();
 }
Beispiel #13
0
 public UmlClassModel(Point p, ISketchItemContainer container)
     : base(p, container, new Size(DefaultWidth, DefaultHeight))
 {
     CanChangeSize = true;
     CanEditLabel  = true;
     Label         = "new class";
     RotationAngle = 0.0;
     _members.CollectionChanged += Members_CollectionChanged;;
     //UpdateGeometry();
 }
Beispiel #14
0
        public UmlLifeLineModel(Point p, ISketchItemContainer container)
            : base(p, container, new Size(UmlLifeLineModel.DefaultWidth,
                                          UmlLifeLineModel.DefaultHeight),
                   "Object Life Line", Colors.Snow)
        {
            FillColor = new Color()
            {
                A = 0, R = 0xFF, G = 0xFF, B = 0xFF
            };

            CanChangeSize = true;
            UpdateGeometry();
        }
Beispiel #15
0
 public ConnectorLabelModel(ConnectorModel connector, ISketchItemContainer container, bool isStartPointLabel, bool showLabelConnection, Point labelPosition)
     : base(labelPosition, container,
            ComputeSizeOfBounds(connector.GetLabel(isStartPointLabel)),
            connector.GetLabel(isStartPointLabel), Colors.Snow)
 {
     _connector = connector;
     _connector.PropertyChanged += Connector_PropertyChanged;
     _isStartpointLabel          = isStartPointLabel;
     _showLabelConnection        = showLabelConnection;
     CanChangeSize   = false;
     StrokeThickness = 0.2;
     FillColor       = Color.FromArgb(0x31, 0xFF, 0xFA, 0xFA);
     UpdateGeometry();
 }
Beispiel #16
0
 public ConnectableBase(Point pos, ISketchItemContainer container, Size size,
                        string label,
                        Color color)
 {
     ParentNode = container;
     IsSelected = true;
     Label      = label;
     FillColor  = color;
     LabelArea  = ComputeLabelArea(DisplayedLabel());
     _bounds    = ComputeBounds(pos, size, LabelArea);
     _rotateTransform.CenterX  = Bounds.Width / 2;
     _rotateTransform.CenterY  = Bounds.Height / 2;
     _rotateTransform.Changed += RotateTransform_Changed;
     Initialize();
 }
Beispiel #17
0
 public ConnectorModel(ConnectionType type,
                       IBoundedSketchItemModel from, IBoundedSketchItemModel to,
                       System.Windows.Point connectorStartHint, System.Windows.Point connectorEndHint,
                       ISketchItemContainer container)
 //:base(new Guid())
 {
     ParentNode                  = container;
     _connectionType             = type;
     MiddlePointRelativePosition = 0.5;
     From = from;
     To   = to;
     _myConnectorStrategy = ConnectorUtilities.GetConnectionType(this, _connectionType, connectorStartHint, connectorEndHint);
     Label     = string.Format("{0}->{1}", from.Label, to.Label);
     LineWidth = 1;
     _geometry.Children.Add(_path);
     Initialize();
 }
Beispiel #18
0
        public SketchItemDisplayLabel(ISketchItemContainer container, Canvas canvas)
        {
            Contract.Requires <ArgumentNullException>(container != null, "Container must not be null");
            Contract.Requires <ArgumentNullException>(canvas != null, "Canvas must not be null");

            DataContext = container;
            SetBinding(TagProperty, "Label");

            _container      = container;
            _canvas         = canvas;
            Stroke          = Brushes.Black;
            StrokeThickness = 0.5;
            Fill            = _fillBrush;
            _canvas.Children.Add(this);
            Visibility = Visibility.Visible;
            UpdateGeometry();
        }
Beispiel #19
0
        public static void RestoreSnapshot(Stream stream, ISketchItemContainer container)
        {
            IList <ISketchItemModel> outlines = container.SketchItems;

            outlines.Clear();
            var ss = new SurrogateSelector();

            ss.AddSurrogate(typeof(SketchItemContainerProxy),
                            new StreamingContext(StreamingContextStates.All),
                            new SketchItemContainerSerializationSurrogate(container));


            IFormatter formatter = new BinaryFormatter()
            {
                SurrogateSelector = ss
            };
            var list = (List <ISketchItemModel>)formatter.Deserialize(stream);

            RestoreChildren(outlines, list);
        }
Beispiel #20
0
        public static void TakeSnapshot(Stream stream, ISketchItemContainer container)
        {
            var outlines = container.SketchItems;
            var ss       = new SurrogateSelector();

            ss.AddSurrogate(typeof(SketchItemContainerProxy),
                            new StreamingContext(StreamingContextStates.All),
                            new SketchItemContainerSerializationSurrogate(container));


            IFormatter formatter = new BinaryFormatter()
            {
                SurrogateSelector = ss
            };

            List <ISketchItemModel> list = new List <ISketchItemModel>(outlines.Where(
                                                                           (x) => x.IsSerializable));

            formatter.Serialize(stream, list);
        }
Beispiel #21
0
        public SketchItemDisplay(SketchPad parent, ISketchItemContainer container, bool activateCanvas = true)
        {
            this.Height = parent.Height;
            this.Width  = parent.Width;
            _parent     = parent;
            _container  = container;
            Focusable   = true;
            Background  = Brushes.White;
            var items = new List <ISketchItemModel>(_container.SketchItems);

            foreach (var item in items)
            {
                AddVisualChild(item);
            }

            _container.SketchItems.CollectionChanged += SketchItems_CollectionChanged;
            if (activateCanvas)
            {
                Visibility = Visibility.Visible;
                _myLabel   = new SketchItemDisplayLabel(container, this);
                BeginEdit(new SelectUisOperation(this));
            }
        }
Beispiel #22
0
 public UmlGeneralizationModel(ConnectionType type, IBoundedSketchItemModel from, IBoundedSketchItemModel to,
                               Point connectorStartHint, Point connectorEndHint,
                               ISketchItemContainer container)
     : base(type, from, to, connectorStartHint, connectorEndHint, container)
 {
 }
Beispiel #23
0
 public FreeTextModel(Point p, ISketchItemContainer container)
     : base(p, container, new Size(DefaultWidth, DefaultHeight), "a text",
            Colors.White)
 {
     CanChangeSize = true;
 }
Beispiel #24
0
        //Point _textPosition = new Point();
        //bool _boundsChanging;

        public UmlCombinedFragment(Point location, ISketchItemContainer container) : base(location, container, new Size(150, 50), $"{_default}", DefaultColor)
        {
            CanChangeSize   = true;
            CanEditLabel    = false;
            _formattedLabel = ComputeFormattedText(Label, ConnectableBase.DefaultFont, ConnectableBase.DefaultFontSize);
        }
Beispiel #25
0
 public UmlActivityDiagramEdge(ConnectionType type, IBoundedSketchItemModel from, IBoundedSketchItemModel to,
                               Point connectorStartHint, Point connectorEndHint,
                               ISketchItemContainer container)
     : base(type, from, to, connectorStartHint, connectorEndHint, container)
 {
 }
Beispiel #26
0
 public SketchItemContainerProxy(ISketchItemContainer realContainer)
 {
     _realContainer = realContainer;
 }
Beispiel #27
0
 public ContainerModel(Point location, ISketchItemContainer container, Size size)
     : base(location, container, size, "new container", ConnectableBase.DefaultColor)
 {
     _children.CollectionChanged += SketchItemsChanged;
 }