コード例 #1
0
  public void groupFigures() {
    getDrawingView().drawing().orphanAll(getAffectedFigures());
    getDrawingView().clearSelection();

    // add new group figure instead
    GroupFigure group = new GroupFigure();
    group.addAll(getAffectedFigures());

    Figure figure = getDrawingView().drawing().add(group);
    getDrawingView().addToSelection(figure);

    // create a new vector with the new group figure as element
    Vector affectedFigures = new Vector();
    affectedFigures.addElement(figure);
    setAffectedFigures(new FigureEnumerator(affectedFigures));
  }
コード例 #2
0
 protected void rememberFigures(FigureEnumeration toBeRemembered) {
   myAffectedFigures = new Vector();
   myAffectedFiguresCount = 0;
   while (toBeRemembered.hasMoreElements()) {
     myAffectedFigures.addElement(toBeRemembered.nextElement());
     myAffectedFiguresCount++;
   }
 }
コード例 #3
0
 public FigureEnumeration getAffectedFigures() {
   return new FigureEnumerator((Vector) myAffectedFigures.clone());
 }