Package com.google.scrollview.events

Examples of com.google.scrollview.events.SVEvent


  @Override
  public void mouseClicked(PInputEvent e) {
    if (e.isPopupTrigger()) {
      showPopup(e);
    } else {
      processEvent(new SVEvent(SVEventType.SVET_CLICK, svWindow, (int) e
          .getPosition().getX(), (int) e.getPosition().getY(), 0, 0, null));
    }
  }
View Full Code Here


  }

  /** The mouse is getting dragged - create an SVET_MOUSE event. */
  @Override
  public void mouseDragged(PInputEvent e) {
    processEvent(new SVEvent(SVEventType.SVET_MOUSE, svWindow, (int) e
        .getPosition().getX(), (int) e.getPosition().getY(), (int) e
        .getPosition().getX()
        - lastX, (int) e.getPosition().getY() - lastY, null));

    // Paint a selection rectangle.
View Full Code Here

  @Override
  public void mouseReleased(PInputEvent e) {
    if (e.isPopupTrigger()) {
      showPopup(e);
    } else {
      processEvent(new SVEvent(SVEventType.SVET_SELECTION, svWindow, (int) e
          .getPosition().getX(), (int) e.getPosition().getY(), (int) e
          .getPosition().getX()
          - lastX, (int) e.getPosition().getY() - lastY, null));
    }
    if (selection != null) {
View Full Code Here

   * creates a lot of traffic and, depending on the type of application, could
   * quite possibly be disabled.
   */
  @Override
  public void mouseMoved(PInputEvent e) {
    processEvent(new SVEvent(SVEventType.SVET_MOTION, svWindow, (int) e
        .getPosition().getX(), (int) e.getPosition().getY(), 0, 0, null));
  }
View Full Code Here

  /**
   * The only associated object with this is the timer, so we use it to send a
   * SVET_HOVER event.
   */
  public void actionPerformed(ActionEvent e) {
    processEvent(new SVEvent(SVEventType.SVET_HOVER, svWindow, lastXMove,
        lastYMove, 0, 0, null));
  }
View Full Code Here

   * stuck with physical keys, which is very ugly.
   */
  public void keyPressed(KeyEvent e) {
    char keyCh = e.getKeyChar();
    if (keyCh == '\r' || keyCh == '\n' || keyCh == '\0' || keyCh == '?') {
      processEvent(new SVEvent(SVEventType.SVET_INPUT, svWindow, lastXMove,
                               lastYMove, 0, 0, keyStr));
      // Send newline characters as '!' as '!' can never be a keypressed
      // and the client eats all newline characters.
      keyStr = "!";
    } else {
      processEvent(new SVEvent(SVEventType.SVET_INPUT, svWindow, lastXMove,
                               lastYMove, 0, 0, String.valueOf(keyCh)));
      keyStr += keyCh;
    }
  }
View Full Code Here

   * A window is closed (by the 'x') - create an SVET_DESTROY event. If it was
   * the last open Window, also send an SVET_EXIT event (but do not exit unless
   * the client says so).
   */
  public void windowClosing(WindowEvent e) {
    processEvent(new SVEvent(SVEventType.SVET_DESTROY, svWindow, lastXMove,
        lastYMove, 0, 0, null));
    e.getWindow().dispose();
    SVWindow.nrWindows--;
    if (SVWindow.nrWindows == 0) {
      processEvent(new SVEvent(SVEventType.SVET_EXIT, svWindow, lastXMove,
          lastYMove, 0, 0, null));
    }
  }
View Full Code Here

        (String) JOptionPane.showInputDialog(this, msg, "",
            JOptionPane.QUESTION_MESSAGE, null, null, def);

    if (tmp != null) {
      tmp = convertIntegerStringToUnicodeString(tmp);
      SVEvent res = new SVEvent(evtype, this, id, tmp);
      ScrollView.addMessage(res);
    }
    svEventHandler.timer.restart();
  }
View Full Code Here

  public void showYesNoDialog(String msg) {
    // res returns 0 on yes, 1 on no. Seems to be a bit counterintuitive
    int res =
        JOptionPane.showOptionDialog(this, msg, "", JOptionPane.YES_NO_OPTION,
            JOptionPane.QUESTION_MESSAGE, null, null, null);
    SVEvent e = null;

    if (res == 0) {
      e = new SVEvent(SVEventType.SVET_INPUT, this, 0, 0, 0, 0, "y");
    } else if (res == 1) {
      e = new SVEvent(SVEventType.SVET_INPUT, this, 0, 0, 0, 0, "n");
    }
    ScrollView.addMessage(e);
  }
View Full Code Here

    svPuMenu.add(parent, name, cmdEvent, value, desc);
  }

  /** Destroys a window. */
  public void destroy() {
    ScrollView.addMessage(new SVEvent(SVEventType.SVET_DESTROY, this, 0,
        "SVET_DESTROY"));
    setVisible(false);
    // dispose();
  }
View Full Code Here

TOP

Related Classes of com.google.scrollview.events.SVEvent

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.