Exemplo n.º 1
0
        public void SetShapeValue(LabelShape shape)
        {
            m_shape = shape;

            m_box.Font = new System.Drawing.Font("宋体", FontSize);
            m_box.Text = shape.Data.Text;
        }
Exemplo n.º 2
0
        protected override void OnDoubleClick(EventArgs e)
        {
            LabelShape shape = Source.Ghost.Shape as LabelShape;

            if (GhostState == GhostState.Modity &&
                shape != null)
            {
                ((ShapeSource)Source).PreLabelModify(shape);
            }
            base.OnDoubleClick(e);
        }
Exemplo n.º 3
0
        public IShape Create(ShapeData data)
        {
            IShape result;

            switch (data.Type)
            {
            case ShapeType.Label:
                result = new LabelShape();
                ((LabelShape)result).Data = data;
                break;

            case ShapeType.Line:
                result      = new LineShape();
                result.Data = data;
                break;

            case ShapeType.Lines:
                result      = new LinesShape();
                result.Data = data;
                break;

            case ShapeType.Rectangle:
                result      = new RectangleShape();
                result.Data = data;
                break;

            case ShapeType.Ellipse:
                result      = new EllipseShape();
                result.Data = data;
                break;

            case ShapeType.Bezier:
                result      = new BezierShape();
                result.Data = data;
                break;

            case ShapeType.Curve:
                result      = new CurveShape();
                result.Data = data;
                break;

            case ShapeType.ClosedCurve:
                result      = new ClosedCurveShape();
                result.Data = data;
                break;

            case ShapeType.Polygon:
                result      = new PolygonShape();
                result.Data = data;
                break;

            case ShapeType.None:
            default:
                result = null;
                break;
            }
            if (result != null)
            {
                result.Data.Bounds =
                    result.BoundCalculator.GetBounds(result.Data.Points);
            }
            return(result);
        }