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 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(); }
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; }
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) { 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(); }
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; }
ActivityActionCanvas * ActivityActionCanvas::read(char * & st, UmlCanvas * canvas, char * k) { if (!strcmp(k, "activityactioncanvas_ref")) return ((ActivityActionCanvas *) dict_get(read_id(st), "activitycanvas", canvas)); else if (!strcmp(k, "activityactioncanvas")) { int id = read_id(st); BrowserActivityAction * br = BrowserActivityAction::read_ref(st); ActivityActionCanvas * result = new ActivityActionCanvas(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); result->settings.read(st, k); // updates k if (! strcmp(k, "show_opaque_action_definition")) { result->show_opaque_action_definition = 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"); result->width_scale100 = result->width(); result->height_scale100 = result->height(); result->set_center100(); result->update(); result->show(); k = read_keyword(st); if (! strcmp(k, "pins")) { while (strcmp(k = read_keyword(st), "end") != 0) result->pins.append(PinCanvas::read(st, canvas, k, result)); k = read_keyword(st); } if (! strcmp(k, "parameter_sets")) { while (strcmp(k = read_keyword(st), "end") != 0) result->paramsets.append(ParameterSetCanvas::read(st, canvas, k, result)); k = read_keyword(st); } if (! strcmp(k, "pre")) { k = read_keyword(st); result->pre = InfoCanvas::read(st, canvas, k, result); k = read_keyword(st); } if (! strcmp(k, "post")) { k = read_keyword(st); result->post = InfoCanvas::read(st, canvas, k, result); k = read_keyword(st); } if (! strcmp(k, "constraint")) { k = read_keyword(st); result->constraint = InfoCanvas::read(st, canvas, k, result); k = read_keyword(st); } result->read_stereotype_property(st, k); // updates k if (strcmp(k, "end")) wrong_keyword(k, "end"); result->check_pins(); result->check_parametersets(); result->check_conditions_constraint(); result->check_stereotypeproperties(); if (canvas->paste()) result->remove_if_already_present(); return result; } else return 0; }
PseudoStateCanvas * PseudoStateCanvas::read(char * & st, UmlCanvas * canvas, char * k) { if (!strcmp(k, "pseudostatecanvas_ref")) return ((PseudoStateCanvas *) dict_get(read_id(st), "PseudoStateCanvas", canvas)); else if (!strcmp(k, "pseudostatecanvas")) { int id = read_id(st); BrowserPseudoState * ps = BrowserPseudoState::read_ref(st); PseudoStateCanvas * result = new PseudoStateCanvas(canvas, id); result->browser_node = ps; connect(ps->get_data(), SIGNAL(changed()), result, SLOT(modified())); connect(ps->get_data(), SIGNAL(deleted()), result, SLOT(deleted())); connect(DrawingSettings::instance(), SIGNAL(changed()), result, SLOT(modified())); k = read_keyword(st); if (!strcmp(k, "horizontal")) { result->horiz = TRUE; k = read_keyword(st); } if (!strcmp(k, "xyzwh")) { read_xyzwh(st, result); result->manual_size = TRUE; } else if (strcmp(k, "xyz")) wrong_keyword(k, "xyz"); else read_xyz(st, result); if (!ps->allow_empty()) { result->label = new LabelCanvas(ps->get_name(), canvas, 0, 0); read_keyword(st, "label_xy"); read_xy(st, result->label); result->label->setZ(result->z()); result->label->set_center100(); } 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->set_xpm(); if (result->manual_size) { result->width_scale100 = result->width(); result->height_scale100 = result->height(); } result->set_center100(); result->show(); result->check_stereotypeproperties(); if (canvas->paste()) result->remove_if_already_present(); return result; } else return 0; }