コード例 #1
0
ファイル: WorkingView.java プロジェクト: BackupTheBerlios/tbe
  /** Deletes the selected Item of the Board and creates a DeleteCommand */
  public void delete() {

    ItemComponent[] items = board.getSelectedItems();
    DeleteCommand del = new DeleteCommand(items);
    ArrayList<Command> actCommands = new ArrayList<Command>();
    actCommands.add(del);
    tbe.addCommands(actCommands);
    board.removeItem(items);
  }
コード例 #2
0
ファイル: WorkingView.java プロジェクト: BackupTheBerlios/tbe
 /**
  * Add/Remove a Point to/from an Arrow
  *
  * @param b boolean, true = add, false = remove
  */
 public void addRemovePoint(boolean b) {
   if (board.getSelectionCount() == 1 && board.getSelectionCell() instanceof ArrowItem) {
     MoveCommand mc = new MoveCommand(board.getSelectedItems());
     ArrowItem a = (ArrowItem) board.getSelectionCell();
     if (b) {
       a.addPoint();
     } else {
       a.removePoint();
     }
     WorkingView.this.refresh();
     board.setSelectionCell(a);
     setTool(cursorTool, cursorButton);
     board.addItem(a);
     mc.setMoveEnd(board.getSelectedItems());
     ArrayList<Command> actCommands = new ArrayList<Command>();
     actCommands.add(mc);
     tbe.addCommands(actCommands);
   }
 }
コード例 #3
0
ファイル: WorkingView.java プロジェクト: BackupTheBerlios/tbe
  /** Cuts selected Iems of the Board and put it into the ClipBoard */
  public void cut() {

    ItemComponent[] items = board.getSelectedItems();
    CutCommand cut = new CutCommand(items);
    ArrayList<Command> actCommands = new ArrayList<Command>();
    actCommands.add(cut);
    tbe.addCommands(actCommands);
    ComponentSelection contents = new ComponentSelection(this.getBoard().cloneItems(items));
    tbe.getClipboard().setContents(contents, cut);
    board.removeItem(items);
  }
コード例 #4
0
ファイル: WorkingView.java プロジェクト: BackupTheBerlios/tbe
  /**
   * Activate/Deactivate Rotate-Button
   *
   * @param b
   */
  public void activateRotation(boolean b) {

    if (showRotate && b) {
      rotatePanel.setVisible(b);
      rotateSlider.setValue(((ShapeItem) board.getSelectedItems()[0]).getRotation());

    } else {
      rotatePanel.setVisible(false);
    }
    rotate.setEnabled(b);
  }
コード例 #5
0
ファイル: WorkingView.java プロジェクト: BackupTheBerlios/tbe
 /** Copy selected Items from the Board into the Clipboard */
 public void copy() {
   ItemComponent[] items = board.getSelectedItems();
   ComponentSelection contents = new ComponentSelection(this.getBoard().cloneItems(items));
   tbe.getClipboard().setContents(contents, tbe);
 }