Example #1
0
  @Override
  public boolean onButtonReleaseEvent(ButtonEvent event) {
    if (current_clip.type != ClipType.CLIP_NONE) {
      clips.add(current_clip);
      current_clip = new Clip();
    }

    Stage.getDefault().queueRedraw();

    return false;
  }
Example #2
0
  @Override
  public boolean onMotionEvent(MotionEvent event) {
    log("on motion event");
    if (current_clip.type != ClipType.CLIP_NONE) {
      current_clip.x2 = (int) event.getX();
      current_clip.y2 = (int) event.getY();
      log("stage -> queue redraw");
      Stage.getDefault().queueRedraw();
    }

    return false;
  }
Example #3
0
  @Override
  public boolean onButtonPressEvent(ButtonEvent event) {
    log("button press");
    current_clip.x1 = current_clip.x2 = (int) event.getX();
    current_clip.y1 = current_clip.y2 = (int) event.getY();
    log("button press, x1=" + current_clip.x1 + ", y1=" + current_clip.y1);
    current_clip.type =
        event.getButton() == 1
            ? ClipType.CLIP_RECTANGLE
            : (event.getButton() == 2 ? ClipType.CLIP_SHAPES : ClipType.CLIP_ELLIPSE);

    log("button press stage queue redraw");
    Stage.getDefault().queueRedraw();
    log("button press return false");
    return false;
  }