示例#1
0
 public UmlAssociationModel(ConnectionType type, IBoundedSketchItemModel from, IBoundedSketchItemModel to,
                            Point connectorStartHint, Point connectorEndHint,
                            ISketchItemContainer container)
     : base(type, from, to, connectorStartHint, connectorEndHint, container)
 {
     UpdateGeometry();
 }
示例#2
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);
 }
示例#3
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();
 }
示例#4
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();
 }
示例#5
0
        public static IEnumerable <ConnectorModel> GetConnectorsWithSameEndpoints(IEnumerable <ConnectorModel> siblings,
                                                                                  IBoundedSketchItemModel from, IBoundedSketchItemModel to, Point start, Point end)
        {
            List <ConnectorModel> sameEndpoints = new List <ConnectorModel>();

            if (siblings != null)
            {
                foreach (var x in siblings)
                {
                    if ((x.From == from && x.To == to) || (x.To == from && x.From == to)) // same connection, eventually reversed
                    {
                        if ((x.ConnectorStart == start && x.ConnectorEnd == end) ||
                            x.ConnectorStart == end && x.ConnectorEnd == start)
                        {
                            sameEndpoints.Add(x);
                        }
                    }
                }
            }
            return(sameEndpoints);
        }
示例#6
0
        public RewireConnectorOperation(ISketchItemDisplay pad, ConnectorModel model, Point p)
        {
            _connector = model;
            _pad       = pad;

            IBoundedSketchItemModel ending = model.To;

            if (ending == null)
            {
                ending = model.From;
            }
            var start = ConnectorUtilities.ComputeCenter(ending.Bounds);

            _selector = new ConnectablePairSelector(start, p);
            _pad.Canvas.Children.Add(_selector);
            _selector.Visibility = Visibility.Visible;
            foreach (var ch in _pad.Canvas.Children.OfType <ISketchItemUI>())
            {
                ch.Disable();
            }
            _pad.Canvas.MouseMove += HandleMouseMove;
            _pad.Canvas.MouseDown += HandleMouseDown;
            _pad.Canvas.KeyDown   += HandleKeyDown;
        }
示例#7
0
 public UmlActivityDiagramEdge(ConnectionType type, IBoundedSketchItemModel from, IBoundedSketchItemModel to,
                               Point connectorStartHint, Point connectorEndHint,
                               ISketchItemContainer container)
     : base(type, from, to, connectorStartHint, connectorEndHint, container)
 {
 }
示例#8
0
 public UmlGeneralizationModel(ConnectionType type, IBoundedSketchItemModel from, IBoundedSketchItemModel to,
                               Point connectorStartHint, Point connectorEndHint,
                               ISketchItemContainer container)
     : base(type, from, to, connectorStartHint, connectorEndHint, container)
 {
 }