Ejemplo n.º 1
0
        public override void MouseDown (MouseEvent ev) {
            base.MouseDown (ev);
            IDrawingView view = ev.View;
            
            if(IsRightButtonPressed (ev))
            {
                DelegateTool = new PanTool(Editor, CursorFactory.GetCursorFromType(Gdk.CursorType.Arrow));
            } 
            else
            {
                IHandle handle = view.FindHandle (ev.X, ev.Y);
                if (handle != null) {
                    DelegateTool = new HandleTracker (Editor, new UndoableHandle(handle));
                }
                else {
                    IFigure figure = view.Drawing.FindFigure (ev.X, ev.Y);
                    if (figure != null) {
                        DelegateTool = figure.CreateFigureTool (Editor, new DragTool (Editor, figure));
                    } else {
                        DelegateTool = new SelectAreaTool (Editor);
                    }
                }
            }

            if (DelegateTool != null) {
                DelegateTool.MouseDown (ev);
            }

        }
Ejemplo n.º 2
0
        public override void MouseDown(MouseEvent ev)
        {
            base.MouseDown(ev);
            IDrawingView view = ev.View;

            if (IsRightButtonPressed(ev))
            {
                DelegateTool = new PanTool(Editor, CursorFactory.GetCursorFromType(Gdk.CursorType.Arrow));
            }
            else
            {
                IHandle handle = view.FindHandle(ev.X, ev.Y);
                if (handle != null)
                {
                    DelegateTool = new HandleTracker(Editor, new UndoableHandle(handle));
                }
                else
                {
                    IFigure figure = view.Drawing.FindFigure(ev.X, ev.Y);
                    if (figure != null)
                    {
                        DelegateTool = figure.CreateFigureTool(Editor, new DragTool(Editor, figure));
                    }
                    else
                    {
                        DelegateTool = new SelectAreaTool(Editor);
                    }
                }
            }

            if (DelegateTool != null)
            {
                DelegateTool.MouseDown(ev);
            }
        }
Ejemplo n.º 3
0
        public override void MouseDown(MouseEvent ev)
        {
            base.MouseDown(ev);
            IDrawingView view = ev.View;

            IFigure figure = view.Drawing.FindFigure(ev.X, ev.Y);

            if(ev.IsRightButtonPressed())
            {
                ITool defaultTool = new PanTool(Editor, CursorFactory.GetCursorFromType(Gdk.CursorType.Arrow));
                if (figure != null) 
                {
                    DelegateTool = figure.CreateFigureTool(this, Editor, defaultTool, ev);
                }
                else
                {
                    //if it didn't hit figure then allow panning
                    DelegateTool = defaultTool;
                }
            } 
            else
            {
                IHandle handle = view.FindHandle(ev.X, ev.Y);
                if (handle != null) 
                {
                    DelegateTool = new HandleTracker(Editor, new UndoableHandle(handle));
                }
                else 
                {
                    if(figure != null) 
                    {
                        ITool dragTool = new DragTool(Editor, figure);
                        DelegateTool = figure.CreateFigureTool(this, Editor, dragTool, ev);
                    } 
                    else
                    {
                        DelegateTool = new SelectAreaTool(Editor);
                    }
                }
            }

            if (DelegateTool != null) 
            {
                DelegateTool.MouseDown (ev);
            }
        }
Ejemplo n.º 4
0
        public override void MouseDown(MouseEvent ev)
        {
            base.MouseDown(ev);
            IDrawingView view = ev.View;

            IFigure figure = view.Drawing.FindFigure(ev.X, ev.Y);

            if (ev.IsRightButtonPressed())
            {
                ITool defaultTool = new PanTool(Editor, CursorFactory.GetCursorFromType(Gdk.CursorType.Arrow));
                if (figure != null)
                {
                    DelegateTool = figure.CreateFigureTool(this, Editor, defaultTool, ev);
                }
                else
                {
                    //if it didn't hit figure then allow panning
                    DelegateTool = defaultTool;
                }
            }
            else
            {
                IHandle handle = view.FindHandle(ev.X, ev.Y);
                if (handle != null)
                {
                    DelegateTool = new HandleTracker(Editor, new UndoableHandle(handle));
                }
                else
                {
                    if (figure != null)
                    {
                        ITool dragTool = new DragTool(Editor, figure);
                        DelegateTool = figure.CreateFigureTool(this, Editor, dragTool, ev);
                    }
                    else
                    {
                        DelegateTool = new SelectAreaTool(Editor);
                    }
                }
            }

            if (DelegateTool != null)
            {
                DelegateTool.MouseDown(ev);
            }
        }
Ejemplo n.º 5
0
        // END // HERZUM SPRINT 2.5 TLAB-136
        // END HERZUM SPRINT 2.0 TLAB-136-2

        public override void MouseDown(MouseEvent ev)
        {
            base.MouseDown(ev);
            IDrawingView view = ev.View;

            // HERZUM SPRINT 2.5 TLAB-136
            if (!mouseUp){
                return;
            }
            else
            {
                mouseUp = false;
                mouseDown = true;
            }
            // HERZUM SPRINT 2.5 TLAB-136

            // HERZUM SPRINT 2.0 TLAB-136-2
            /*
            if (x!=-1 && (x != ev.X || y != ev.Y)){
                x = ev.X;
                y = ev.Y;
            } 
            else if (x == ev.X && y == ev.Y)
                return;
            else {
                x = ev.X;
                y = ev.Y;
            }
            */
            // END HERZUM SPRINT 2.5 TLAB-136
            // END HERZUM SPRINT 2.2 TLAB-136-2

            IFigure figure = view.Drawing.FindFigure(ev.X, ev.Y);

            if(ev.IsRightButtonPressed())
            {
                ITool defaultTool = new PanTool(Editor, CursorFactory.GetCursorFromType(Gdk.CursorType.Arrow));
                if (figure != null) 
                {
                    DelegateTool = figure.CreateFigureTool(this, Editor, defaultTool, ev);
                }
                else
                {
                    //if it didn't hit figure then allow panning
                    DelegateTool = defaultTool;
                }
            } 
            else
            {
                IHandle handle = view.FindHandle(ev.X, ev.Y);
                if (handle != null) 
                {
                    DelegateTool = new HandleTracker(Editor, new UndoableHandle(handle));
                }
                else 
                {
                    if(figure != null) 
                    {
                        ITool dragTool = new DragTool(Editor, figure);
                        DelegateTool = figure.CreateFigureTool(this, Editor, dragTool, ev);
                    } 
                    else
                    {
                        DelegateTool = new SelectAreaTool(Editor);
                    }
                }
            }

            if (DelegateTool != null) 
            {
                DelegateTool.MouseDown (ev);
            }
        }
 public void SetPanTool() 
 {
     Tool = new PanTool(this, CustomCursorFactory.OpenHandGrabCursor);
 }
Ejemplo n.º 7
0
        // END // HERZUM SPRINT 2.5 TLAB-136
        // END HERZUM SPRINT 2.0 TLAB-136-2

        public override void MouseDown(MouseEvent ev)
        {
            base.MouseDown(ev);
            IDrawingView view = ev.View;

            // HERZUM SPRINT 2.5 TLAB-136
            if (!mouseUp)
            {
                return;
            }
            else
            {
                mouseUp   = false;
                mouseDown = true;
            }
            // HERZUM SPRINT 2.5 TLAB-136

            // HERZUM SPRINT 2.0 TLAB-136-2

            /*
             * if (x!=-1 && (x != ev.X || y != ev.Y)){
             *  x = ev.X;
             *  y = ev.Y;
             * }
             * else if (x == ev.X && y == ev.Y)
             *  return;
             * else {
             *  x = ev.X;
             *  y = ev.Y;
             * }
             */
            // END HERZUM SPRINT 2.5 TLAB-136
            // END HERZUM SPRINT 2.2 TLAB-136-2

            IFigure figure = view.Drawing.FindFigure(ev.X, ev.Y);

            if (ev.IsRightButtonPressed())
            {
                ITool defaultTool = new PanTool(Editor, CursorFactory.GetCursorFromType(Gdk.CursorType.Arrow));
                if (figure != null)
                {
                    DelegateTool = figure.CreateFigureTool(this, Editor, defaultTool, ev);
                }
                else
                {
                    //if it didn't hit figure then allow panning
                    DelegateTool = defaultTool;
                }
            }
            else
            {
                IHandle handle = view.FindHandle(ev.X, ev.Y);
                if (handle != null)
                {
                    DelegateTool = new HandleTracker(Editor, new UndoableHandle(handle));
                }
                else
                {
                    if (figure != null)
                    {
                        ITool dragTool = new DragTool(Editor, figure);
                        DelegateTool = figure.CreateFigureTool(this, Editor, dragTool, ev);
                    }
                    else
                    {
                        DelegateTool = new SelectAreaTool(Editor);
                    }
                }
            }

            if (DelegateTool != null)
            {
                DelegateTool.MouseDown(ev);
            }
        }