コード例 #1
0
  public boolean handleRubberbandEvent(RubberbandEvent evt) {
    System.out.println("Rubberband handler called in RotatableCanvas with " + evt.getBounds());

    Rubberband rb = (Rubberband) evt.getSource();

    // Clear the current selection (instance variable)
    // if ((rb.getModifiers() & Event.SHIFT_MASK) == 0) {
    //   clearSelection();
    // }

    if (rb.getComponent() == this) {
      Rectangle bounds = evt.getBounds();
      rectSelect(bounds.x, bounds.y, bounds.x + bounds.width, bounds.y + bounds.height);
    }

    redrawneeded = true;
    paint(this.getGraphics());

    return true;
  }