Package org.w3c.dom.events

Examples of org.w3c.dom.events.MouseEvent


     * The class that is responsible for tracking 'mouseclick' changes.
     */
    protected class MouseClickTracker implements EventListener {

        public void handleEvent(Event evt) {
            MouseEvent mevt = (MouseEvent)evt;
            fireDOMActivateEvent(evt.getTarget(), mevt.getDetail());
        }
View Full Code Here


     * 'mouseover' event.
     */
    protected class MouseOverTracker implements EventListener {

        public void handleEvent(Event evt) {
            MouseEvent me = (MouseEvent) evt;
            EventTarget target = evt.getTarget();
            EventTarget relatedTarget = me.getRelatedTarget();
            fireDOMFocusInEvent(target, relatedTarget);
        }
View Full Code Here

     * 'mouseout' event.
     */
    protected class MouseOutTracker implements EventListener {

        public void handleEvent(Event evt) {
            MouseEvent me = (MouseEvent) evt;
            EventTarget target = evt.getTarget();
            EventTarget relatedTarget = me.getRelatedTarget();
            fireDOMFocusOutEvent(target, relatedTarget);
        }
View Full Code Here

    /**
     * The DOM EventListener invoked when the mouse exits an element
     */
    protected class DOMMouseOutEventListener implements EventListener {
        public void handleEvent(Event evt) {
            MouseEvent me = (MouseEvent)evt;
            Element newTarget = (Element)me.getRelatedTarget();
            Cursor cursor = CursorManager.DEFAULT_CURSOR;
            if (newTarget != null)
                cursor = CSSUtilities.convertCursor
                    (newTarget, BridgeContext.this);
            if (cursor == null)
View Full Code Here

            this.svgElement = svgElement;
            this.imgElement = imgElement;
        }

        public void handleEvent(Event e) {
            MouseEvent evt = (MouseEvent) e;
            MouseEvent newMouseEvent = (MouseEvent)
                // DOM Level 2 6.5 cast from Document to DocumentEvent is ok
                ((DocumentEvent)imgElement.getOwnerDocument()).createEvent("MouseEvents");

            newMouseEvent.initMouseEvent(evt.getType(),
                                         evt.getBubbles(),
                                         evt.getCancelable(),
                                         evt.getView(),
                                         evt.getDetail(),
                                         evt.getScreenX(),
View Full Code Here

            if ((evt.BUTTON1_MASK & evt.getModifiers()) != 0)
                button = 0;
            else
                if ((evt.BUTTON3_MASK & evt.getModifiers()) != 0)
                    button = 2;
            MouseEvent mevent =
                // DOM Level 2 6.5 cast from Document to DocumentEvent is ok
                (MouseEvent)org.apache.batik.dom.events.EventSupport.
                createEvent(org.apache.batik.dom.events.EventSupport.
                            MOUSE_EVENT_TYPE);
            // deal with the related node/target
            node = evt.getRelatedNode();
            EventTarget relatedTarget =
                (EventTarget)context.getElement(node);
            mevent.initMouseEvent(eventType, true, cancelok, null,
                                  evt.getClickCount(),
                                  screen.x, screen.y,
                                  (int)Math.floor(pos.getX()),
                                  (int)Math.floor(pos.getY()),
                                  evt.isControlDown(), evt.isAltDown(),
View Full Code Here

        return "MouseEvents";
    }

    public String getInitEvent(Event evt,String evtVarName,ClientDocumentStfulImpl clientDoc)
    {
        MouseEvent mouseEvt = (MouseEvent)evt;

        StringBuilder code = new StringBuilder();
        code.append( evtVarName + ".screenX=" + mouseEvt.getScreenX() + ";\n" );
        code.append( evtVarName + ".screenY=" + mouseEvt.getScreenY() + ";\n" );
        code.append( evtVarName + ".clientX=" + mouseEvt.getClientX() + ";\n" );
        code.append( evtVarName + ".clientY=" + mouseEvt.getClientY() + ";\n" );
        code.append( evtVarName + ".ctrlKey=" + mouseEvt.getCtrlKey() + ";\n" );
        code.append( evtVarName + ".shiftKey=" + mouseEvt.getShiftKey() + ";\n" );
        code.append( evtVarName + ".altKey=" + mouseEvt.getAltKey() + ";\n" );

        int button = 0;
        switch(mouseEvt.getButton())
        {
            case 0: button = 1; break; // bot�n izquierdo
            case 2: button = 2; break; // bot�n derecho
            case 1: button = 4; break; // bot�n de enmedio
        }
View Full Code Here

                boolean useJoystick = joystickCB.isSelected();
                if (useJoystick) joystickCB.setSelected(false);

                Element featureElem;
                MouseEvent event1;
                synchronized(itsNatDoc)
                {
                    featureElem = tree.getItsNatTreeUI().getParentElementFromTreePath(path);
                    event1 = createMouseEvent(itsNatDoc);
                }
                ((EventTarget)featureElem).dispatchEvent(event1); // Select feature

                if (panel == feature.getFirstPanel())
                    return;

                for( ; ; )
                {
                    synchronized(itsNatDoc)
                    {
                        if (tree.getTreeSelectionModel().isPathSelected(path))
                            break;
                    }
                    try{ Thread.sleep(200); }catch(InterruptedException ex) { throw new RuntimeException(ex); }
                }

                Element tabElem;
                MouseEvent event2;
                synchronized(itsNatDoc)
                {
                    tabElem = feature.getTabElement(panel);
                    event2 = createMouseEvent(itsNatDoc);
                }
View Full Code Here

        // event listeners in the component are not added until the load event is fired.
        boolean useJoystick = joystickCB.isSelected();
        if (useJoystick) joystickCB.setSelected(false);
           
        Element featureElem = tree.getItsNatTreeUI().getParentElementFromTreePath(path);
        MouseEvent event1 = createMouseEvent(itsNatDoc);
        ((EventTarget)featureElem).dispatchEvent(event1); // Select feature

        if (panel == feature.getFirstPanel())
            return;

        Element tabElem = feature.getTabElement(panel);
        MouseEvent event2 = createMouseEvent(itsNatDoc);
        ((EventTarget)tabElem).dispatchEvent(event2); // Select tab

        if (useJoystick) joystickCB.setSelected(true);
    }
View Full Code Here

    public static MouseEvent createMouseEvent(ItsNatDocument itsNatDoc)
    {
        Document doc = itsNatDoc.getDocument();
        AbstractView view = ((DocumentView)doc).getDefaultView();

        MouseEvent event = (MouseEvent)((DocumentEvent)doc).createEvent("MouseEvents");
        event.initMouseEvent("click",true,true,view,0,
                0,0,0,0,false,false,false,false,(short)0/*left button*/,null);
        return event;
    }
View Full Code Here

TOP

Related Classes of org.w3c.dom.events.MouseEvent

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.