示例#1
0
  private void setupAttributes() {
    Color frameColor = (Color) AttributeFigure.getDefaultAttribute("FrameColor");
    Color fillColor = (Color) AttributeFigure.getDefaultAttribute("FillColor");
    Color textColor = (Color) AttributeFigure.getDefaultAttribute("TextColor");
    Integer arrowMode = (Integer) AttributeFigure.getDefaultAttribute("ArrowMode");
    String fontName = (String) AttributeFigure.getDefaultAttribute("FontName");

    FigureEnumeration k = view().selectionElements();
    while (k.hasMoreElements()) {
      Figure f = k.nextFigure();
      frameColor = (Color) f.getAttribute("FrameColor");
      fillColor = (Color) f.getAttribute("FillColor");
      textColor = (Color) f.getAttribute("TextColor");
      arrowMode = (Integer) f.getAttribute("ArrowMode");
      fontName = (String) f.getAttribute("FontName");
    }

    fFrameColor.setSelectedIndex(ColorMap.colorIndex(frameColor));
    fFillColor.setSelectedIndex(ColorMap.colorIndex(fillColor));
    // fTextColor.select(ColorMap.colorIndex(textColor));
    if (arrowMode != null) {
      fArrowChoice.setSelectedIndex(arrowMode.intValue());
    }
    if (fontName != null) {
      fFontChoice.setSelectedItem(fontName);
    }
  }
 /** Releases all resources related to an undoable activity */
 public void release() {
   FigureEnumeration fe = getAffectedFigures();
   while (fe.hasMoreElements()) {
     fe.nextFigure().release();
   }
   myAffectedFiguresCount = 0;
   setAffectedFigures(FigureEnumerator.getEmptyEnumeration());
 }
 protected void rememberFigures(FigureEnumeration toBeRemembered) {
   myAffectedFigures = new Vector();
   myAffectedFiguresCount = 0;
   while (toBeRemembered.hasMoreElements()) {
     myAffectedFigures.addElement(toBeRemembered.nextElement());
     myAffectedFiguresCount++;
   }
 }