Пример #1
0
 /**
  * Gets the handles of the figure. It returns the normal PolyLineHandles but adds
  * ChangeConnectionHandles at the start and end.
  */
 public Vector handles() {
   Vector handles = new Vector(fPoints.size());
   handles.addElement(new ChangeConnectionStartHandle(this));
   for (int i = 1; i < fPoints.size() - 1; i++) {
     handles.addElement(new PolyLineHandle(this, locator(i), i));
   }
   handles.addElement(new ChangeConnectionEndHandle(this));
   return handles;
 }
Пример #2
0
 protected void rememberFigures(FigureEnumeration toBeRemembered) {
   myAffectedFigures = new Vector();
   myAffectedFiguresCount = 0;
   while (toBeRemembered.hasMoreElements()) {
     myAffectedFigures.addElement(toBeRemembered.nextElement());
     myAffectedFiguresCount++;
   }
 }
Пример #3
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));
  }