예제 #1
0
파일: CompositeShape.cs 프로젝트: nistck/Jx
        /// <summary>
        /// Called when a shape is removed.
        /// </summary>
        /// <param name="shape">Removed shape.</param>
        /// <param name="index">Removing index.</param>
        void _shapes_RemovedItem(IShape shape, int index)
        {
            (shape as Shape).Parent = null;

            Geometric.Reset();

            foreach (IShape grouppedShape in _shapes)
            {
                Geometric.AddPath(grouppedShape.Geometric, false);
            }
        }
예제 #2
0
파일: Ghost.cs 프로젝트: nistck/Jx
        /// <summary>
        /// Mouse down function.
        /// </summary>
        /// <param name="document">Informations transferred from DrawingPanel.</param>
        /// <param name="e">MouseEventArgs.</param>
        public override void MouseDown(IDocument document, System.Windows.Forms.MouseEventArgs e)
        {
            _shape = _memoryShape.Clone() as IShape;

            Geometric.Reset();
            Geometric.AddPath(_shape.Geometric, false);

            Visible  = false;
            Selected = false;

            InitializeVersors(_shape.HitTest(e.Location));

            base.MouseDown(document, e);
        }
예제 #3
0
파일: Ghost.cs 프로젝트: nistck/Jx
        /// <summary>
        /// Copy constructor.
        /// </summary>
        /// <param name="ghost">Shape to copy.</param>
        public Ghost(Ghost ghost) : base(ghost)
        {
            _referenceShape = ghost.Shape;
            _memoryShape    = ghost.Shape.Clone() as IShape;
            _shape          = _memoryShape.Clone() as IShape;

            Geometric.Reset();
            Geometric.AddPath(ghost.Shape.Geometric, false);

            ghost.Selected = false;
            ghost.Visible  = false;

            this.Transformer.MirrorHorizontalOccurred += new MirrorHorizontalHandler(Transformer_MirrorHorizontalOccurred);
            this.Transformer.MirrorVerticalOccurred   += new MirrorVerticalHandler(Transformer_MirrorVerticalOccurred);

            this.Appearance = new GhostAppearance();
        }
예제 #4
0
파일: CompositeShape.cs 프로젝트: nistck/Jx
        /// <summary>
        /// Called when a shape is inserted.
        /// </summary>
        /// <param name="shape">Inserted shape.</param>
        /// <param name="index">Inserting index.</param>
        void _shapes_InsertedItem(IShape shape, int index)
        {
            (shape as Shape).Parent = this;

            Geometric.AddPath(shape.Geometric, false);
        }