private void OnCloneComplete()
        {
            _calloutGraphic = CollectionUtils.SelectFirst(base.Graphics,
                                                          delegate(IGraphic test) { return(test is ICalloutGraphic); }) as ICalloutGraphic;
            Platform.CheckForNullReference(_calloutGraphic, "_calloutGraphic");

            this.Initialize(null);

            //the roi and callout may have been selected, so we force a state change
            this.State = this.CreateInactiveState();
        }
Ejemplo n.º 2
0
        public void Initialize(ICalloutGraphic graphic)
        {
            TextArea = new TextAreaAnnotation
            {
                Text        = graphic.Text,
                Location    = graphic.TextLocation,
                TopLeft     = graphic.TextBoundingBox.Location,
                BottomRight = graphic.TextBoundingBox.Location +
                              new SizeF(graphic.TextBoundingBox.Width, graphic.TextBoundingBox.Height)
            };

            AnchorPoint = graphic.AnchorPoint;
        }
        private void Initialize(IAnnotationCalloutLocationStrategy calloutLocationStrategy)
        {
            if (_calloutGraphic == null)
            {
                _calloutGraphic = this.CreateCalloutGraphic();
                base.Graphics.Add(_calloutGraphic);
            }

            _calloutGraphic.TextLocationChanged += OnCalloutLocationChanged;

            if (_calloutLocationStrategy == null)
            {
                _calloutLocationStrategy = calloutLocationStrategy ?? new AnnotationCalloutLocationStrategy();
            }

            _calloutLocationStrategy.SetAnnotationGraphic(this);

            this.Subject.VisualStateChanged += OnSubjectVisualStateChanged;
        }
Ejemplo n.º 4
0
            private static void SerializeCallout(ICalloutGraphic calloutGraphic, GraphicAnnotationSequenceItem serializationState)
            {
                calloutGraphic.CoordinateSystem = CoordinateSystem.Source;
                try
                {
                    RectangleF textBoundingBox = RectangleUtilities.ConvertToPositiveRectangle(calloutGraphic.TextBoundingBox);

                    TextObject text = new TextObject();
                    text.BoundingBoxAnnotationUnits             = GraphicAnnotationSequenceItem.BoundingBoxAnnotationUnits.Pixel;
                    text.BoundingBoxBottomRightHandCorner       = new PointF(textBoundingBox.Right, textBoundingBox.Bottom);
                    text.BoundingBoxTextHorizontalJustification = GraphicAnnotationSequenceItem.BoundingBoxTextHorizontalJustification.Center;
                    text.BoundingBoxTopLeftHandCorner           = textBoundingBox.Location;
                    text.UnformattedTextValue = calloutGraphic.Text;
                    serializationState.AppendTextObjectSequence(text);

                    // draw the callout line manually instead of anchoring the text,
                    // since we do not want the text to be moveable as permitted if we have an anchor point
                    SerializeDashedLine(calloutGraphic.TextLocation, calloutGraphic.AnchorPoint, calloutGraphic.SpatialTransform, serializationState, false);
                }
                finally
                {
                    calloutGraphic.ResetCoordinateSystem();
                }
            }
Ejemplo n.º 5
0
		private void OnCloneComplete()
		{
			_calloutGraphic = CollectionUtils.SelectFirst(base.Graphics,
			                                              delegate(IGraphic test) { return test is ICalloutGraphic; }) as ICalloutGraphic;
			Platform.CheckForNullReference(_calloutGraphic, "_calloutGraphic");

			this.Initialize(null);

			//the roi and callout may have been selected, so we force a state change
			this.State = this.CreateInactiveState();
		}
Ejemplo n.º 6
0
		private void Initialize(IAnnotationCalloutLocationStrategy calloutLocationStrategy)
		{
			if (_calloutGraphic == null)
			{
				_calloutGraphic = this.CreateCalloutGraphic();
				base.Graphics.Add(_calloutGraphic);
			}

			_calloutGraphic.TextLocationChanged += OnCalloutLocationChanged;

			if (_calloutLocationStrategy == null)
				_calloutLocationStrategy = calloutLocationStrategy ?? new AnnotationCalloutLocationStrategy();

			_calloutLocationStrategy.SetAnnotationGraphic(this);

			this.Subject.VisualStateChanged += OnSubjectVisualStateChanged;
		}