Package elemental.events

Examples of elemental.events.MouseEvent$Button


        int ibsX= col.getPixelControllerGenerator().getGenerator(0).getInternalBufferXSize();
        int ibsY= col.getPixelControllerGenerator().getGenerator(0).getInternalBufferYSize();
        cp5.addTextlabel("nfoInternalBuffer", messages.getString("GeneratorGui.INFO_INTERNAL_BUFFERSIZE")+ibsX+"/"+ibsY, nfoXPos, nfoYPos).moveTo(infoTab).getValueLabel(); //$NON-NLS-1$ //$NON-NLS-2$
        nfoYPos+=yposAdd;
       
        Button saveScreenshot = cp5.addButton(GuiElement.SAVE_SCREENSHOT.guiText(), 0,
            nfoXPos, nfoYPos, 110, 15);
        saveScreenshot.setCaptionLabel(messages.getString("GeneratorGui.SAVE_SCREENSHOT")); //$NON-NLS-1$
        saveScreenshot.moveTo(infoTab);
        cp5.getTooltip().register(GuiElement.SAVE_SCREENSHOT.guiText(), messages.getString("GeneratorGui.TOOLTIP_SAVE_SCREENSHOT")); //$NON-NLS-1$

       
        nfoXPos += xposAdd;
        nfoYPos = yPosStartDrowdown+20;
View Full Code Here


        public void handleEvent(Event arg0) {
          if (getDelegate() == null) {
            return;
          }

          MouseEvent mouseEvent = (MouseEvent) arg0;
          if (prevButton.isOrHasChild((Node) mouseEvent.getTarget())) {
            getDelegate().onPreviousClicked();
          } else if (nextButton.isOrHasChild((Node) mouseEvent.getTarget())) {
            getDelegate().onNextClicked();
          } else if (replaceButton.isOrHasChild((Node) mouseEvent.getTarget())) {
            getDelegate().onReplaceClicked();
          } else if (replaceAllButton.isOrHasChild((Node) mouseEvent.getTarget())) {
            getDelegate().onReplaceAllClicked();
          } else if (closeButton.isOrHasChild((Node) mouseEvent.getTarget())) {
            getDelegate().onCloseClicked();
          }
        }
      }, false);
    }
View Full Code Here

  private void attachHandlers() {
    container.addEventListener(Event.CLICK, new EventListener() {
      @Override
      public void handleEvent(Event evt) {
        MouseEvent event = (MouseEvent) evt;
        // we could really just use the event target but this is for future
        // expandability I guess.
        Element element = CssUtils.getAncestorOrSelfWithClassName(
            (Element) event.getTarget(), res.baseCss().tab());
        if (element != null) {
          @SuppressWarnings("unchecked")
          TabElement<T> tabElement = (TabElement<T>) element;
          selectTab(tabElement);
        }
View Full Code Here

      });

      getElement().setOnMouseDown(new EventListener() {
        @Override
        public void handleEvent(Event event) {
          MouseEvent mouseEvent = (MouseEvent) event;
          if (getDelegate() != null) {
            getDelegate().onClick(mouseEvent);
          }
        }
      });
View Full Code Here

      addPartner(targetElement);

      removers.add(targetElement.addEventListener(Event.MOUSEOUT, new EventListener() {
        @Override
        public void handleEvent(Event evt) {
          MouseEvent mouseEvt = (MouseEvent) evt;
          EventTarget relatedTarget = mouseEvt.getRelatedTarget();
          // Ignore the event unless we mouse completely out of the target element.
          if (relatedTarget == null || !targetElement.contains((Node) relatedTarget)) {
            cancelPendingShow();
          }
        }
View Full Code Here

          evt.preventDefault();
        }

        @Override
        protected void onOtherEvent(Event evt) {
          MouseEvent mouseEvt = (MouseEvent) evt;

          // This is a click on the root.
          dispatchOnRootContextMenuEvent(mouseEvt.getClientX(), mouseEvt.getClientY());
        }

        @Override
        protected void onTreeNodeBodyChildEvent(Event evt, Element treeNodeBody) {
          MouseEvent mouseEvt = (MouseEvent) evt;

          // Dispatch if eventTarget is the treeNodeBody, or if it is a child
          // of a treeNodeBody.
          dispatchContextMenuEvent(
              mouseEvt.getClientX(), mouseEvt.getClientY(), treeNodeBody, css);
        }
      }, false);

      EventListener dragDropEventListener = new EventListener() {
        @Override
View Full Code Here

    return deltaY;
  }

  @Override
  public void handleEvent(Event evt) {
    MouseEvent mouseEvent = (MouseEvent) evt;
    updateXYState(mouseEvent);

    if (evt.getType().equals(Event.MOUSEMOVE)) {
      onMouseMove(mouseEvent);
    } else if (evt.getType().equals(Event.MOUSEUP)) {
      release();
      onMouseUp(mouseEvent);
    } else if (evt.getType().equals(Event.MOUSEDOWN)) {
      if (onMouseDown(mouseEvent)) {
        // Start the capture
        MouseEventCapture.capture(this);
        mouseEvent.preventDefault();
      }
    }
  }
View Full Code Here

    }
    return elems;
  }

  private void mouseevent(Element target, String type) {
    MouseEvent evt = (MouseEvent) Elements.getDocument().createEvent(Document.Event.MOUSE);
    evt.initMouseEvent(type, true, true, null, 0, 0, 0, 0, 0, false, false, false, false,
        MouseEvent.Button.PRIMARY, null);
    target.dispatchEvent(evt);
  }
View Full Code Here

  /**
   * Fires a left-click event on the given target (typically a DOM node).
   */
  public static void click(EventTarget target) {
    MouseEvent evt = (MouseEvent) getDocument().createEvent(
        Document.Events.MOUSE);
    evt.initMouseEvent("click", true, true, null, 0, 0, 0, 0, 0, false, false,
        false, false, MouseEvent.Button.PRIMARY, null);
    target.dispatchEvent(evt);
  }
View Full Code Here

          self.next = new PanelPosition();
          sibling = siblingNode.el;
          self.next.node = siblingNode;
        }
        PanelPosition affected = self.next;
        MouseEvent e = (MouseEvent) evt;
        if (vertical) {
          self.mouseStart = e.getClientY();
          // We parse from the css values set (which we set before this is called),
          // so we don't have to do any measuring
          // or compensate for weird offsets in the client elements.
          self.posStart = CssUtils.parsePixels(wrapper.getStyle().getTop());
          self.sizeStart = CssUtils.parsePixels(wrapper.getStyle().getHeight());
          if (sibling != null) {
            affected.posStart = CssUtils.parsePixels(sibling.getStyle().getTop());
            affected.sizeStart = CssUtils.parsePixels(sibling.getStyle().getHeight());
          }
        } else {
          self.mouseStart = e.getClientX();
          self.posStart = CssUtils.parsePixels(wrapper.getStyle().getLeft());
          self.sizeStart = CssUtils.parsePixels(wrapper.getStyle().getWidth());
          if (sibling != null) {
            affected.posStart = CssUtils.parsePixels(sibling.getStyle().getLeft());
            affected.sizeStart = CssUtils.parsePixels(sibling.getStyle().getWidth());
          }
        }
       
        final EventRemover[] remover = new EventRemover[2];
        // TODO put these event listeners over an empty iframe, to cover up any iframes on page.
        remover[0] = Browser.getWindow().addEventListener("mouseup", new EventListener() {
          @Override
          public void handleEvent(Event evt) {
            if (remover[0] != null){
              remover[0].remove();
              remover[1].remove();
              onResizeFinished(siblingNode, self);
              remover[0] = null;
            }
          }
        }, true);
        remover[1] = Browser.getWindow().addEventListener("mousemove", new EventListener() {
          @Override
          public void handleEvent(Event evt) {
            evt.preventDefault();
            final MouseEvent e = (MouseEvent) evt;
            final Element el = self.next == null ? null : self.next.node.el;
            assert el != wrapper;
            double delta;
            if (vertical) {
              delta = e.getClientY() - self.mouseStart;
              if (first) {
                // A top drag affects top and height
                wrapper.getStyle().setTop((int)(self.posStart+ delta),"px");
                wrapper.getStyle().setHeight((int)(self.sizeStart - delta),"px");
                if (el != null) {
                  // TODO implement max/min/pref values, and iterate through the
                  // nodes to push delta off on any neighbors
                  el.getStyle().setHeight((int)(self.next.sizeStart + delta),"px");
                }
              } else {
                wrapper.getStyle().setHeight((int)(self.sizeStart + delta),"px");
                if (el != null) {
                  el.getStyle().setTop((int)(self.next.posStart+ delta),"px");
                  el.getStyle().setHeight((int)(self.next.sizeStart - delta),"px");
                }
              }
            } else {
              delta = e.getClientX() - self.mouseStart;
              if (first) {
                // A left drag affects left and size
                wrapper.getStyle().setLeft((int)(self.posStart + delta),"px");
                wrapper.getStyle().setWidth((int)(self.sizeStart - delta),"px");
                if (el != null) {
View Full Code Here

TOP

Related Classes of elemental.events.MouseEvent$Button

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.