Package org.w3c.dom.events

Examples of org.w3c.dom.events.MouseEvent


            public void run()
            {
                for(int i = 0; i < buttonElems.length; i++)
                {
                    Element buttonElem;
                    MouseEvent mouseEvt;
                    synchronized(itsNatDoc)
                    {
                        Document doc = itsNatDoc.getDocument();
                        AbstractView view = ((DocumentView)doc).getDefaultView();

                        mouseEvt = (MouseEvent)((DocumentEvent)doc).createEvent("MouseEvents");
                        mouseEvt.initMouseEvent("click",true,true,view,0,
                                0,0,0,0,false,false,false,false,(short)0/*left button*/,null);

                        buttonElem = buttonElems[i];
                    }

View Full Code Here


        AbstractView view = ((DocumentView)doc).getDefaultView();

        for(int i = 0; i < buttonElems.length; i++)
        {
            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);

            Element buttonElem = buttonElems[i];
            ((EventTarget)buttonElem).dispatchEvent(event);
            // Alternative: itsNatDoc.dispatchEvent((EventTarget)buttonElem,event);
View Full Code Here

                    public void run()
                    {
                        for(int i = 0; i < buttonElems.length; i++)
                        {
                            Element buttonElem;
                            MouseEvent mouseEvt;
                            synchronized(itsNatDoc)
                            {
                                Document doc = itsNatDoc.getDocument();
                                AbstractView view = ((DocumentView)doc).getDefaultView();

                                mouseEvt = (MouseEvent)itsNatDoc.createEvent("MouseEvents");
                                mouseEvt.initMouseEvent("click",true,true,view,0,
                                        0,0,0,0,false,false,false,false,(short)0/*left button*/,null);

                                buttonElem = buttonElems[i];
                            }

View Full Code Here

    public void fireEvents(ClientDocument clientDoc)
    {
        final Document doc = itsNatDoc.getDocument();

        MouseEvent eventClick = (MouseEvent)((DocumentEvent)doc).createEvent("MouseEvents");
        eventClick.initMouseEvent("click",true,true,((DocumentView)doc).getDefaultView(),
                0,100,200,300,400,false,false,false,false,(short)0,null);
        ((ItsNatNormalEvent)eventClick).setExtraParam("extra","Hello");
        boolean res = ((EventTarget)nodeToClick).dispatchEvent(eventClick);

        ItsNatKeyEvent eventKey = (ItsNatKeyEvent)((DocumentEvent)doc).createEvent("KeyEvents");
View Full Code Here

        {
            public void run()
            {
                // Al ser un hilo diferente el document no est� sincronizado (no debe estarlo)

                MouseEvent eventClick;
                synchronized(itsNatDoc) // no hace falta pero por si acaso
                {
                    eventClick = (MouseEvent)((DocumentEvent)doc).createEvent("MouseEvents");
                }
                eventClick.initMouseEvent("click",true,true,((DocumentView)doc).getDefaultView(),
                        0,100,200,300,400,false,false,false,false,(short)0,null);
                boolean res = ((EventTarget)nodeToClick).dispatchEvent(eventClick);

                ItsNatKeyEvent eventKey;
                synchronized(itsNatDoc) // no hace falta pero por si acaso
View Full Code Here

    }

    private MouseEvent createMouseEvent(String type,boolean shiftKey)
    {
        Document doc = itsNatDoc.getDocument();
        MouseEvent event = (MouseEvent)((DocumentEvent)doc).createEvent("MouseEvents");
        AbstractView view = ((DocumentView)doc).getDefaultView();
        event.initMouseEvent(type,true,true,view,0,
                0,0,0,0,false,false,shiftKey,false,(short)0/*left button*/,null);
        return event;
    }
View Full Code Here

    }

    public MouseEvent createMouseEvent(String type,boolean shiftKey)
    {
        Document doc = itsNatDoc.getDocument();
        MouseEvent event = (MouseEvent)((DocumentEvent)doc).createEvent("MouseEvents");
        AbstractView view = ((DocumentView)doc).getDefaultView();
        event.initMouseEvent(type,true,true,view,0,
                0,0,0,0,false,false,shiftKey,false,(short)0/*left button*/,null);
        return event;
    }
View Full Code Here

    {
        String type = evt.getType();
        if (type.equals("click") || type.equals("mouseup"))
        {
            Node nodeClicked = (Node)evt.getTarget(); // Puede ser un nodo interior del elemento pulsado
            MouseEvent mouseEvt = (MouseEvent)evt;
            boolean toggle;
            if (!isSelectionUsesKeyboard()) toggle = true;
            else toggle = mouseEvt.getCtrlKey();
            boolean extend = mouseEvt.getShiftKey();

            ItsNatTableHeaderCellUI headerCellInfo = null;
            if (header != null)
            {
                // Vemos si ha sido pulsada la cabecera
View Full Code Here

    public void selectTreeNode(ItsNatTreeCellUI nodeInfo, Event evt)
    {
        int row = nodeInfo.getRow();
        if (row >= 0) // por si acaso
        {
            MouseEvent mouseEvt = (MouseEvent) evt;
            boolean toggle;
            if (!isSelectionUsesKeyboard())
                toggle = true;
            else
                toggle = mouseEvt.getCtrlKey();

            boolean extend = mouseEvt.getShiftKey();
            boolean selected = selModelMgr.isRowSelected(row);
            selModelMgr.changeSelectionModel(row, toggle, extend, selected);
        }
    }
View Full Code Here

        return "MouseEvents";
    }

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

        return evtVarName + ".initMouseEvent("
                + "\"" + mouseEvt.getType() + "\","
                + mouseEvt.getBubbles() + ","
                + mouseEvt.getCancelable() + ","
                + getViewPath(mouseEvt.getView(),clientDoc) + ","
                + mouseEvt.getDetail() + ","
                + mouseEvt.getScreenX() + ","
                + mouseEvt.getScreenY() + ","
                + mouseEvt.getClientX() + ","
                + mouseEvt.getClientY() + ","
                + mouseEvt.getCtrlKey() + ","
                + mouseEvt.getAltKey() + ","
                + mouseEvt.getShiftKey() + ","
                + mouseEvt.getMetaKey() + ","
                + mouseEvt.getButton() + ","
                + clientDoc.getNodeReference((Node)mouseEvt.getRelatedTarget(),true,false)
                + ");\n";
    }
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.