예제 #1
0
        private void initLine(Color c, LinkHeadType headType)
        {
            line            = new ArrowLine();
            line.ArrowAngle = 40;
            line.Stroke     = new SolidColorBrush(c);
            switch (headType)
            {
            case LinkHeadType.DoubleHeaded:
                line.ArrowEnds = ArrowEnds.Both;
                break;

            case LinkHeadType.SingleHeaded:
                line.ArrowEnds = ArrowEnds.End;
                break;

            default:
                throw new NotSupportedException();
            }
            line.StrokeThickness = ShapeUtils.LINE_WIDTH;
            line.Effect          = ShapeUtils.ShadowProvider();
            line.Tag             = this;

            selMarker1     = ShapeUtils.MakeLinkEnd();
            selMarker1.Tag = this;

            selMarker2     = ShapeUtils.MakeLinkEnd();
            selMarker2.Tag = this;

            line.MouseWheel += MouseWheel;
        }
예제 #2
0
        public void SendLinkCreateRequest(int end1, int end2, int ownerId, int shapeId, int topicId, bool takeCursor,
                                          LinkHeadType linkHead)
        {
            if (peer == null || peer.PeerState != PeerStateValue.Connected)
            {
                return;
            }

            peer.OpCustom((byte)DiscussionOpCode.LinkCreateRequest,
                          LinkCreateMessage.Write(end1, end2, ownerId, shapeId, topicId, takeCursor, linkHead),
                          true);
            Service();
        }
예제 #3
0
 public static Dictionary<byte, object> Write(int end1Id, int end2Id, int ownerId,
                                              int shapeId, int topicId, bool takeCursor,
                                              LinkHeadType headType)
 {
     var res = new Dictionary<byte, object>();
     res.Add((byte) DiscussionParamKey.LinkEnd1Id, end1Id);
     res.Add((byte) DiscussionParamKey.LinkEnd2Id, end2Id);
     res.Add((byte) DiscussionParamKey.InitialShapeOwnerId, ownerId);
     res.Add((byte) DiscussionParamKey.ShapeId, shapeId);
     res.Add((byte) DiscussionParamKey.ChangedTopicId, topicId);
     res.Add((byte) DiscussionParamKey.AutoTakeCursor, takeCursor);
     res.Add((byte) DiscussionParamKey.LinkHeadTypeKey, headType);
     return res;
 }
예제 #4
0
        public static Dictionary <byte, object> Write(int end1Id, int end2Id, int ownerId,
                                                      int shapeId, int topicId, bool takeCursor,
                                                      LinkHeadType headType)
        {
            var res = new Dictionary <byte, object>();

            res.Add((byte)DiscussionParamKey.LinkEnd1Id, end1Id);
            res.Add((byte)DiscussionParamKey.LinkEnd2Id, end2Id);
            res.Add((byte)DiscussionParamKey.InitialShapeOwnerId, ownerId);
            res.Add((byte)DiscussionParamKey.ShapeId, shapeId);
            res.Add((byte)DiscussionParamKey.ChangedTopicId, topicId);
            res.Add((byte)DiscussionParamKey.AutoTakeCursor, takeCursor);
            res.Add((byte)DiscussionParamKey.LinkHeadTypeKey, headType);
            return(res);
        }
예제 #5
0
        public VdClusterLink(ClientLinkable end1, ClientLinkable end2,
                             int shapeId, int owner,
                             VdDocument doc,
                             LinkHeadType headType) :
            base(owner, shapeId)
        {
            _doc = doc;

            _end1 = end1;
            _end2 = end2;

            _headType = headType;

            initLine(DaoUtils.UserIdToColor(owner), headType);

            //wait until actual size is set
            line.Dispatcher.BeginInvoke(new Action(() => { NotifyLinkableMoved(); }),
                                        System.Windows.Threading.DispatcherPriority.Background);

            RemoveFocus();
            updateUserCursor();
        }
예제 #6
0
        public VdClusterLink(ClientLinkable end1, ClientLinkable end2,
            int shapeId, int owner,
            VdDocument doc,
            LinkHeadType headType)
            : base(owner, shapeId)
        {
            _doc = doc;

            _end1 = end1;
            _end2 = end2;

            _headType = headType;

            initLine(DaoUtils.UserIdToColor(owner), headType);

            //wait until actual size is set
            line.Dispatcher.BeginInvoke(new Action(() => { NotifyLinkableMoved(); }),
                                        System.Windows.Threading.DispatcherPriority.Background);

            RemoveFocus();
            updateUserCursor();
        }
예제 #7
0
        public int BeginCreateLink(int end1Id,
                                   int end2Id,
                                   LinkHeadType linkHead)
        {
            var end1 = ((LinkableHost)_shapes[end1Id]).GetLinkable();
            var end2 = ((LinkableHost)_shapes[end2Id]).GetLinkable();

            if (end1.HasAdjacent(end2))
            {
                MessageDlg.Show("Already linked/リンク済み",
                                "Info");
                return(-1);
            }

            var shapeId = ShapeIdGenerator.Instance.NextId(_palette.GetOwnerId());

            _rt.clienRt.SendLinkCreateRequest(end1Id, end2Id,
                                              _palette.GetOwnerId(), shapeId,
                                              TopicId,
                                              true,
                                              linkHead);
            return(shapeId);
        }
예제 #8
0
        private VdClusterLink PlayLinkCreate(ClientLinkable end1, ClientLinkable end2,
                                             int shapeId, int initOwnerId, bool takeCursor,
                                             LinkHeadType linkHead)
        {
            ShapeIdGenerator.Instance.CorrectLowBound(initOwnerId, shapeId);
            var res = new VdClusterLink(end1, end2, shapeId, initOwnerId, this, linkHead);

            _shapePostHandler(res, VdShapeType.ClusterLink);
            end1.AddEdge(res);
            end2.AddEdge(res);

            if (!_shapeVisibility)
            {
                res.Hide();
            }

            //no post handler for cluster link

            this.Add(res);

            DocTools.SortScene(_scene);
            //no initial lock, as link is created in free state (no pressed buttons)
            return(res);
        }
예제 #9
0
        public void BeginCreateLink(int end1Id,
                                    int end2Id,
                                    LinkHeadType linkHeadType)
        {
            var end1 = ((LinkableHost)shapes[end1Id]).GetLinkable();
            var end2 = ((LinkableHost)shapes[end2Id]).GetLinkable();

            if (end1.HasAdjacent(end2))
            {
                MessageBox.Show("Already linked",
                                "Info",
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Information);
                return;
            }

            var shapeId = ShapeIdGenerator.Instance.NextId(_palette.GetOwnerId());

            _rt.clienRt.SendLinkCreateRequest(end1Id, end2Id,
                                              _palette.GetOwnerId(), shapeId,
                                              TopicId,
                                              true,
                                              linkHeadType);
        }
예제 #10
0
        public void BeginCreateLink(int end1Id,
                                    int end2Id,
                                    LinkHeadType linkHeadType)
        {
            var end1 = ((LinkableHost)shapes[end1Id]).GetLinkable();
            var end2 = ((LinkableHost)shapes[end2Id]).GetLinkable();

            if (end1.HasAdjacent(end2))
            {
                MessageBox.Show("Already linked",
                                "Info",
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Information);
                return;
            }
            
            var shapeId = ShapeIdGenerator.Instance.NextId(_palette.GetOwnerId());
            _rt.clienRt.SendLinkCreateRequest(end1Id, end2Id,
                                              _palette.GetOwnerId(), shapeId,
                                              TopicId,
                                              true,
                                              linkHeadType);                     
        }
예제 #11
0
파일: ClientRT.cs 프로젝트: gdlprj/duscusys
        public void SendLinkCreateRequest(int end1, int end2, int ownerId, int shapeId, int topicId, bool takeCursor,
                                          LinkHeadType linkHead)
        {
            if (peer == null || peer.PeerState != PeerStateValue.Connected)
                return;

            peer.OpCustom((byte)DiscussionOpCode.LinkCreateRequest,
                          LinkCreateMessage.Write(end1, end2, ownerId, shapeId, topicId, takeCursor, linkHead),
                          true);
            Service();
        }
예제 #12
0
        private void initLine(Color c, LinkHeadType headType)
        {
            line = new ArrowLine();
            line.ArrowAngle = 40;
            line.Stroke = new SolidColorBrush(c);
            switch (headType)
            {
                case LinkHeadType.DoubleHeaded:
                    line.ArrowEnds = ArrowEnds.Both;
                    break;
                case LinkHeadType.SingleHeaded:
                    line.ArrowEnds = ArrowEnds.End;
                    break;
                default:
                    throw new NotSupportedException();
            }
            line.StrokeThickness = ShapeUtils.LINE_WIDTH;
            line.Effect = ShapeUtils.ShadowProvider();
            line.Tag = this;

            selMarker1 = ShapeUtils.MakeLinkEnd();
            selMarker1.Tag = this;

            selMarker2 = ShapeUtils.MakeLinkEnd();
            selMarker2.Tag = this;

            line.MouseWheel += MouseWheel;
        }
예제 #13
0
        private VdClusterLink PlayLinkCreate(ClientLinkable end1, ClientLinkable end2,
            int shapeId, int initOwnerId, bool takeCursor,
            LinkHeadType linkHead)
        {
            ShapeIdGenerator.Instance.CorrectLowBound(initOwnerId, shapeId);
            var res = new VdClusterLink(end1, end2, shapeId, initOwnerId, this, linkHead);
            _shapePostHandler(res, VdShapeType.ClusterLink);
            end1.AddEdge(res);
            end2.AddEdge(res);

            if (!_shapeVisibility)
                res.Hide();

            //no post handler for cluster link

            this.Add(res);

            DocTools.SortScene(_scene);
            //no initial lock, as link is created in free state (no pressed buttons)
            return res;
        }
예제 #14
0
        public int BeginCreateLink(int end1Id,
            int end2Id,
            LinkHeadType linkHead)
        {
            var end1 = ((LinkableHost) _shapes[end1Id]).GetLinkable();
            var end2 = ((LinkableHost) _shapes[end2Id]).GetLinkable();

            if (end1.HasAdjacent(end2))
            {
                MessageDlg.Show("Already linked/リンク済み",
                                "Info");
                return -1;
            }

            var shapeId = ShapeIdGenerator.Instance.NextId(_palette.GetOwnerId());
            _rt.clienRt.SendLinkCreateRequest(end1Id, end2Id,
                                              _palette.GetOwnerId(), shapeId,
                                              TopicId,
                                              true,
                                              linkHead);
            return shapeId;
        }