Java 类org.w3c.dom.events.DocumentEvent 实例源码

项目:Push2Display    文件:SVG12BridgeEventSupport.java   
/**
 * Dispatch a DOM 3 Text event.
 */
protected void dispatchTextEvent(GraphicsNodeKeyEvent evt) {
    FocusManager fmgr = context.getFocusManager();
    if (fmgr == null) {
        return;
    }

    Element targetElement = (Element) fmgr.getCurrentEventTarget();
    if (targetElement == null) {
        targetElement = context.getDocument().getDocumentElement();
    }
    DocumentEvent d = (DocumentEvent) targetElement.getOwnerDocument();
    DOMTextEvent textEvt = (DOMTextEvent) d.createEvent("TextEvent");
    textEvt.initTextEventNS(XMLConstants.XML_EVENTS_NAMESPACE_URI,
                            "textInput", 
                            true,
                            true,
                            null,
                            String.valueOf(evt.getKeyChar()));

    try {
        ((EventTarget) targetElement).dispatchEvent(textEvt);
    } catch (RuntimeException e) {
        ua.displayError(e);
    }
}
项目:Push2Display    文件:SVG12BridgeEventSupport.java   
public void mouseWheelMoved(GraphicsNodeMouseWheelEvent evt) {
    Document doc = context.getPrimaryBridgeContext().getDocument();
    Element targetElement = doc.getDocumentElement();
    DocumentEvent d = (DocumentEvent) doc;
    SVGOMWheelEvent wheelEvt
        = (SVGOMWheelEvent) d.createEvent("WheelEvent");
    wheelEvt.initWheelEventNS(XMLConstants.XML_EVENTS_NAMESPACE_URI,
                              "wheel", 
                              true,
                              true,
                              null,
                              evt.getWheelDelta());

    try {
        ((EventTarget)targetElement).dispatchEvent(wheelEvt);
    } catch (RuntimeException e) {
        ua.displayError(e);
    }
}
项目:Push2Display    文件:SVG12FocusManager.java   
/**
 * Fires a 'DOMFocusIn' event to the specified target.
 *
 * @param target the newly focussed event target
 * @param relatedTarget the previously focussed event target
 */
protected void fireDOMFocusInEvent(EventTarget target,
                                   EventTarget relatedTarget) {
    DocumentEvent docEvt = 
        (DocumentEvent)((Element)target).getOwnerDocument();
    DOMUIEvent uiEvt = (DOMUIEvent)docEvt.createEvent("UIEvents");
    uiEvt.initUIEventNS(XMLConstants.XML_EVENTS_NAMESPACE_URI,
                        "DOMFocusIn",
                        true,
                        false,  // canBubbleArg
                        null,   // cancelableArg
                        0);     // detailArg
    int limit = DefaultXBLManager.computeBubbleLimit((Node) relatedTarget,
                                                     (Node) target);
    ((AbstractEvent) uiEvt).setBubbleLimit(limit);
    target.dispatchEvent(uiEvt);
}
项目:Push2Display    文件:SVG12FocusManager.java   
/**
 * Fires a 'DOMFocusOut' event to the specified target.
 *
 * @param target the previously focussed event target
 * @param relatedTarget the newly focussed event target
 */
protected void fireDOMFocusOutEvent(EventTarget target,
                                    EventTarget relatedTarget) {
    DocumentEvent docEvt = 
        (DocumentEvent)((Element)target).getOwnerDocument();
    DOMUIEvent uiEvt = (DOMUIEvent)docEvt.createEvent("UIEvents");
    uiEvt.initUIEventNS(XMLConstants.XML_EVENTS_NAMESPACE_URI,
                        "DOMFocusOut",
                        true,
                        false,  // canBubbleArg
                        null,   // cancelableArg
                        0);     // detailArg
    int limit = DefaultXBLManager.computeBubbleLimit((Node) target,
                                                     (Node) relatedTarget);
    ((AbstractEvent) uiEvt).setBubbleLimit(limit);
    target.dispatchEvent(uiEvt);
}
项目:Push2Display    文件:SVGImageElementBridge.java   
public void handleEvent(Event e) {
    DOMMouseEvent evt = (DOMMouseEvent) e;
    DOMMouseEvent newMouseEvent = (DOMMouseEvent)
        // DOM Level 2 6.5 cast from Document to DocumentEvent is ok
        ((DocumentEvent)imgElement.getOwnerDocument()).createEvent("MouseEvents");

    newMouseEvent.initMouseEventNS
        (XMLConstants.XML_EVENTS_NAMESPACE_URI,
         evt.getType(),
         evt.getBubbles(),
         evt.getCancelable(),
         evt.getView(),
         evt.getDetail(),
         evt.getScreenX(),
         evt.getScreenY(),
         evt.getClientX(),
         evt.getClientY(),
         evt.getButton(),
         (EventTarget)imgElement,
         evt.getModifiersString());
    ((EventTarget)imgElement).dispatchEvent(newMouseEvent);
}
项目:TextSecureSMP    文件:SmilParElementImpl.java   
public boolean beginElement() {
    DocumentEvent doc = (DocumentEvent) SmilParElementImpl.this.getOwnerDocument();
    Event startEvent = doc.createEvent("Event");
    startEvent.initEvent(SMIL_SLIDE_START_EVENT, false, false);
    dispatchEvent(startEvent);
    return true;
}
项目:Push2Display    文件:SVG12BridgeEventSupport.java   
/**
 * Dispatch a DOM 3 Text event.
 */
protected void dispatchTextEvent(GraphicsNodeKeyEvent evt) {
    FocusManager fmgr = context.getFocusManager();
    if (fmgr == null) {
        return;
    }

    Element targetElement = (Element) fmgr.getCurrentEventTarget();
    if (targetElement == null) {
        targetElement = context.getDocument().getDocumentElement();
    }
    DocumentEvent d = (DocumentEvent) targetElement.getOwnerDocument();
    DOMTextEvent textEvt = (DOMTextEvent) d.createEvent("TextEvent");
    textEvt.initTextEventNS(XMLConstants.XML_EVENTS_NAMESPACE_URI,
                            "textInput", 
                            true,
                            true,
                            null,
                            String.valueOf(evt.getKeyChar()));

    try {
        ((EventTarget) targetElement).dispatchEvent(textEvt);
    } catch (RuntimeException e) {
        ua.displayError(e);
    }
}
项目:Push2Display    文件:SVG12BridgeEventSupport.java   
public void mouseWheelMoved(GraphicsNodeMouseWheelEvent evt) {
    Document doc = context.getPrimaryBridgeContext().getDocument();
    Element targetElement = doc.getDocumentElement();
    DocumentEvent d = (DocumentEvent) doc;
    SVGOMWheelEvent wheelEvt
        = (SVGOMWheelEvent) d.createEvent("WheelEvent");
    wheelEvt.initWheelEventNS(XMLConstants.XML_EVENTS_NAMESPACE_URI,
                              "wheel", 
                              true,
                              true,
                              null,
                              evt.getWheelDelta());

    try {
        ((EventTarget)targetElement).dispatchEvent(wheelEvt);
    } catch (RuntimeException e) {
        ua.displayError(e);
    }
}
项目:Push2Display    文件:SVG12FocusManager.java   
/**
 * Fires a 'DOMFocusIn' event to the specified target.
 *
 * @param target the newly focussed event target
 * @param relatedTarget the previously focussed event target
 */
protected void fireDOMFocusInEvent(EventTarget target,
                                   EventTarget relatedTarget) {
    DocumentEvent docEvt = 
        (DocumentEvent)((Element)target).getOwnerDocument();
    DOMUIEvent uiEvt = (DOMUIEvent)docEvt.createEvent("UIEvents");
    uiEvt.initUIEventNS(XMLConstants.XML_EVENTS_NAMESPACE_URI,
                        "DOMFocusIn",
                        true,
                        false,  // canBubbleArg
                        null,   // cancelableArg
                        0);     // detailArg
    int limit = DefaultXBLManager.computeBubbleLimit((Node) relatedTarget,
                                                     (Node) target);
    ((AbstractEvent) uiEvt).setBubbleLimit(limit);
    target.dispatchEvent(uiEvt);
}
项目:Push2Display    文件:SVG12FocusManager.java   
/**
 * Fires a 'DOMFocusOut' event to the specified target.
 *
 * @param target the previously focussed event target
 * @param relatedTarget the newly focussed event target
 */
protected void fireDOMFocusOutEvent(EventTarget target,
                                    EventTarget relatedTarget) {
    DocumentEvent docEvt = 
        (DocumentEvent)((Element)target).getOwnerDocument();
    DOMUIEvent uiEvt = (DOMUIEvent)docEvt.createEvent("UIEvents");
    uiEvt.initUIEventNS(XMLConstants.XML_EVENTS_NAMESPACE_URI,
                        "DOMFocusOut",
                        true,
                        false,  // canBubbleArg
                        null,   // cancelableArg
                        0);     // detailArg
    int limit = DefaultXBLManager.computeBubbleLimit((Node) target,
                                                     (Node) relatedTarget);
    ((AbstractEvent) uiEvt).setBubbleLimit(limit);
    target.dispatchEvent(uiEvt);
}
项目:Push2Display    文件:SVGImageElementBridge.java   
public void handleEvent(Event e) {
    DOMMouseEvent evt = (DOMMouseEvent) e;
    DOMMouseEvent newMouseEvent = (DOMMouseEvent)
        // DOM Level 2 6.5 cast from Document to DocumentEvent is ok
        ((DocumentEvent)imgElement.getOwnerDocument()).createEvent("MouseEvents");

    newMouseEvent.initMouseEventNS
        (XMLConstants.XML_EVENTS_NAMESPACE_URI,
         evt.getType(),
         evt.getBubbles(),
         evt.getCancelable(),
         evt.getView(),
         evt.getDetail(),
         evt.getScreenX(),
         evt.getScreenY(),
         evt.getClientX(),
         evt.getClientY(),
         evt.getButton(),
         (EventTarget)imgElement,
         evt.getModifiersString());
    ((EventTarget)imgElement).dispatchEvent(newMouseEvent);
}
项目:feathers-sdk    文件:SVG12BridgeEventSupport.java   
/**
 * Dispatch a DOM 3 Text event.
 */
protected void dispatchTextEvent(GraphicsNodeKeyEvent evt) {
    FocusManager fmgr = context.getFocusManager();
    if (fmgr == null) {
        return;
    }

    Element targetElement = (Element) fmgr.getCurrentEventTarget();
    if (targetElement == null) {
        targetElement = context.getDocument().getDocumentElement();
    }
    DocumentEvent d = (DocumentEvent) targetElement.getOwnerDocument();
    DOMTextEvent textEvt = (DOMTextEvent) d.createEvent("TextEvent");
    textEvt.initTextEventNS(XMLConstants.XML_EVENTS_NAMESPACE_URI,
                            "textInput", 
                            true,
                            true,
                            null,
                            String.valueOf(evt.getKeyChar()));

    try {
        ((EventTarget) targetElement).dispatchEvent(textEvt);
    } catch (RuntimeException e) {
        ua.displayError(e);
    }
}
项目:feathers-sdk    文件:SVG12BridgeEventSupport.java   
public void mouseWheelMoved(GraphicsNodeMouseWheelEvent evt) {
    Document doc = context.getPrimaryBridgeContext().getDocument();
    Element targetElement = doc.getDocumentElement();
    DocumentEvent d = (DocumentEvent) doc;
    SVGOMWheelEvent wheelEvt
        = (SVGOMWheelEvent) d.createEvent("WheelEvent");
    wheelEvt.initWheelEventNS(XMLConstants.XML_EVENTS_NAMESPACE_URI,
                              "wheel", 
                              true,
                              true,
                              null,
                              evt.getWheelDelta());

    try {
        ((EventTarget)targetElement).dispatchEvent(wheelEvt);
    } catch (RuntimeException e) {
        ua.displayError(e);
    }
}
项目:feathers-sdk    文件:SVG12FocusManager.java   
/**
 * Fires a 'DOMFocusIn' event to the specified target.
 *
 * @param target the newly focussed event target
 * @param relatedTarget the previously focussed event target
 */
protected void fireDOMFocusInEvent(EventTarget target,
                                   EventTarget relatedTarget) {
    DocumentEvent docEvt = 
        (DocumentEvent)((Element)target).getOwnerDocument();
    DOMUIEvent uiEvt = (DOMUIEvent)docEvt.createEvent("UIEvents");
    uiEvt.initUIEventNS(XMLConstants.XML_EVENTS_NAMESPACE_URI,
                        "DOMFocusIn",
                        true,
                        false,  // canBubbleArg
                        null,   // cancelableArg
                        0);     // detailArg
    int limit = DefaultXBLManager.computeBubbleLimit((Node) relatedTarget,
                                                     (Node) target);
    ((AbstractEvent) uiEvt).setBubbleLimit(limit);
    target.dispatchEvent(uiEvt);
}
项目:feathers-sdk    文件:SVG12FocusManager.java   
/**
 * Fires a 'DOMFocusOut' event to the specified target.
 *
 * @param target the previously focussed event target
 * @param relatedTarget the newly focussed event target
 */
protected void fireDOMFocusOutEvent(EventTarget target,
                                    EventTarget relatedTarget) {
    DocumentEvent docEvt = 
        (DocumentEvent)((Element)target).getOwnerDocument();
    DOMUIEvent uiEvt = (DOMUIEvent)docEvt.createEvent("UIEvents");
    uiEvt.initUIEventNS(XMLConstants.XML_EVENTS_NAMESPACE_URI,
                        "DOMFocusOut",
                        true,
                        false,  // canBubbleArg
                        null,   // cancelableArg
                        0);     // detailArg
    int limit = DefaultXBLManager.computeBubbleLimit((Node) target,
                                                     (Node) relatedTarget);
    ((AbstractEvent) uiEvt).setBubbleLimit(limit);
    target.dispatchEvent(uiEvt);
}
项目:feathers-sdk    文件:SVGImageElementBridge.java   
public void handleEvent(Event e) {
    DOMMouseEvent evt = (DOMMouseEvent) e;
    DOMMouseEvent newMouseEvent = (DOMMouseEvent)
        // DOM Level 2 6.5 cast from Document to DocumentEvent is ok
        ((DocumentEvent)imgElement.getOwnerDocument()).createEvent("MouseEvents");

    newMouseEvent.initMouseEventNS
        (XMLConstants.XML_EVENTS_NAMESPACE_URI,
         evt.getType(),
         evt.getBubbles(),
         evt.getCancelable(),
         evt.getView(),
         evt.getDetail(),
         evt.getScreenX(),
         evt.getScreenY(),
         evt.getClientX(),
         evt.getClientY(),
         evt.getButton(),
         (EventTarget)imgElement,
         evt.getModifiersString());
    ((EventTarget)imgElement).dispatchEvent(newMouseEvent);
}
项目:visual-programming    文件:SvgObject.java   
public void invokeScriptEvent(String eventName) {

        SVGElement eventElement = getElement(SvgElementType.Event);

        if (eventElement != null) {
            eventElement.setTextContent(eventName);

            DocumentEvent de = (DocumentEvent) doc;
            MutationEvent ev = (MutationEvent) de.createEvent("MutationEvents");
            ev.initMutationEvent("DOMCharacterDataModified", true, // canBubbleArg
                    false, // cancelableArg
                    null, // relatedNodeArg
                    null, // prevValueArg
                    null, // newValueArg
                    null, // attrNameArg
                    ev.ADDITION);
            EventTarget t = (EventTarget) eventElement;
            t.dispatchEvent(ev);
        }
    }
项目:PeSanKita-android    文件:SmilParElementImpl.java   
public boolean beginElement() {
    DocumentEvent doc = (DocumentEvent) SmilParElementImpl.this.getOwnerDocument();
    Event startEvent = doc.createEvent("Event");
    startEvent.initEvent(SMIL_SLIDE_START_EVENT, false, false);
    dispatchEvent(startEvent);
    return true;
}
项目:PeSanKita-android    文件:SmilParElementImpl.java   
public boolean endElement() {
    DocumentEvent doc = (DocumentEvent) SmilParElementImpl.this.getOwnerDocument();
    Event endEvent = doc.createEvent("Event");
    endEvent.initEvent(SMIL_SLIDE_END_EVENT, false, false);
    dispatchEvent(endEvent);
    return true;
}
项目:PeSanKita-android    文件:SmilMediaElementImpl.java   
private Event createEvent(String eventType) {
    DocumentEvent doc =
        (DocumentEvent)SmilMediaElementImpl.this.getOwnerDocument();
    Event event = doc.createEvent("Event");
    event.initEvent(eventType, false, false);
    if (LOCAL_LOGV) {
        Log.v(TAG, "Dispatching 'begin' event to "
                + SmilMediaElementImpl.this.getTagName() + " "
                + SmilMediaElementImpl.this.getSrc() + " at "
                + System.currentTimeMillis());
    }
    return event;
}
项目:PeSanKita-android    文件:SmilMediaElementImpl.java   
private Event createEvent(String eventType, int seekTo) {
    DocumentEvent doc =
        (DocumentEvent)SmilMediaElementImpl.this.getOwnerDocument();
    EventImpl event = (EventImpl) doc.createEvent("Event");
    event.initEvent(eventType, false, false, seekTo);
    if (LOCAL_LOGV) {
        Log.v(TAG, "Dispatching 'begin' event to "
                + SmilMediaElementImpl.this.getTagName() + " "
                + SmilMediaElementImpl.this.getSrc() + " at "
                + System.currentTimeMillis());
    }
    return event;
}
项目:TextSecure    文件:SmilParElementImpl.java   
public boolean beginElement() {
    DocumentEvent doc = (DocumentEvent) SmilParElementImpl.this.getOwnerDocument();
    Event startEvent = doc.createEvent("Event");
    startEvent.initEvent(SMIL_SLIDE_START_EVENT, false, false);
    dispatchEvent(startEvent);
    return true;
}
项目:TextSecure    文件:SmilParElementImpl.java   
public boolean endElement() {
    DocumentEvent doc = (DocumentEvent) SmilParElementImpl.this.getOwnerDocument();
    Event endEvent = doc.createEvent("Event");
    endEvent.initEvent(SMIL_SLIDE_END_EVENT, false, false);
    dispatchEvent(endEvent);
    return true;
}
项目:TextSecure    文件:SmilMediaElementImpl.java   
private Event createEvent(String eventType) {
    DocumentEvent doc =
        (DocumentEvent)SmilMediaElementImpl.this.getOwnerDocument();
    Event event = doc.createEvent("Event");
    event.initEvent(eventType, false, false);
    if (LOCAL_LOGV) {
        Log.v(TAG, "Dispatching 'begin' event to "
                + SmilMediaElementImpl.this.getTagName() + " "
                + SmilMediaElementImpl.this.getSrc() + " at "
                + System.currentTimeMillis());
    }
    return event;
}
项目:TextSecure    文件:SmilMediaElementImpl.java   
private Event createEvent(String eventType, int seekTo) {
    DocumentEvent doc =
        (DocumentEvent)SmilMediaElementImpl.this.getOwnerDocument();
    EventImpl event = (EventImpl) doc.createEvent("Event");
    event.initEvent(eventType, false, false, seekTo);
    if (LOCAL_LOGV) {
        Log.v(TAG, "Dispatching 'begin' event to "
                + SmilMediaElementImpl.this.getTagName() + " "
                + SmilMediaElementImpl.this.getSrc() + " at "
                + System.currentTimeMillis());
    }
    return event;
}
项目:Push2Display    文件:BridgeEventSupport.java   
/**
 * Dispatch a DOM 2 Draft Key event.
 */
protected void dispatchKeyEvent(String eventType,
                                GraphicsNodeKeyEvent evt) {
    FocusManager fmgr = context.getFocusManager();
    if (fmgr == null) return;

    Element targetElement = (Element)fmgr.getCurrentEventTarget();
    if (targetElement == null) {
        targetElement = context.getDocument().getDocumentElement();
    }
    DocumentEvent d = (DocumentEvent)targetElement.getOwnerDocument();
    DOMKeyEvent keyEvt = (DOMKeyEvent)d.createEvent("KeyEvents");
    keyEvt.initKeyEvent(eventType,
                        true,
                        true,
                        evt.isControlDown(),
                        evt.isAltDown(),
                        evt.isShiftDown(),
                        evt.isMetaDown(),
                        mapKeyCode(evt.getKeyCode()),
                        evt.getKeyChar(),
                        null);

    try {
        ((EventTarget)targetElement).dispatchEvent(keyEvt);
    } catch (RuntimeException e) {
        ua.displayError(e);
    }
}
项目:Push2Display    文件:FocusManager.java   
/**
 * Fires a 'DOMFocusIn' event to the specified target.
 *
 * @param target the newly focussed event target
 * @param relatedTarget the previously focussed event target
 */
protected void fireDOMFocusInEvent(EventTarget target,
                                   EventTarget relatedTarget) {
    DocumentEvent docEvt = 
        (DocumentEvent)((Element)target).getOwnerDocument();
    DOMUIEvent uiEvt = (DOMUIEvent)docEvt.createEvent("UIEvents");
    uiEvt.initUIEventNS(XMLConstants.XML_EVENTS_NAMESPACE_URI,
                        "DOMFocusIn",
                        true,    // canBubbleArg
                        false,   // cancelableArg
                        null,    // viewArg
                        0);      // detailArg
    target.dispatchEvent(uiEvt);
}
项目:Push2Display    文件:FocusManager.java   
/**
 * Fires a 'DOMFocusOut' event to the specified target.
 *
 * @param target the previously focussed event target
 * @param relatedTarget the newly focussed event target
 */
protected void fireDOMFocusOutEvent(EventTarget target,
                                    EventTarget relatedTarget) {
    DocumentEvent docEvt = 
        (DocumentEvent)((Element)target).getOwnerDocument();
    DOMUIEvent uiEvt = (DOMUIEvent)docEvt.createEvent("UIEvents");
    uiEvt.initUIEventNS(XMLConstants.XML_EVENTS_NAMESPACE_URI,
                        "DOMFocusOut",
                        true,    // canBubbleArg
                        false,   // cancelableArg
                        null,    // viewArg
                        0);      // detailArg
    target.dispatchEvent(uiEvt);
}
项目:Push2Display    文件:FocusManager.java   
/**
 * Fires a 'DOMActivate' event to the specified target.
 *
 * @param target the event target
 * @param detailArg the detailArg parameter of the event
 */
protected void fireDOMActivateEvent(EventTarget target, int detailArg) {
    DocumentEvent docEvt = 
        (DocumentEvent)((Element)target).getOwnerDocument();
    DOMUIEvent uiEvt = (DOMUIEvent)docEvt.createEvent("UIEvents");
    uiEvt.initUIEventNS(XMLConstants.XML_EVENTS_NAMESPACE_URI,
                        "DOMActivate",
                        true,    // canBubbleArg
                        true,    // cancelableArg
                        null,    // viewArg
                        0);      // detailArg
    target.dispatchEvent(uiEvt);
}
项目:Push2Display    文件:SVG12BridgeEventSupport.java   
/**
 * Dispatch a DOM 3 Keyboard event.
 */
protected void dispatchKeyboardEvent(String eventType,
                                     GraphicsNodeKeyEvent evt) {
    FocusManager fmgr = context.getFocusManager();
    if (fmgr == null) {
        return;
    }

    Element targetElement = (Element) fmgr.getCurrentEventTarget();
    if (targetElement == null) {
        targetElement = context.getDocument().getDocumentElement();
    }
    DocumentEvent d = (DocumentEvent) targetElement.getOwnerDocument();
    DOMKeyboardEvent keyEvt
        = (DOMKeyboardEvent) d.createEvent("KeyboardEvent");
    String modifiers
        = DOMUtilities.getModifiersList(evt.getLockState(),
                                        evt.getModifiers());
    keyEvt.initKeyboardEventNS(XMLConstants.XML_EVENTS_NAMESPACE_URI,
                               eventType, 
                               true,
                               true,
                               null,
                               mapKeyCodeToIdentifier(evt.getKeyCode()),
                               mapKeyLocation(evt.getKeyLocation()),
                               modifiers);

    try {
        ((EventTarget)targetElement).dispatchEvent(keyEvt);
    } catch (RuntimeException e) {
        ua.displayError(e);
    }
}
项目:Push2Display    文件:DefaultXBLManager.java   
/**
 * Fires a ShadowTreeEvent of the given type on this element.
 */
protected void fireShadowTreeEvent(BindableElement elt,
                                   String type,
                                   XBLShadowTreeElement e) {
    DocumentEvent de = (DocumentEvent) elt.getOwnerDocument();
    ShadowTreeEvent evt
        = (ShadowTreeEvent) de.createEvent("ShadowTreeEvent");
    evt.initShadowTreeEventNS(XBL_NAMESPACE_URI, type, true, false, e);
    elt.dispatchEvent(evt);
}
项目:Push2Display    文件:AbstractGraphicsNodeBridge.java   
/**
 * Fires a ShapeChange event on the element this bridge is managing.
 */
protected void fireShapeChangeEvent() {
    DocumentEvent d = (DocumentEvent) e.getOwnerDocument();
    AbstractEvent evt = (AbstractEvent) d.createEvent("SVGEvents");
    evt.initEventNS(SVG_NAMESPACE_URI,
                    "shapechange",
                    true,
                    false);
    try {
        ((EventTarget) e).dispatchEvent(evt);
    } catch (RuntimeException ex) {
        ctx.getUserAgent().displayError(ex);
    }
}
项目:Push2Display    文件:AbstractGraphicsNodeBridge.java   
/**
 * Fires an svg:bboxchange event on the element.
 */
protected void fireBBoxChangeEvent() {
    DocumentEvent d = (DocumentEvent) e.getOwnerDocument();
    AbstractEvent evt = (AbstractEvent) d.createEvent("SVGEvents");
    evt.initEventNS(SVG_NAMESPACE_URI,
                    "RenderedBBoxChange",
                    true,
                    false);
    try {
        ((EventTarget) e).dispatchEvent(evt);
    } catch (RuntimeException ex) {
        ctx.getUserAgent().displayError(ex);
    }
}
项目:Push2Display    文件:BaseScriptingEnvironment.java   
protected void dispatchSVGDocEvent(String eventType) {
    SVGSVGElement root =
        (SVGSVGElement)document.getDocumentElement();
    // Event is dispatched on outermost SVG element.
    EventTarget t = root;

    DocumentEvent de = (DocumentEvent)document;
    AbstractEvent ev = (AbstractEvent) de.createEvent("SVGEvents");
    ev.initEventNS(XMLConstants.XML_EVENTS_NAMESPACE_URI,
                   eventType,
                   false,
                   false);
    t.dispatchEvent(ev);
}
项目:Push2Display    文件:AnimationSupport.java   
/**
 * Fires a {@link TimeEvent} on the given {@link EventTarget}.
 */
public static void fireTimeEvent(EventTarget target, String eventType,
                                 Calendar time, int detail) {
    DocumentEvent de = (DocumentEvent) ((Node) target).getOwnerDocument();
    DOMTimeEvent evt = (DOMTimeEvent) de.createEvent("TimeEvent");
    evt.initTimeEventNS(XMLConstants.XML_EVENTS_NAMESPACE_URI, eventType,
                        null,
                        detail);
    evt.setTimestamp(time.getTime().getTime());
    target.dispatchEvent(evt);
}
项目:qksms    文件:SmilPlayer.java   
public synchronized void init(ElementTime root) {
    mRoot = root;
    mAllEntries = getTimeline(mRoot, 0, Long.MAX_VALUE);
    mMediaTimeUpdatedEvent = ((DocumentEvent) mRoot).createEvent("Event");
    mMediaTimeUpdatedEvent.initEvent(MEDIA_TIME_UPDATED_EVENT, false, false);
    mActiveElements = new ArrayList<>();
}
项目:qksms    文件:SmilParElementImpl.java   
public boolean beginElement() {
    DocumentEvent doc = (DocumentEvent) SmilParElementImpl.this.getOwnerDocument();
    Event startEvent = doc.createEvent("Event");
    startEvent.initEvent(SMIL_SLIDE_START_EVENT, false, false);
    dispatchEvent(startEvent);
    return true;
}
项目:qksms    文件:SmilParElementImpl.java   
public boolean endElement() {
    DocumentEvent doc = (DocumentEvent) SmilParElementImpl.this.getOwnerDocument();
    Event endEvent = doc.createEvent("Event");
    endEvent.initEvent(SMIL_SLIDE_END_EVENT, false, false);
    dispatchEvent(endEvent);
    return true;
}
项目:qksms    文件:SmilMediaElementImpl.java   
private Event createEvent(String eventType) {
    DocumentEvent doc =
        (DocumentEvent)SmilMediaElementImpl.this.getOwnerDocument();
    Event event = doc.createEvent("Event");
    event.initEvent(eventType, false, false);
    if (LOCAL_LOGV) Log.v(TAG, "Dispatching 'begin' event to "
                + SmilMediaElementImpl.this.getTagName() + " "
                + SmilMediaElementImpl.this.getSrc() + " at "
                + System.currentTimeMillis());
    return event;
}
项目:qksms    文件:SmilMediaElementImpl.java   
private Event createEvent(String eventType, int seekTo) {
    DocumentEvent doc =
        (DocumentEvent)SmilMediaElementImpl.this.getOwnerDocument();
    EventImpl event = (EventImpl) doc.createEvent("Event");
    event.initEvent(eventType, false, false, seekTo);
    if (LOCAL_LOGV) Log.v(TAG, "Dispatching 'begin' event to "
                + SmilMediaElementImpl.this.getTagName() + " "
                + SmilMediaElementImpl.this.getSrc() + " at "
                + System.currentTimeMillis());
    return event;
}