Package org.locationtech.udig.project.ui.render.displayAdapter

Examples of org.locationtech.udig.project.ui.render.displayAdapter.MapMouseEvent


    /**
     * @see org.eclipse.swt.events.MouseListener#mouseDoubleClick(org.eclipse.swt.events.MouseEvent)
     */
    public void mouseDoubleClick( Event e ) {
        MapMouseEvent m = createMapMouseEvent(e);
        m=new MapMouseEvent(pane, m.x, m.y,
                m.modifiers, m.buttons|m.button, m.button);
        eventJob.fire(EventJob.DOUBLE_CLICK, m);
    }
View Full Code Here


                m.modifiers, m.buttons|m.button, m.button);
        eventJob.fire(EventJob.DOUBLE_CLICK, m);
    }

    private MapMouseEvent createMapMouseEvent(Event e) {
        return new MapMouseEvent(pane, e.x, e.y,
                e.stateMask, getButtonsDown(e), getButton(e.button));
    }
View Full Code Here

    /**
     * @see org.eclipse.swt.events.MouseListener#mouseDown(org.eclipse.swt.events.MouseEvent)
     */
    public void mouseDown( Event e ) {
        MapMouseEvent m = createMapMouseEvent(e);
        m=new MapMouseEvent(pane, m.x, m.y,
                m.modifiers, m.buttons|m.button, m.button);
        eventJob.fire(EventJob.PRESSED, m);
    }
View Full Code Here

    /**
     * @see org.eclipse.swt.events.MouseListener#mouseUp(org.eclipse.swt.events.MouseEvent)
     */
    public void mouseUp( Event e ) {
        MapMouseEvent m = createMapMouseEvent(e);
        if( (m.button&m.buttons)!=0 )
            m=new MapMouseEvent(m.source, m.x, m.y, m.modifiers, m.buttons^m.button, m.button );
        eventJob.fire(EventJob.RELEASED, m);
    }
View Full Code Here

    /**
     * @see org.eclipse.swt.events.MouseMoveListener#mouseMove(org.eclipse.swt.events.MouseEvent)
     */
    public void mouseMove( Event e ) {
        MapMouseEvent m = createMapMouseEvent(e);
        if (m.buttons == 0)
            eventJob.fire(EventJob.MOVED, m);
        else {
            eventJob.fire(EventJob.DRAGGED, m);
        }
View Full Code Here

    /**
     * @see org.eclipse.swt.events.MouseTrackListener#mouseEnter(org.eclipse.swt.events.MouseEvent)
     */
    public void mouseEnter( Event e ) {
        MapMouseEvent m = createMapMouseEvent(e);
        eventJob.fire(EventJob.ENTERED, m);
    }
View Full Code Here

    /**
     * @see org.eclipse.swt.events.MouseTrackListener#mouseExit(org.eclipse.swt.events.MouseEvent)
     */
    public void mouseExit( Event e ) {
        MapMouseEvent m = createMapMouseEvent(e);
        eventJob.fire(EventJob.EXITED, m);
    }
View Full Code Here

    /**
     * @see org.eclipse.swt.events.MouseTrackListener#mouseHover(org.eclipse.swt.events.MouseEvent)
     */
    public void mouseHover( Event e ) {
        MapMouseEvent m = createMapMouseEvent(e);
        eventJob.fire(EventJob.HOVERED, m);
    }
View Full Code Here

        final int alt = MapMouseEvent.ALT_DOWN_MASK;
        final int button1 = MapMouseEvent.BUTTON1;
        final int button2 = MapMouseEvent.BUTTON2;
       
        TestHandler handler=new TestHandler();
        assertFalse(mode.isValid(handler, new MapMouseEvent(null, 0, 0, none, none, 0), EventType.DOUBLE_CLICK));
        assertFalse(mode.isValid(handler, new MapMouseEvent(null, 0, 0, none, button1, button1), EventType.PRESSED));

        handler.setCurrentShape(handler.getEditBlackboard().getGeoms().get(0).getShell());
        handler.getEditBlackboard().addPoint(10,0, handler.getCurrentGeom().getShell());

       
        assertTrue(mode.isValid(handler,  new MapMouseEvent(null, 10, 0, none, button1, button1), EventType.PRESSED));
        assertFalse(mode.isValid(handler, new MapMouseEvent(null, 10, 0, none, button1, button1), EventType.DRAGGED));
        assertFalse(mode.isValid(handler, new MapMouseEvent(null, 10, 0, none, button1, button1), EventType.DRAGGED));
        assertFalse(mode.isValid(handler, new MapMouseEvent(null, 10, 0, none, button1, button1), EventType.EXITED));
        assertFalse(mode.isValid(handler, new MapMouseEvent(null, 10, 0, none, button1, button1), EventType.MOVED));
        assertFalse(mode.isValid(handler, new MapMouseEvent(null, 10, 0, none, button1, button1), EventType.RELEASED));

        assertFalse(mode.isValid(handler, new MapMouseEvent(null, 10,0, ctrl,button1, button1), EventType.PRESSED));
        assertFalse(mode.isValid(handler, new MapMouseEvent(null, 10,0, shift, button1, button1), EventType.PRESSED));

        assertFalse(mode.isValid(handler, new MapMouseEvent(null, 10,0, alt, button1, button1), EventType.PRESSED));
        assertFalse(mode.isValid(handler, new MapMouseEvent(null,
                0, 0, shift|ctrl, button1, button1), EventType.PRESSED));
       
        assertFalse(mode.isValid(handler,  new MapMouseEvent(null, 10, 0, none, button2, button2), EventType.PRESSED));
    }
View Full Code Here

        handler.getEditBlackboard().addPoint(15,15, handler.getCurrentGeom().getShell());
        handler.getEditBlackboard().addPoint(20,15, handler.getCurrentGeom().getShell());
        handler.getEditBlackboard().addPoint(30,25, handler.getCurrentGeom().getShell());
       
        //test click on point
        handler.handleEvent( new MapMouseEvent(null, 9, 10, none, button1, button1), EventType.PRESSED);
        assertEquals(1, handler.getEditBlackboard().getSelection().size());
        assertEquals(Point.valueOf(10,10), handler.getEditBlackboard().getSelection().iterator().next());

        //test click on same point
        handler.handleEvent( new MapMouseEvent(null, 10, 10, none, button1, button1), EventType.PRESSED);
        assertEquals(Point.valueOf(10,10), handler.getEditBlackboard().getSelection().iterator().next());
        assertEquals(1, handler.getEditBlackboard().getSelection().size());
       
        //test click on new point
        handler.handleEvent( new MapMouseEvent(null, 15, 15, none, button1, button1), EventType.PRESSED);
        assertEquals(Point.valueOf(15,15), handler.getEditBlackboard().getSelection().iterator().next());
        assertEquals(1, handler.getEditBlackboard().getSelection().size());
       
        //do nothing on click on nothing
        MapMouseEvent event = new MapMouseEvent(null, 300, 300, none, button1, button1);
        handler.handleEvent( event, EventType.PRESSED);
        assertEquals(1, handler.getEditBlackboard().getSelection().size());
       
    }
View Full Code Here

TOP

Related Classes of org.locationtech.udig.project.ui.render.displayAdapter.MapMouseEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.