示例#1
0
ParameterSetCanvas * ParameterSetCanvas::read(char * & st, UmlCanvas * canvas,
        char * k, ActivityActionCanvas * a) {
    if (!strcmp(k, "parametersetcanvas_ref"))
        return ((ParameterSetCanvas *) dict_get(read_id(st), "parametersetcanvas", canvas));
    else if (!strcmp(k, "parametersetcanvas")) {
        int id = read_id(st);
        BrowserParameterSet * br = BrowserParameterSet::read_ref(st);
        ParameterSetCanvas * result = new ParameterSetCanvas(br, canvas, id, a);

        k = read_keyword(st);

        read_color(st, "color", result->itscolor, k);	// updates k

        if (!strcmp(k, "xyz"))
            read_xyz(st, result);
        else
            wrong_keyword(k, "xyz");

        // note : width_scale100 & height_scale100 useless, position depend on pins
        result->update();
        result->show();

        k = read_keyword(st);

        result->read_stereotype_property(st, k);	// updates k

        if (strcmp(k, "end"))
            wrong_keyword(k, "end");

        result->check_stereotypeproperties();

        return result;
    }
    else
        return 0;
}
示例#2
0
void ActivityActionCanvas::check_parametersets() {
  // add missing parameter sets
  const QValueList<BrowserParameterSet *> brps =
    ((BrowserActivityAction *) browser_node)->get_parametersets();
  QValueList<BrowserParameterSet *>::ConstIterator iter;
  
  for (iter = brps.begin(); iter != brps.end(); ++iter) {
    QValueList<ParameterSetCanvas *>::ConstIterator itershown;
    
    for (itershown = paramsets.begin(); itershown != paramsets.end(); ++itershown)
      if ((*itershown)->get_bn() == *iter)
	break;
    
    if (itershown == paramsets.end()) {
      // add it
      ParameterSetCanvas * psc = 
	new ParameterSetCanvas(*iter, the_canvas(), 0, this);

      paramsets.append(psc);
      psc->update();
      psc->show();
    }
  }
}