コード例 #1
0
  protected List<?> createSelectionHandles() {
    final LifelineEditPart host = (LifelineEditPart) getHost();
    final LifelineFigure primaryShape = host.getPrimaryShape();
    // resizable in at least one direction
    List<Handle> list = new ArrayList<Handle>();
    // createMoveHandle(list);
    Locator locator = new MoveHandleLocator(primaryShape.getFigureLifelineNameContainerFigure());
    MoveHandle moveHandle = new MoveHandle((GraphicalEditPart) getHost(), locator);
    moveHandle.setCursor(Cursors.SIZEALL);
    list.add(moveHandle);

    createResizeHandle(list, PositionConstants.NORTH);
    final RectangleFigure fig = primaryShape.getFigureLifelineNameContainerFigure();

    createResizeHandle(host, list, fig, PositionConstants.WEST);
    createResizeHandle(host, list, fig, PositionConstants.EAST);

    createResizeHandle(list, PositionConstants.SOUTH);
    return list;
  }
コード例 #2
0
 /**
  * Returns a new {@link MoveHandle} with the given owner.
  *
  * @param tracker the DragTracker to assign to this handle
  * @param owner the GraphicalEditPart that is the owner of the new MoveHandle
  * @param cursor the Cursor to use when hovering over this handle
  * @return the new MoveHandle
  */
 public static Handle moveHandle(GraphicalEditPart owner, DragTracker tracker, Cursor cursor) {
   MoveHandle moveHandle = new MoveHandle(owner);
   moveHandle.setDragTracker(tracker);
   moveHandle.setCursor(cursor);
   return moveHandle;
 }