PackageCanvas * PackageCanvas::read(char * & st, UmlCanvas * canvas, char * k) { if (!strcmp(k, "packagecanvas_ref")) return ((PackageCanvas *) dict_get(read_id(st), "packagecanvas", canvas)); else if (!strcmp(k, "packagecanvas")) { int id = read_id(st); BrowserNode * br = BrowserPackage::read_ref(st); UmlColor color = UmlDefaultColor; Uml3States in_tab = UmlDefaultState; ShowContextMode context = DefaultShowContextMode; Uml3States show_stereotype_properties = UmlDefaultState;; k = read_keyword(st); if (!strcmp(k, "name_in_tab")) { in_tab = state(read_keyword(st)); k = read_keyword(st); } if (!strcmp(k, "show_context_mode")) { context = context_mode(read_keyword(st)); k = read_keyword(st); } if (!strcmp(k, "show_stereotype_properties")) { show_stereotype_properties = state(read_keyword(st)); k = read_keyword(st); } read_color(st, "color", color, k); if (strcmp(k, "xyzwh")) wrong_keyword(k, "xyzwh"); int x = (int) read_double(st); PackageCanvas * result = new PackageCanvas(br, canvas, x, (int) read_double(st), id); read_zwh(st, result); if (read_file_format() >= 58) { k = read_keyword(st); result->read_stereotype_property(st, k); // updates k if (strcmp(k, "end")) wrong_keyword(k, "end"); } result->name_in_tab = in_tab; result->show_context_mode = context; result->show_stereotype_properties = show_stereotype_properties; result->itscolor = color; result->check_size(); result->set_center100(); result->show(); result->check_stereotypeproperties(); return result; } else return 0; }
TransitionData * TransitionData::read(char * & st, char * & k) { TransitionData * result = new TransitionData; result->BasicData::read(st, k); // updates k if (strcmp(k, "on")) wrong_keyword(k, "on"); k = read_keyword(st); if (((result->end = BrowserState::read(st, k, 0)) == 0) && ((result->end = BrowserPseudoState::read(st, k, 0)) == 0) && ((result->end = BrowserStateAction::read(st, k, 0)) == 0)) wrong_keyword(k, "a ref to a state or action or pseudo state"); connect(result->end->get_data(), SIGNAL(deleted()), result, SLOT(end_deleted())); k = read_keyword(st); result->uml.read(st, k, "uml"); // update k result->cpp.read(st, k, "cpp"); // update k result->java.read(st, k, "java"); // update k return result; }
SimpleRelationData * SimpleRelationData::read(char * & st) { SimpleRelationData * result = new SimpleRelationData(relation_type(read_keyword(st), TRUE)); char * k = read_keyword(st); result->BasicData::read(st, k); // updates k if (strcmp(k, "on")) wrong_keyword(k, "on"); k = read_keyword(st); // note : BrowserArtifact::read get Component def on component -> artifact if (((result->end = BrowserArtifact::read(st, k, 0)) == 0) && ((result->end = BrowserComponent::read(st, k, 0)) == 0) && ((result->end = BrowserUseCase::read(st, k, 0)) == 0) && ((result->end = BrowserPackage::read(st, k, 0, FALSE)) == 0) && ((result->end = BrowserDeploymentNode::read(st, k, 0)) == 0) && ((result->end = BrowserActivity::read(st, k, 0)) == 0) && ((result->end = BrowserActivityAction::read(st, k, 0)) == 0) && ((result->end = BrowserActivityObject::read(st, k, 0)) == 0) && ((result->end = BrowserClass::read(st, k, 0)) == 0)) wrong_keyword(k, "a ref to a class, component, usecase, package, deployment node, activity, activity action or activity object"); connect(result->end->get_data(), SIGNAL(deleted()), result, SLOT(end_deleted())); return result; }
DeploymentNodeCanvas * DeploymentNodeCanvas::read(char * & st, UmlCanvas * canvas, char * k) { if (!strcmp(k, "deploymentnodecanvas_ref")) return ((DeploymentNodeCanvas *) dict_get(read_id(st), "deploymentnodecanvas", canvas)); else if (!strcmp(k, "deploymentnodecanvas")) { int id = read_id(st); BrowserNode * br = BrowserDeploymentNode::read_ref(st); QString iname; Uml3States write_horizontally = UmlDefaultState; Uml3States show_stereotype_properties = UmlDefaultState; k = read_keyword(st); if (!strcmp(k, "name")) { iname = read_string(st); k = read_keyword(st); } if (!strcmp(k, "write_horizontally") || !strcmp(k, "write_horizontaly")) { write_horizontally = state(read_keyword(st)); k = read_keyword(st); } if (!strcmp(k, "show_stereotype_properties")) { show_stereotype_properties = state(read_keyword(st)); k = read_keyword(st); } UmlColor color = UmlDefaultColor; read_color(st, "color", color, k); if (strcmp(k, "xyzwh")) wrong_keyword(k, "xyzwh"); int x = (int) read_double(st); DeploymentNodeCanvas * result = new DeploymentNodeCanvas(br, canvas, x, (int) read_double(st), id); read_zwh(st, result); if (read_file_format() >= 58) { k = read_keyword(st); result->read_stereotype_property(st, k); // updates k if (strcmp(k, "end")) wrong_keyword(k, "end"); } result->iname = iname; result->write_horizontally = write_horizontally; result->show_stereotype_properties = show_stereotype_properties; result->itscolor = color; result->check_size(); result->set_center100(); result->show(); result->check_stereotypeproperties(); return result; } else return 0; }
UcUseCaseCanvas * UcUseCaseCanvas::read(char * & st, UmlCanvas * canvas, char * k) { if (!strcmp(k, "usecasecanvas_ref")) return ((UcUseCaseCanvas *) dict_get(read_id(st), "usecasecanvas", canvas)); else if (!strcmp(k, "usecasecanvas")) { int id = read_id(st); BrowserNode * br = BrowserUseCase::read_ref(st); UmlColor color = UmlDefaultColor; k = read_keyword(st); read_color(st, "color", color, k); if (strcmp(k, "xyzwh")) wrong_keyword(k, "xyzwh"); int x = (int) read_double(st); UcUseCaseCanvas * result = new UcUseCaseCanvas(br, canvas, x, (int) read_double(st), id); result->itscolor = color; read_zwh(st, result); result->width_scale100 = result->width(); result->height_scale100 = result->height(); result->set_center100(); k = read_keyword(st); result->update_name(); read_xy(st, result->label); result->label->setZ(result->z() + 0.5); result->label->set_center100(); if (!strcmp(k, "label_xyz")) // old version read_double(st); else if (strcmp(k, "label_xy")) wrong_keyword(k, "label_xy/label_xyz"); if (read_file_format() >= 58) { k = read_keyword(st); result->read_stereotype_property(st, k); // updates k if (strcmp(k, "end")) wrong_keyword(k, "end"); } result->show(); result->check_stereotypeproperties(); return result; } else return 0; }
void ColMsg::read(char * & st, ColMsgList & l, UmlCanvas * canvas) { char * k = read_keyword(st); do { const OperationData * method = 0; QString expl; if (!strcmp(k, "msg")) { if ((method = OperationData::read_ref(st)) == 0) expl = "<deleted operation>"; } else if (!strcmp(k, "explicitmsg")) expl = read_string(st); else return; bool forward = FALSE; k = read_keyword(st); if (!strcmp(k, "forward")) forward = TRUE; else if (!strcmp(k, "backward")) forward = FALSE; else wrong_keyword(k, "forward/backward"); read_keyword(st, "ranks"); unsigned abs = read_unsigned(st); QString hi = read_string(st); CodMsgSupport * in; k = read_keyword(st); if ((in = CodSelfLinkCanvas::read(st, canvas, k)) == 0) in = CodDirsCanvas::read(st, canvas, k); ColMsg * cm = new ColMsg(forward, method, expl, hi, in); cm->absolute_rank = abs; l.append(cm); in->get_msgs().append(cm); k = read_keyword(st); if (!strcmp(k, "msgs")) read(st, cm->msgs, canvas); else if (strcmp(k, "no_msg")) wrong_keyword(k, "msgs/no_msg"); k = read_keyword(st); } while (strcmp(k, "msgsend")); }
StateActionCanvas * StateActionCanvas::read(char * & st, UmlCanvas * canvas, char * k) { if (!strcmp(k, "stateactioncanvas_ref")) return ((StateActionCanvas *) dict_get(read_id(st), "stateactioncanvas", canvas)); else if (!strcmp(k, "stateactioncanvas")) { int id = read_id(st); BrowserStateAction * br = BrowserStateAction::read_ref(st); StateActionCanvas * result = new StateActionCanvas(canvas, id); result->browser_node = br; connect(br->get_data(), SIGNAL(changed()), result, SLOT(modified())); connect(br->get_data(), SIGNAL(deleted()), result, SLOT(deleted())); k = read_keyword(st); if (!strcmp(k, "language")) { result->language = drawing_language(read_keyword(st)); k = read_keyword(st); } if (!strcmp(k, "show_stereotype_properties")) { result->show_stereotype_properties = state(read_keyword(st)); k = read_keyword(st); } read_color(st, "color", result->itscolor, k); // updates k if (!strcmp(k, "xyzwh")) read_xyzwh(st, result); else wrong_keyword(k, "xyzwh"); if (read_file_format() >= 58) { k = read_keyword(st); result->read_stereotype_property(st, k); // updates k if (strcmp(k, "end")) wrong_keyword(k, "end"); } result->compute_size(); result->set_center100(); result->show(); result->check_stereotypeproperties(); return result; } else return 0; }
void NoteCanvas::read_internal(char *& st) { const char * p = st; QTextCodec* codec = QTextCodec::codecForLocale(); QTextStream stream(p); stream.setCodec(codec); QByteArray ba; stream >> ba; QString temp = QString::fromLocal8Bit(ba); char* test = read_string(st); Q_UNUSED(test); note = temp; char * k = read_keyword(st); read_color(st, "color", itscolor, k); read_font(st, "font", itsfont, k); read_color(st, "fg", fg_c, k); if (strcmp(k, "xyzwh")) wrong_keyword(k, "xyzwh"); read_xyzwh(st, this); width_scale100 = width(); height_scale100 = height(); set_center100(); show(); }
void ComponentDiagramView::read(char * st, char * k) { UmlCanvas * canvas = the_canvas(); // reads first component package icons notes junctions text and images while (ComponentCanvas::read(st, canvas, k) || NoteCanvas::read(st, canvas, k) || TextCanvas::read(st, canvas, k) || IconCanvas::read(st, canvas, k) || PackageCanvas::read(st, canvas, k) || FragmentCanvas::read(st, canvas, k) || ArrowJunctionCanvas::read(st, canvas, k) || ImageCanvas::read(st, canvas, k)) k = read_keyword(st); // then reads relations and anchors ArrowCanvas * a; while (((a = ArrowCanvas::read(st, canvas, k)) != 0) || ((a = SimpleRelationCanvas::read(st, canvas, k)) != 0)) { a->get_start()->check_line(a); k = read_keyword(st); } if (!strcmp(k, "preferred_whz") || !strcmp(k, "prefered_whz")) { preferred_size.setWidth(read_unsigned(st)); preferred_size.setHeight(read_unsigned(st)); preferred_zoom = read_double(st); k = read_keyword(st); } if (strcmp(k, "end")) wrong_keyword(k, "end"); }
void ClassInstanceData::read(char *& st, char *& k) { BasicData::read(st, k); // updates k if (strcmp(k, "type")) wrong_keyword(k, "type"); cl = BrowserClass::read_ref(st, 0); read_keyword(st, "attributes"); while (strcmp(k = read_keyword(st), "end")) { BrowserAttribute * a = BrowserAttribute::read(st, k, 0, TRUE); attributes.append(SlotAttr(a, read_string(st))); } read_keyword(st, "relations"); while (strcmp(k = read_keyword(st), "end")) { RelationData * r = RelationData::read_ref(st, TRUE, k); relations.append(SlotRel(TRUE, r, BrowserClassInstance::read_ref(st))); } k = read_keyword(st); }
void ObjectDiagramView::read(char * st, char * k) { UmlCanvas * canvas = the_canvas(); // reads first the instances, package, fragment notes, icons text and image while (OdClassInstCanvas::read(st, canvas, k) || NoteCanvas::read(st, canvas, k) || TextCanvas::read(st, canvas, k) || IconCanvas::read(st, canvas, k) || PackageCanvas::read(st, canvas, k) || FragmentCanvas::read(st, canvas, k) || ImageCanvas::read(st, canvas, k)) k = read_keyword(st); // then reads links while (ObjectLinkCanvas::read(st, canvas, k)) k = read_keyword(st); // then reads anchors while (ArrowCanvas::read(st, canvas, k)) k = read_keyword(st); if (!strcmp(k, "preferred_whz") || !strcmp(k, "prefered_whz")) { preferred_size.setWidth(read_unsigned(st)); preferred_size.setHeight(read_unsigned(st)); preferred_zoom = read_double(st); k = read_keyword(st); } if (strcmp(k, "end")) wrong_keyword(k, "end"); }
void ClassDiagramView::read(char * st, char * k) { UmlCanvas * canvas = the_canvas(); // reads first the classes package icons text notes and images while (CdClassCanvas::read(st, canvas, k) || NoteCanvas::read(st, canvas, k) || TextCanvas::read(st, canvas, k) || IconCanvas::read(st, canvas, k) || PackageCanvas::read(st, canvas, k) || FragmentCanvas::read(st, canvas, k) || ImageCanvas::read(st, canvas, k)) k = read_keyword(st); // then reads relations and anchors while (ArrowCanvas::read(st, canvas, k) || RelationCanvas::read(st, canvas, k) || SimpleRelationCanvas::read(st, canvas, k)) k = read_keyword(st); if (!strcmp(k, "preferred_whz") || !strcmp(k, "prefered_whz")) { preferred_size.setWidth(read_unsigned(st)); preferred_size.setHeight(read_unsigned(st)); preferred_zoom = read_double(st); k = read_keyword(st); } if (strcmp(k, "end")) wrong_keyword(k, "end"); }
SubjectCanvas * SubjectCanvas::read(char * & st, UmlCanvas * canvas, char * k) { if (!strcmp(k, "subject_ref")) return (SubjectCanvas *) dict_get(read_id(st), "subject", canvas); else if (!strcmp(k, "subject")) { int id = read_id(st); SubjectCanvas * result = new SubjectCanvas(canvas, 0, 0, id); result->name = toUnicode(read_string(st)); k = read_keyword(st); read_color(st, "color", result->itscolor, k); if (strcmp(k, "xyzwh")) wrong_keyword(k, "xyzwh"); read_xyzwh(st, result); result->check_size(); result->width_scale100 = result->width(); result->height_scale100 = result->height(); result->set_center100(); result->show(); return result; } else return 0; }
void DeploymentDiagramView::read(char * st, char * k) { UmlCanvas * canvas = the_canvas(); // reads first deploymentnode component icons text notes and image while (DeploymentNodeCanvas::read(st, canvas, k) || // reads artifact before component to manage component -> artifact ArtifactCanvas::read(st, canvas, k) || ComponentCanvas::read(st, canvas, k) || HubCanvas::read(st, canvas, k) || NoteCanvas::read(st, canvas, k) || TextCanvas::read(st, canvas, k) || IconCanvas::read(st, canvas, k) || PackageCanvas::read(st, canvas, k) || FragmentCanvas::read(st, canvas, k) || ImageCanvas::read(st, canvas, k)) k = read_keyword(st); // then reads relations and anchors while (ArrowCanvas::read(st, canvas, k) || AssocContainCanvas::read(st, canvas, k) || SimpleRelationCanvas::read(st, canvas, k)) k = read_keyword(st); if (!strcmp(k, "preferred_whz") || !strcmp(k, "prefered_whz")) { preferred_size.setWidth(read_unsigned(st)); preferred_size.setHeight(read_unsigned(st)); preferred_zoom = read_double(st); k = read_keyword(st); } if (strcmp(k, "end")) wrong_keyword(k, "end"); }
SdDurationCanvas * SdDurationCanvas::read_internal(char * & st, UmlCanvas * canvas, int id, SdDurationSupport * sp) { UmlColor color = UmlDefaultColor; bool coreg = FALSE; char * k = read_keyword(st); if (!strcmp(k, "coregion")) { coreg = TRUE; k = read_keyword(st); } read_color(st, "color", color, k); if (strcmp(k, "xyzwh")) wrong_keyword(k, "xyzwh"); int x = (int) read_double(st); int y = (int) read_double(st); double z = read_double(st); (void) read_double(st); // width not used to bypass old bug SdDurationCanvas * result = new SdDurationCanvas(canvas, sp, x, y, DURATION_WIDTH, (int) read_double(st), id, coreg); result->itscolor = color; result->setZ(z); result->update_hpos(); // in case the current font is not the original one result->set_center100(); result->show(); if (read_file_format() >= 48) { k = read_keyword(st); while (!strcmp(k, "overlappingdurationcanvas")) { (void) read_internal(st, canvas, read_id(st), result); k = read_keyword(st); } if (strcmp(k, "end")) wrong_keyword(k, "end"); } return result; }
SdSelfMsgCanvas * SdSelfMsgCanvas::read(char * & st, UmlCanvas * canvas, char * k) { if (!strcmp(k, "reflexivemsg_ref")) return ((SdSelfMsgCanvas *) dict_get(read_id(st), "reflexivemsg", canvas)); if (!strcmp(k, "selfreflexivemsg_ref")) return ((SdSelfMsgCanvas *) dict_get(read_id(st), "selfreflexivemsg", canvas)); else if (!strcmp(k, "reflexivemsg") || !strcmp(k, "selfreflexivemsg")) { int id = read_id(st); UmlCode c; if (*k == 's') c = UmlSelfReturnMsg; else { k = read_keyword(st); if (!strcmp(k, "synchronous")) c = UmlSyncSelfMsg; else if (!strcmp(k, "asynchronous")) c = UmlAsyncSelfMsg; else { wrong_keyword(k, "synchronous/asynchronous"); return 0; // to avoid warning } } read_keyword(st, "to"); SdDurationCanvas * d = SdDurationCanvas::read(st, canvas, TRUE); k = read_keyword(st); SdSelfMsgCanvas * result = new SdSelfMsgCanvas(canvas, d, c, (int) read_double(st) - 1, id); if (!strcmp(k, "yz")) // new version result->setZ(read_double(st)); else if (strcmp(k, "y")) wrong_keyword(k, "y/yz"); result->SdMsgBaseCanvas::read(st); return result; } else return 0; }
ArtifactCanvas * ArtifactCanvas::read(char * & st, UmlCanvas * canvas, char * k) { if (!strcmp(k, "artifactcanvas_ref") || ((read_file_format() < 20) && !strcmp(k, "componentcanvas_ref"))) return ((ArtifactCanvas *) dict_get(read_id(st), "artifactcanvas", canvas)); else if (!strcmp(k, "artifactcanvas") || ((read_file_format() < 20) && !strcmp(k, "componentcanvas"))) { int id = read_id(st); BrowserArtifact * br = BrowserArtifact::read_ref(st, read_keyword(st)); ArtifactCanvas * result = new ArtifactCanvas(canvas, id); result->browser_node = br; connect(br->get_data(), SIGNAL(changed()), result, SLOT(modified())); connect(br->get_data(), SIGNAL(deleted()), result, SLOT(deleted())); k = read_keyword(st); read_color(st, "color", result->itscolor, k); // updates k if (strcmp(k, "xyz")) wrong_keyword(k, "xyz"); read_xyz(st, result); if (read_file_format() >= 58) { k = read_keyword(st); result->read_stereotype_property(st, k); // updates k if (strcmp(k, "end")) wrong_keyword(k, "end"); } result->compute_size(); result->set_center100(); result->show(); result->check_stereotypeproperties(); return result; } else return 0; }
void AType::read(char *& st, const char * t, const char * ex, const char * k) { if (!strcmp(k, t)) { type = BrowserClass::read_ref(st); explicit_type = QString(); } else if (!strcmp(k, ex)) { type = 0; explicit_type = read_string(st); } else wrong_keyword(k, QString(t) + '/' + ex); }
ActivityPartitionCanvas * ActivityPartitionCanvas::read(char * & st, UmlCanvas * canvas, char * k) { if (!strcmp(k, "activitypartitioncanvas_ref")) return ((ActivityPartitionCanvas *) dict_get(read_id(st), "activitypartitioncanvas", canvas)); else if (!strcmp(k, "activitypartitioncanvas")) { int id = read_id(st); BrowserActivityPartition * br = BrowserActivityPartition::read_ref(st); ActivityPartitionCanvas * result = new ActivityPartitionCanvas(canvas, id); result->browser_node = br; connect(br->get_data(), SIGNAL(changed()), result, SLOT(modified())); connect(br->get_data(), SIGNAL(deleted()), result, SLOT(deleted())); k = read_keyword(st); read_color(st, "color", result->itscolor, k); // updates k if (! strcmp(k, "horiz")) { result->horiz = TRUE; k = read_keyword(st); } result->read_stereotype_property(st, k); // updates k if (!strcmp(k, "xyzwh")) read_xyzwh(st, result); else wrong_keyword(k, "xyzwh"); result->check_size(); result->width_scale100 = result->width(); result->height_scale100 = result->height(); result->set_center100(); result->show(); result->check_stereotypeproperties(); read_keyword(st, "end"); // result->force_sub_inside() useless if (canvas->paste()) result->remove_if_already_present(); return result; } else return 0; }
FragmentSeparatorCanvas * FragmentSeparatorCanvas::read(char * & st, UmlCanvas * canvas, char * k, FragmentCanvas * f) { if (strcmp(k, "separator")) wrong_keyword(k, "separator"); FragmentSeparatorCanvas * result = new FragmentSeparatorCanvas(canvas, f, read_double(st) / 10000); result->compute_position(); result->show(); return result; }
void SdObjCanvas::read(char * & st, const char * k) { if (!strcmp(k, "mortal")) { mortal = TRUE; k = read_keyword(st); } if (!strcmp(k, "xyz")) { // new version read_xyz(st, this); k = read_keyword(st); if (!strcmp(k, "life_line_masked")) { life_line->set_masked(TRUE); k = read_keyword(st); } if (strcmp(k, "life_line_z")) wrong_keyword(k, "life_line_z"); life_line->setZ(read_double(st)); } else if (!strcmp(k, "xy")) read_xy(st, this); else wrong_keyword(k, "xy/xyz"); set_center100(); }
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; }
void NoteCanvas::read_internal(char * & st) { note = toUnicode(read_string(st)); char * k = read_keyword(st); read_color(st, "color", itscolor, k); read_font(st, "font", itsfont, k); read_color(st, "fg", fg_c, k); if (strcmp(k, "xyzwh")) wrong_keyword(k, "xyzwh"); read_xyzwh(st, this); width_scale100 = width(); height_scale100 = height(); set_center100(); show(); }
void ParamData::read(char *& st, char *& k) { if (strcmp(k, "param")) wrong_keyword(k, "param"); dir = direction(read_keyword(st)); read_keyword(st, "name"); name = read_string(st); type.read(st, "type", "explicit_type"); k = read_keyword(st); if (!strcmp(k, "defaultvalue")) { default_value = read_string(st); k = read_keyword(st); } }
FragmentCanvas * FragmentCanvas::read(char * & st, UmlCanvas * canvas, char * k) { if (!strcmp(k, "fragment_ref")) return (FragmentCanvas *) dict_get(read_id(st), "fragment", canvas); else if (!strcmp(k, "fragment")) { int id = read_id(st); FragmentCanvas * result = new FragmentCanvas(canvas, 0, 0, id); result->name = read_string(st); k = read_keyword(st); read_color(st, "color", result->itscolor, k); if (!strcmp(k, "refer")) { result->refer = BrowserDiagram::read_diagram_ref(st); connect(result->refer->get_data(), SIGNAL(changed()), result, SLOT(modified())); connect(result->refer->get_data(), SIGNAL(deleted()), result, SLOT(modified())); k = read_keyword(st); } if (! strcmp(k, "form")) { result->form = read_string(st); k = read_keyword(st); } if (strcmp(k, "xyzwh")) wrong_keyword(k, "xyzwh"); read_xyzwh(st, result); result->check_size(); result->width_scale100 = result->width(); result->height_scale100 = result->height(); result->set_center100(); result->show(); if (read_file_format() >= 28) { while (strcmp(k = read_keyword(st), "end")) result->separators.append(FragmentSeparatorCanvas::read(st, canvas, k, result)); } return result; } else return 0; }
SdDurationCanvas * SdDurationCanvas::read(char * & st, UmlCanvas * canvas, char * k) { if (!strcmp(k, "durationcanvas_ref")) return ((SdDurationCanvas *) dict_get(read_id(st), "durationcanvas", canvas)); else if (!strcmp(k, "durationcanvas")) { int id = read_id(st); SdObjCanvas * o; k = read_keyword(st); if ((o = SdClassInstCanvas::read(st, canvas, k)) == 0) wrong_keyword(st, k); return read_internal(st, canvas, id, o->get_life_line()); } else return 0; }
void ActivityDiagramView::read(char * st, char * k) { // reads first state package icons notes text and image UmlCanvas * canvas = the_canvas(); while (ActivityCanvas::read(st, canvas, k) || InterruptibleActivityRegionCanvas::read(st, canvas, k) || ExpansionRegionCanvas::read(st, canvas, k) || ActivityPartitionCanvas::read(st, canvas, k) || ActivityActionCanvas::read(st, canvas, k) || ActivityObjectCanvas::read(st, canvas, k) || ActivityNodeCanvas::read(st, canvas, k) || NoteCanvas::read(st, canvas, k) || TextCanvas::read(st, canvas, k) || IconCanvas::read(st, canvas, k) || PackageCanvas::read(st, canvas, k) || FragmentCanvas::read(st, canvas, k) || ImageCanvas::read(st, canvas, k)) k = read_keyword(st); // then reads relations and anchors ArrowCanvas * a; while (((a = ArrowCanvas::read(st, canvas, k)) != 0) || ((a = FlowCanvas::read(st, canvas, k)) != 0) || ((a = SimpleRelationCanvas::read(st, canvas, k)) != 0)) { a->get_start()->check_line(a); k = read_keyword(st); } if (!strcmp(k, "preferred_whz") || !strcmp(k, "prefered_whz")) { preferred_size.setWidth(read_unsigned(st)); preferred_size.setHeight(read_unsigned(st)); preferred_zoom = read_double(st); k = read_keyword(st); } if (strcmp(k, "end")) wrong_keyword(k, "end"); }
void SeqDiagramView::read(char * st, char * k) { UmlCanvas * canvas = the_canvas(); // reads first the actors, classes instances, notes, icons text and images while (NoteCanvas::read(st, canvas, k) || TextCanvas::read(st, canvas, k) || IconCanvas::read(st, canvas, k) || FragmentCanvas::read(st, canvas, k) || SdClassInstCanvas::read(st, canvas, k) || SdContinuationCanvas::read(st, canvas, k) || ImageCanvas::read(st, canvas, k)) k = read_keyword(st); // then reads durations while (SdDurationCanvas::read(st, canvas, k)) k = read_keyword(st); // then reads lost/found start/end while (SdLostFoundMsgSupportCanvas::read(st, canvas, k)) k = read_keyword(st); // then reads msgs while (SdMsgCanvas::read(st, canvas, k) || SdSelfMsgCanvas::read(st, canvas, k)) k = read_keyword(st); // then reads anchors while (ArrowCanvas::read(st, canvas, k)) k = read_keyword(st); if (!strcmp(k, "preferred_whz") || !strcmp(k, "prefered_whz")) { preferred_size.setWidth(read_unsigned(st)); preferred_size.setHeight(read_unsigned(st)); preferred_zoom = read_double(st); k = read_keyword(st); } if (strcmp(k, "end")) wrong_keyword(k, "end"); }
TextCanvas * TextCanvas::read(char *& st, UmlCanvas * canvas, char * k) { if (!strcmp(k, "textcanvas_ref")) return ((TextCanvas *) dict_get(read_id(st), "textcanvas", canvas)); else if (!strcmp(k, "textcanvas")) { int id = read_id(st); QString text = read_string(st); UmlFont font; UmlColor fg_c = UmlBlack; UmlColor bg_c = UmlTransparent; k = read_keyword(st); read_font(st, "font", font, k); read_color(st, "fg", fg_c, k); read_color(st, "bg", bg_c, k); if (strcmp(k, "xyzwh")) wrong_keyword(k, "xyzwh"); int x = (int) read_double(st); TextCanvas * result = new TextCanvas(canvas, x, (int) read_double(st), id); read_zwh(st, result); result->width_scale100 = result->width(); result->height_scale100 = result->height(); result->set_center100(); result->text = text; result->itsfont = font; result->fg_c = fg_c; result->bg_c = bg_c; result->show(); return result; } else return 0; }
LabelCanvas * LabelCanvas::read(char *& st, UmlCanvas * canvas, char * k) { if (strcmp(k, "label")) return 0; QString s = read_string(st); bool bold = FALSE; bool italic = FALSE; bool underlined = FALSE; for (;;) { k = read_keyword(st); if (!strcmp(k, "bold")) bold = TRUE; else if (!strcmp(k, "italic")) italic = TRUE; else if (!strcmp(k, "underlined")) underlined = TRUE; else break; } int x = (int) read_double(st); LabelCanvas * result = new LabelCanvas(s, canvas, x, (int) read_double(st), bold, italic, underlined); if (!strcmp(k, "xyz")) result->setZValue(read_double(st)); else if (!strcmp(k, "xy")) // old version ;//result->setZValue(OLD_LABEL_Z); else wrong_keyword(k, "xyz"); return result; }