Example #1
0
  /**
   * <b>uDOM:</b> This method allows the removal of event listeners from the event target.
   *
   * @param type Specifies the event type of the EventListener being removed.
   * @param listener The listener parameter indicates the EventListener to be removed.
   * @param useCapture Specifies whether the EventListener being removed was registered as a
   *     capturing listener or not.
   */
  public void removeEventListener(
      java.lang.String type, org.w3c.dom.events.EventListener listener, boolean useCapture) {

    int i = listeners.indexOf(listener, 0);
    if (i > 0) {
      listeners.removeElementAt(i);
    }
  }
Example #2
0
 /**
  * Mueve un nodo a la posición dada entre el conjunto de nodos que están a su mismo nivel.
  *
  * @param parent Nodo padre
  * @param node Nodo hijo a mover
  * @param newPos Nueva posición
  */
 public void moveNode(SVGNode parent, SVGNode node, int newPos) {
   TinyVector children = parent.children;
   if (children != null) {
     if (newPos >= 0 && newPos < children.count) {
       logger.debug("Moviendo nodo...");
       int curPos = children.indexOf(node, 0); // Posicion actual del nodo a mover
       logger.debug("Posicion actual: " + curPos + ", posicion nueva: " + newPos);
       if (curPos == -1) return;
       if (curPos < newPos) {
         // Desplazamiento hacia delante de los nodos hermanos
         for (int i = curPos; i < newPos; i++) {
           children.data[i] = children.data[i + 1];
         }
       } else if (curPos > newPos) {
         // Desplazamiento hacia atras de los nodos hermanos
         for (int i = curPos; i > newPos; i--) {
           children.data[i] = children.data[i - 1];
         }
       }
       // Insercion del nodo en su nueva posicion
       children.data[newPos] = node;
     }
   }
 }
Example #3
0
 /**
  * <b>uDOM:</b> This method allows the registration of event listeners on the event target.
  *
  * @param type The event type for which the user is registering
  * @param listener The listener parameter takes an interface implemented by the user which
  *     contains the methods to be called when the event occurs.
  * @param useCapture If true, useCapture indicates that the user wishes to initiate capture. After
  *     initiating capture, all events of the specified type will be dispatched to the registered
  *     EventListener before being dispatched to any EventTargets beneath them in the tree. Events
  *     which are bubbling upward through the tree will not trigger an EventListener designated to
  *     use capture.
  */
 public void addEventListener(
     java.lang.String type, org.w3c.dom.events.EventListener listener, boolean useCapture) {
   listeners.addElement(listener);
 }