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));
  }
 protected void rememberFigures(FigureEnumeration toBeRemembered) {
   myAffectedFigures = new Vector();
   myAffectedFiguresCount = 0;
   while (toBeRemembered.hasMoreElements()) {
     myAffectedFigures.addElement(toBeRemembered.nextElement());
     myAffectedFiguresCount++;
   }
 }
 public FigureEnumeration getAffectedFigures() {
   return new FigureEnumerator((Vector) myAffectedFigures.clone());
 }