コード例 #1
0
    public void mouseMoved(MouseEvent e) {
      if (station.isResizingEnabled()) {
        current = station.getRoot().getDividerNode(e.getX(), e.getY());

        if (current == null) setCursor(null);
        else if (current.getOrientation() == Orientation.HORIZONTAL)
          setCursor(Cursor.getPredefinedCursor(Cursor.W_RESIZE_CURSOR));
        else setCursor(Cursor.getPredefinedCursor(Cursor.N_RESIZE_CURSOR));

        if (current != null) {
          bounds = current.getDividerBounds(current.getDivider(), bounds);
          deltaX = bounds.width / 2 + bounds.x - e.getX();
          deltaY = bounds.height / 2 + bounds.y - e.getY();
        }
      }
    }
コード例 #2
0
 /**
  * Gets the node whose dividier contains <code>x, y</code>.
  *
  * @param x the x coordinate
  * @param y the y coordinate
  * @return the node containing <code>x, y</code>
  */
 protected Divideable getDividerNode(int x, int y) {
   return station.getRoot().getDividerNode(x, y);
 }