Esempio n. 1
0
  /*(non-Javadoc)
   * @see org.eclipse.gef.editparts.AbstractGraphicalEditPart#createFigure()
   */
  protected IFigure createFigure() {
    ComponentFigure figure =
        new ComponentFigure(
            Util.getSWTRGB(getCastedVisualModel().getBackgroundColor()),
            Util.getSWTRGB(getCastedVisualModel().getForegroundColor()),
            getCastedVisualModel().getLineStyle());
    figure.setText(getCastedSemanticModel().getName());

    if (getCastedVisualModel().getDetailLevel() == VisualModel.HIGH_DETAIL)
      figure.showResponsibilites(true);

    updateStereotypeName(figure);
    updateResponsibilities(figure);
    return figure;
  }
Esempio n. 2
0
  private void updateStereotypeName(ComponentFigure figure) {
    Stereotype stereotype = getCastedSemanticModel().getStereotype();
    String newName = ""; // $NON-NLS-1$
    if (stereotype != null) newName = stereotype.getName();

    figure.setStereotype(newName);
  }
Esempio n. 3
0
  private void updateResponsibilities(ComponentFigure figure) {
    List resps = getCastedSemanticModel().getFeatures();

    String[] names = new String[resps.size()];
    int i = 0;
    for (Iterator iter = resps.iterator(); iter.hasNext(); )
      names[i++] = ((Responsibility) iter.next()).getName();

    figure.addResponsibilities(names);
  }