Ejemplo n.º 1
0
  /**
   * Finds a handle at the given coordinates.
   *
   * @return the hit handle, null if no handle is found.
   */
  public Handle findHandle(int x, int y) {
    Handle handle;

    HandleEnumeration he = selectionHandles();
    while (he.hasNextHandle()) {
      handle = he.nextHandle();
      if (handle.containsPoint(x, y)) {
        return handle;
      }
    }
    return null;
  }
Ejemplo n.º 2
0
 /** Gets an enumeration of the currently active handles. */
 protected HandleEnumeration selectionHandles() {
   if (fSelectionHandles == null) {
     fSelectionHandles = CollectionsFactory.current().createList();
     FigureEnumeration fe = selection();
     while (fe.hasNextFigure()) {
       Figure figure = fe.nextFigure();
       HandleEnumeration kk = figure.handles();
       while (kk.hasNextHandle()) {
         fSelectionHandles.add(kk.nextHandle());
       }
     }
   }
   return new HandleEnumerator(fSelectionHandles);
 }
Ejemplo n.º 3
0
 /** Draws the currently active handles. */
 public void drawHandles(Graphics g) {
   HandleEnumeration he = selectionHandles();
   while (he.hasNextHandle()) {
     (he.nextHandle()).draw(g);
   }
 }