示例#1
0
void NoteCanvas::save(QTextStream & st, bool ref, QString &) const
{
    if (ref) {
        st << "note_ref " << get_ident();
    }
    else {
        nl_indent(st);

        st << "note " << get_ident() << " ";
        save_internal(st);
    }
}
示例#2
0
void UcUseCaseCanvas::save(QTextStream & st, bool ref, QString & warning) const {
  if (ref)
    st << "usecasecanvas_ref " << get_ident() << " // " << browser_node->get_name();
  else {
    nl_indent(st);
    st << "usecasecanvas " << get_ident() << ' ';
    browser_node->save(st, TRUE, warning);
    if (itscolor != UmlDefaultColor) {
      nl_indent(st);
      st << "  color " << stringify(itscolor);
    }
    indent(+1);
    nl_indent(st);
    save_xyzwh(st, this, "xyzwh");
    save_xy(st, label, " label_xy");
    save_stereotype_property(st, warning);
    indent(-1);
    nl_indent(st);
    st << "end";
  }
}
示例#3
0
void TransDef::save(QTextStream & st, const char * lang) const {
  indent(+1);
  
  if (!trigger.isEmpty()) {
    nl_indent(st);
    st << lang << "_trigger ";
    save_string(trigger, st);
  }
  if (!guard.isEmpty()) {
    nl_indent(st);
    st << lang << "_guard ";
    save_string(guard, st);
  }
  if (!expr.isEmpty()) {
    nl_indent(st);
    st << lang << "_expr ";
    save_string(expr, st);
  }
  
  indent(-1);
}
示例#4
0
void StateBehavior::save(Q3TextStream & st, const char * lang) const {
  indent(+1);
  
  if (!on_entry.isEmpty()) {
    nl_indent(st);
    st << lang << "_on_entry ";
    save_string(on_entry, st);
  }
  if (!on_exit.isEmpty()) {
    nl_indent(st);
    st << lang << "_on_exit ";
    save_string(on_exit, st);
  }
  if (!do_activity.isEmpty()) {
    nl_indent(st);
    st << lang << "_do_activity ";
    save_string(do_activity, st);
  }
  
  indent(-1);
}
示例#5
0
void FlowCanvas::save(Q3TextStream & st, bool ref, QString & warning) const {
  if (ref)
    st << "flowcanvas_ref " << get_ident();
  else if (begin->type() != UmlArrowPoint) {
    // relation canvas start
    nl_indent(st);
    st << "flowcanvas " << get_ident() << ' ';
    data->get_start()->save(st, TRUE, warning);	// data doesn't have id
    indent(+1);
    if (geometry != NoGeometry) {
      nl_indent(st);
      st << "geometry " << stringify(geometry);
      if (!fixed_geometry)
	st << " unfixed";
    }
    if (decenter_begin >= 0) {
      // float output/input bugged
      nl_indent(st);
      st << "decenter_begin " << ((int) (decenter_begin * 1000));
    }
    if (decenter_end >= 0) {
      // float output/input bugged
      nl_indent(st);
      st << "decenter_end " << ((int) (decenter_end * 1000));
    }
    nl_indent(st);
    (const FlowCanvas *) ArrowCanvas::save_lines(st, TRUE, TRUE, warning);
    settings.save(st);
    st << " write_horizontally " << stringify(write_horizontally);

    if (selection != 0) {
      nl_indent(st);
      st << "selection ";
      selection->save(st, FALSE, warning);
    }
    
    if (transformation != 0) {
      nl_indent(st);
      st << "transformation ";
      transformation->save(st, FALSE, warning);
    }
    
    if (stereotypeproperties != 0)
      stereotypeproperties->save(st, FALSE, warning);
    
    indent(-1);
    nl_indent(st);
    st << "end";
  }
}
void StateActionData::save(QTextStream & st, QString & warning) const
{
    BasicData::save(st, warning);

    if (! uml.isEmpty()) {
        nl_indent(st);
        st << "uml ";
        save_string(uml, st);
    }

    if (! cpp.isEmpty()) {
        nl_indent(st);
        st << "cpp ";
        save_string(cpp, st);
    }

    if (! java.isEmpty()) {
        nl_indent(st);
        st << "java ";
        save_string(java, st);
    }
}
示例#7
0
void ImageCanvas::save(QTextStream & st, bool ref, QString &) const {
    if (ref) {
        st << "image_ref " << get_ident();
    }
    else {
        nl_indent(st);

        st << "image " << get_ident() << ' ';
        save_string(fromUnicode(path), st);
        save_xyz(st, this, " xyz");
        st << " end";
    }
}
示例#8
0
void ObjectData::save(QTextStream & st, QString & warning) const {
  type.save(st, warning, " type ", " explicit_type ");
  nl_indent(st);
  
  if (!multiplicity.isEmpty()) {
    st << " multiplicity ";
    save_string(multiplicity, st);
    st << ' ';
  }
  
  st << stringify(ordering) << ' ';
  
  if (!in_state.isEmpty()) {
    st << " in_state ";
    save_string(in_state, st);
    st << ' ';
  }

  if (is_control)
    st << "is_control";
  
  if (!uml_selection.isEmpty()) {
    nl_indent(st);
    st << "uml_selection ";
    save_string(uml_selection, st);
  }
  
  if (!cpp_selection.isEmpty()) {
    nl_indent(st);
    st << "cpp_selection ";
    save_string(cpp_selection, st);
  }
  
  if (!java_selection.isEmpty()) {
    nl_indent(st);
    st << "java_selection ";
    save_string(java_selection, st);
  }
}
示例#9
0
void TextCanvas::save(QTextStream & st, bool ref, QString &) const
{
    if (ref)
        st << "textcanvas_ref " << get_ident();
    else {
        nl_indent(st);
        st << "textcanvas " << get_ident() << " ";
        save_string(fromUnicode(text), st);
        nl_indent(st);

        if (itsfont != UmlNormalFont)
            st << "  font " << stringify(itsfont);

        if (fg_c != UmlBlack)
            st << "  fg " << stringify(fg_c);

        if (bg_c != UmlTransparent)
            st << "  bg " << stringify(bg_c);

        save_xyzwh(st, this, "  xyzwh");
    }
}
示例#10
0
void InterruptibleActivityRegionCanvas::save(QTextStream & st, bool ref, QString & warning) const {
  if (ref) {
    st << "interruptibleactivityregioncanvas_ref " << get_ident() << " // "
      << browser_node->full_name();
  }
  else {
    nl_indent(st);
    st << "interruptibleactivityregioncanvas " << get_ident() << ' ';
    browser_node->save(st, TRUE, warning);
    indent(+1);
    if (itscolor != UmlDefaultColor) {
      nl_indent(st);
      st << "color " << stringify(itscolor);
    }
    save_stereotype_property(st, warning);
    nl_indent(st);
    save_xyzwh(st, this, "xyzwh");

    indent(-1);
    nl_indent(st);
    st << "end";
  }
}
示例#11
0
void StateActionCanvas::save(QTextStream & st, bool ref, QString & warning) const {
  if (ref) {
    st << "stateactioncanvas_ref " << get_ident();
  }
  else {
    nl_indent(st);
    st << "stateactioncanvas " << get_ident() << ' ';
    browser_node->save(st, TRUE, warning);
    indent(+1);
      nl_indent(st);
    if (language != DefaultDrawingLanguage)
      st << "language " << stringify(language) << ' ';
    if (show_stereotype_properties != UmlDefaultState)
      st << "show_stereotype_properties " << stringify(show_stereotype_properties) << ' ';
    if (itscolor != UmlDefaultColor)
      st << "color " << stringify(itscolor) << ' ';
    save_xyzwh(st, this, "xyzwh");
    save_stereotype_property(st, warning);
    indent(-1);
    nl_indent(st);
    st << "end";
  }
}
示例#12
0
void StateData::save(QTextStream & st, QString & warning) const
{
    BasicData::save(st, warning);
    uml.save(st, "uml");
    cpp.save(st, "cpp");
    java.save(st, "java");

    bool nl = FALSE;

    if (is_active) {
        nl_indent(st);
        nl = TRUE;
        st << "active";
    }

    if (specification != 0) {
        if (nl)
            st << " ";
        else {
            nl_indent(st);
            nl = TRUE;
        }

        st << "specification ";
        specification->save(st, TRUE, warning);
    }

    if (reference != 0) {
        if (nl)
            st << " ";
        else
            nl_indent(st);

        st << "reference ";
        reference->save(st, TRUE, warning);
    }
}
示例#13
0
void SdDurationCanvas::save_internal(Q3TextStream & st) const {
  indent(+1);
  
  if (coregion) {
    nl_indent(st);
    st << "coregion";
  }      
  if (itscolor != UmlDefaultColor) {
    nl_indent(st);
    st << "color " << stringify(itscolor);
  }
  
  nl_indent(st);
  save_xyzwh(st, this, "xyzwh");
  
  Q3PtrListIterator<SdDurationCanvas> itd(durations);
  
  for (; itd.current(); ++itd)
    itd.current()->save_sub(st);
  
  indent(-1);
  nl_indent(st);
  st << "end";
}
示例#14
0
void PackageCanvas::save(Q3TextStream & st, bool ref, QString & warning) const {
  if (ref)
    st << "packagecanvas_ref " << get_ident() << " // " << browser_node->get_name();
  else {
    nl_indent(st);
    st << "packagecanvas " << get_ident() << ' ';
    indent(+1);
    browser_node->save(st, TRUE, warning);
    nl_indent(st);
    if (name_in_tab != UmlDefaultState)
      st << "name_in_tab " << stringify(name_in_tab);
    if (show_context_mode != DefaultShowContextMode)
      st << " show_context_mode " << stringify(show_context_mode);
    if (show_stereotype_properties != UmlDefaultState)
      st << " show_stereotype_properties " << stringify(show_stereotype_properties);
    if (itscolor != UmlDefaultColor)
      st << " color " << stringify(itscolor);
    save_xyzwh(st, this, "  xyzwh");
    save_stereotype_property(st, warning);
    indent(-1);
    nl_indent(st);
    st << "end";
  }
}
示例#15
0
void NoteCanvas::save_internal(QTextStream & st) const
{
    QTextCodec* codec = QTextCodec::codecForLocale();
    QByteArray toWrite = codec->fromUnicode(note);
    save_string(toWrite, st);

    //save_string(temp1, st);
    nl_indent(st);

    if (itscolor != UmlDefaultColor)
        st << "  color " << stringify(itscolor);

    if (itsfont != UmlNormalFont)
        st << "  font " << stringify(itsfont);

    if (fg_c != UmlBlack)
        st << "  fg " << stringify(fg_c);

    save_xyzwh(st, this, "  xyzwh");
}
示例#16
0
void CodLinkCanvas::save(Q3TextStream & st, bool ref, QString & warning) const {
  if (ref)
    st << "linkcanvas_ref " << get_ident();
  else if (begin->type() != UmlArrowPoint) {
    nl_indent(st);
    st << "linkcanvas " << get_ident();
    if (decenter_begin >= 0)
      // float output/input bugged
      st << " decenter_begin " << ((int) (decenter_begin * 1000));
    if (decenter_end >= 0)
      // float output/input bugged
      st << " decenter_end " << ((int) (decenter_end * 1000));
    indent(+1);
    save_lines(st, TRUE, TRUE, warning);
    indent(-1);
    
    CodDirsCanvas * d = find_dirs();
    
    if (d != 0)
      d->save(st, FALSE, warning);
  }
}
示例#17
0
void SdSelfMsgCanvas::save(Q3TextStream & st, bool ref, QString & warning) const {
    if (ref) {
        st << ((itsType == UmlSelfReturnMsg)
               ? "selfreflexivemsg_ref "
               : "reflexivemsg_ref ")
           << get_ident() << " // " << get_msg(FALSE);
    }
    else {
        nl_indent(st);
        switch (itsType) {
        case UmlSelfReturnMsg:
            st << "selfreflexivemsg " << get_ident();
            break;
        case UmlSyncSelfMsg:
            st << "reflexivemsg " << get_ident() << " synchronous";
            break;
        default:
            st << "reflexivemsg " << get_ident() << " asynchronous";
        }
        indent(+1);
        SdMsgBaseCanvas::save(st, warning);
        indent(-1);
    }
}
示例#18
0
void AssocContainCanvas::save(Q3TextStream & st, bool ref, QString & warning) const {
  if (ref)
    st << "containcanvas_ref " << get_ident();
  else if (begin->type() != UmlArrowPoint) {
    nl_indent(st);
    st << "containcanvas " << get_ident();
    if (geometry != NoGeometry) {
      st << " geometry " << stringify(geometry);
      if (!fixed_geometry)
	st << " unfixed";
    }
    if (decenter_begin >= 0) {
      // float output/input bugged
      st << "decenter_begin " << ((int) (decenter_begin * 1000));
    }
    if (decenter_end >= 0) {
      // float output/input bugged
      st << " decenter_end " << ((int) (decenter_end * 1000));
    }
    indent(+1);
    save_lines(st, TRUE, TRUE, warning);
    indent(-1);
  }
}
示例#19
0
void ExtraMemberData::save(Q3TextStream & st, QString & warning) const {
  nl_indent(st);
  BasicData::save(st, warning);
  
  nl_indent(st);
  st << "cpp ";
  save_string(cpp_decl, st);
  st << ' ';
  save_string(cpp_def, st);
  if (cpp_inline) 
    st << " inline";
  nl_indent(st);
  st << "java ";
  save_string(java_decl, st);
  nl_indent(st);
  st << "php ";
  save_string(php_decl, st);
  nl_indent(st);
  st << "python ";
  save_string(python_decl, st);
  nl_indent(st);
  st << "idl ";
  save_string(idl_decl, st);
}
示例#20
0
void PackageData::save(Q3TextStream & st, QString & warning) const {
  BasicData::save(st, warning);

  if (!cpp_h_dir.isEmpty()) {
    nl_indent(st);
    st << "cpp_h_dir ";
    save_string(cpp_h_dir, st);
  }
  if (!cpp_src_dir.isEmpty()) {
    nl_indent(st);
    st << "cpp_src_dir ";
    save_string(cpp_src_dir, st);
  }
  if (!cpp_namespace.isEmpty()) {
    nl_indent(st);
    st << "cpp_namespace ";
    save_string(cpp_namespace, st);
  }
  if (!java_dir.isEmpty()) {
    nl_indent(st);
    st << "java_dir ";
    save_string(java_dir, st);
  }
  if (!java_package.isEmpty()) {
    nl_indent(st);
    st << "java_package ";
    save_string(java_package, st);
  }
  if (!php_dir.isEmpty()) {
    nl_indent(st);
    st << "php_dir ";
    save_string(php_dir, st);
  }
  if (!php_namespace.isEmpty()) {
    nl_indent(st);
    st << "php_namespace ";
    save_string(php_namespace, st);
  }
  if (!python_dir.isEmpty()) {
    nl_indent(st);
    st << "python_dir ";
    save_string(python_dir, st);
  }
  if (!python_package.isEmpty()) {
    nl_indent(st);
    st << "python_package ";
    save_string(python_package, st);
  }
  if (!idl_dir.isEmpty()) {
    nl_indent(st);
    st << "idl_dir ";
    save_string(idl_dir, st);
  }
  if (!idl_module.isEmpty()) {
    nl_indent(st);
    st << "idl_module ";
    save_string(idl_module, st);
  }
}
示例#21
0
void ComponentDiagramView::save(Q3TextStream & st, QString & warning,
				bool copy) const {
  DiagramItemList items(canvas()->allItems());
  DiagramItem * di;
  
  if (!copy)
    // sort is useless for a copy
    items.sort();
  
  st << "format " << FILEFORMAT << "\n";
  
  // save first component packages fragment notes junctions and icons
  
  for (di = items.first(); di != 0; di = items.next()) {
    switch (di->type()) {
    case UmlComponent:
    case UmlNote:
    case UmlText:
    case UmlImage:
    case UmlPackage:
    case UmlFragment:
    case UmlArrowJunction:
    case UmlIcon:
      if (!copy || di->copyable())
	di->save(st, FALSE, warning);
      // no break
    default:
      break;
    }
  }

  // then saves relations
  
  for (di = items.first(); di != 0; di = items.next()) {
    switch (di->type()) {
    case UmlInherit:
    case UmlDependency:
    case UmlDependOn:
    case UmlRequired:
    case UmlProvided:
      if (!copy || di->copyable())
	di->save(st, FALSE, warning);
    default:	// to avoid compiler warning
      break;
    }
  }
  
  // then saves anchors
  
  for (di = items.first(); di != 0; di = items.next())
    if ((!copy || di->copyable()) && (di->type() == UmlAnchor))
      di->save(st, FALSE, warning);
  
  if (!copy && (preferred_zoom != 0)) {
    nl_indent(st);
    st << "preferred_whz " << preferred_size.width() << ' '
      << preferred_size.height() << ' ' << preferred_zoom;
  }
  
  nl_indent(st);
  st << "end\n";
}
示例#22
0
static void save_role(const RoleData & role, bool assoc, QTextStream & st,
                      QString & warning)
{
    if (assoc) {
        st << "role_name ";
        save_string(role.role, st);

        if (!role.multiplicity.isEmpty()) {
            st << " multiplicity ";
            save_string(role.multiplicity, st);
        }

        if (!role.init_value.isEmpty()) {
            st << " init_value ";
            save_string(role.init_value, st);
        }

        st << " ";

        if (role.isa_class_relation)
            st << "class_relation ";

        if (role.isa_volatile_relation)
            st << "volatile ";

        if (role.isa_const_relation)
            st << "const_relation ";

        if (role.is_derived)
            st << ((role.is_derivedunion) ? "derivedunion " : "derived ");

        if (role.is_ordered)
            st << "ordered ";

        if (role.is_unique)
            st << "unique ";
    }

    st << stringify(role.uml_visibility);

    if (! role.comment.isEmpty()) {
        nl_indent(st);
        st << "comment ";
        save_string(role.comment, st);
    }

    if (!role.constraint.isEmpty()) {
        nl_indent(st);
        st << "constraint ";
        save_string(role.constraint, st);
    }

    if (!role.cpp_decl.isEmpty()) {
        nl_indent(st);
        st << "cpp ";

        if (role.cpp_virtual_inheritance)
            st << "virtual ";

        if (role.cpp_mutable)
            st << "mutable ";

        st << stringify(role.cpp_visibility) << " ";
        save_string(role.cpp_decl, st);
    }

    if (role.java_transient) {
        nl_indent(st);
        st << "transient";
    }

    if (!role.java_decl.isEmpty()) {
        nl_indent(st);
        st << "java ";
        save_string(role.java_decl, st);
    }

    if (!role.java_annotation.isEmpty()) {
        nl_indent(st);
        st << "java_annotation ";
        save_string(role.java_annotation, st);
    }

    if (!role.php_decl.isEmpty()) {
        nl_indent(st);
        st << "php ";
        save_string(role.php_decl, st);
    }

    if (!role.python_decl.isEmpty()) {
        nl_indent(st);
        st << "python ";
        save_string(role.python_decl, st);
    }

    if (role.idl_case != 0) {
        nl_indent(st);
        st << "idl_case ";
        role.idl_case->save(st, TRUE, warning);
    }
    else if (! role.idl_explicit_case.isEmpty()) {
        nl_indent(st);
        st << "idl_explicit_case ";
        save_string(role.idl_explicit_case, st);
    }

    if (!role.idl_decl.isEmpty()) {
        nl_indent(st);
        st << "idl ";
        save_string(role.idl_decl, st);
    }

    if (role.idl_truncatable_inheritance) {
        nl_indent(st);
        st << "truncatable";
    }

    nl_indent(st);
}
示例#23
0
void StateDiagramView::save(QTextStream & st, QString & warning,
                            bool copy) const
{
    DiagramItemList items(canvas()->items());

    if (!copy)
        // sort is useless for a copy
        items.sort();

    st << "format " << api_format() << "\n";

    // save first states pseudostates actions packages fragments notes and icons

    foreach (DiagramItem *di, items) {
        switch (di->typeUmlCode()) {
        case UmlState:
        case UmlStateAction:
        case InitialPS:
        case EntryPointPS:
        case FinalPS:
        case TerminatePS:
        case ExitPointPS:
        case DeepHistoryPS:
        case ShallowHistoryPS:
        case JunctionPS:
        case ChoicePS:
        case ForkPS:
        case JoinPS:
        case UmlNote:
        case UmlText:
        case UmlImage:
        case UmlPackage:
        case UmlFragment:
        case UmlIcon:
            if (!copy || di->copyable())
                di->save(st, FALSE, warning);

            // no break
        default:
            break;
        }
    }

    // then saves relations

    foreach (DiagramItem *di, items) {
        if (di->typeUmlCode() == UmlTransition) {
            if (!copy || di->copyable())
                di->save(st, FALSE, warning);
        }
    }

    // then saves anchors

    foreach (DiagramItem *di, items)
        if ((!copy || di->copyable()) && (di->typeUmlCode() == UmlAnchor))
            di->save(st, FALSE, warning);

    if (!copy && (preferred_zoom != 0)) {
        nl_indent(st);
        st << "preferred_whz " << preferred_size.width() << " "
           << preferred_size.height() << " " << preferred_zoom;
    }

    nl_indent(st);
    st << "end\n";
}
示例#24
0
void ClassData::save(QTextStream & st, QString & warning) const {
  nl_indent(st);
  
  if (is_abstract)
    st << "abstract ";
  
  if (is_active)
    st << "active ";
  
  st << "visibility " << stringify(uml_visibility) << ' ';
  
  if (!stereotype.isEmpty()) {
    st << "stereotype ";
    save_string(stereotype, st);
    
    if (stereotype == "typedef")
      base_type.save(st, warning, " base_type ", " explicit_base_type ");
  }
  
  nl_indent(st);
  if (nformals != 0) {
    st << "nformals " << nformals;
    for (int i = 0; i!= nformals; i += 1)
      formals[i].save(st, warning);
    nl_indent(st);  
  }
  
  if (actuals.count() != 0) {
    st << "nactuals " << actuals.count();
    QListIterator<ActualParamData> ita(actuals);
    for (; ita.current(); ++ita)
      ita.current()->save(st, warning);
    nl_indent(st);  
  }
  if (!constraint.isEmpty()) {
    nl_indent(st);
    st << "constraint ";
    save_string(constraint, st);
  }
  
  if (cpp_external)
    st << "cpp_external ";
  if (cpp_visibility != UmlDefaultVisibility)
    st << "cpp_visibility " << stringify(cpp_visibility) << " ";
  
  st << "cpp_decl ";
  save_string(cpp_decl, st);
  
  nl_indent(st);
  if (java_external)
    st << "java_external ";
  if (java_final)
    st << "final ";
  st << "java_decl ";
  save_string(java_decl, st);
  if (! java_annotation.isEmpty()) {
    nl_indent(st);
    st << "java_annotation ";
    save_string(java_annotation, st);
  }
  
  nl_indent(st);
  if (php_external)
    st << "php_external ";
  if (php_final)
    st << "php_final ";
  st << "php_decl ";
  save_string(php_decl, st);

  nl_indent(st);
  if (python_external)
    st << "python_external ";
  if (python_2_2)
    st << "python_2_2 ";
  st << "python_decl ";
  save_string(python_decl, st);

  nl_indent(st);
  if (idl_external)
    st << "idl_external ";
  if (idl_local)
    st << "local ";
  if (idl_custom)
    st << "custom ";
  st << "idl_decl ";
  save_string(idl_decl, st);
  nl_indent(st);
  switch_type.save(st, warning, "switch_type ", "explicit_switch_type ");
  nl_indent(st);
}
示例#25
0
void FragmentSeparatorCanvas::save(Q3TextStream & st, bool, QString &) const {
  nl_indent(st);
  st << "separator " << (int) (vpos * 10000);
}
示例#26
0
void ColDiagramView::save(QTextStream & st, QString & warning,
                          bool copy) const
{
    DiagramItemList items(canvas()->allItems());

    if (!copy)
        // sort is useless for a copy
        items.sort();

    st << "format " << api_format() << "\n";

    // save first the packages fragment, classes instances, notes, icons and text

    foreach (DiagramItem *di, items) {
        switch (di->type()) {
        case UmlPackage:
        case UmlFragment:
        case UmlClass:
        case UmlClassInstance:
        case UmlNote:
        case UmlText:
        case UmlImage:
        case UmlIcon:
            if (!copy || di->copyable())
                di->save(st, FALSE, warning);

            // no break
        default:
            break;
        }
    }

    // then save links selflink and dirs (without messages)

    foreach (DiagramItem *di, items) {
        switch (di->type()) {
        case UmlLink:	// saves associated dirs
        case UmlSelfLink:
            if (!copy || di->copyable())
                di->save(st, FALSE, warning);

        default:	// to avoid warning
            break;
        }
    }

    // then save messages
    ColMsg::save(st, msgs, copy, warning,
                 window()->browser_diagram()->full_name());

    // then save anchors

    foreach (DiagramItem *di, items)
        if ((!copy || di->copyable()) && (di->type() == UmlAnchor))
            di->save(st, FALSE, warning);

    if (!copy && (preferred_zoom != 0)) {
        nl_indent(st);
        st << "preferred_whz " << preferred_size.width() << " "
           << preferred_size.height() << " " << preferred_zoom;
    }

    nl_indent(st);
    st << "end\n";
}
示例#27
0
void ActivityDiagramView::save(QTextStream & st, QString & warning,
                               bool copy) const
{
    DiagramItemList items(canvas()->allItems());
    DiagramItem * di;

    if (!copy)
        // sort is useless for a copy
        items.sort();

    st << "format " << api_format() << "\n";

    // save first activity, activity nodes, actions, objects, packages, fragments, notes and icons

    for (di = items.first(); di != 0; di = items.next()) {
        switch (di->type()) {
        case UmlActivity:
        case UmlInterruptibleActivityRegion:
        case UmlExpansionRegion:
        case UmlActivityPartition:
        case InitialAN:
        case ActivityFinalAN:
        case FlowFinalAN:
        case DecisionAN:
        case MergeAN:
        case ForkAN:
        case JoinAN:
        case UmlActivityAction:
        case UmlActivityObject:
        case UmlNote:
        case UmlText:
        case UmlImage:
        case UmlPackage:
        case UmlFragment:
        case UmlIcon:
            if (!copy || di->copyable())
                di->save(st, FALSE, warning);

            // no break
        default:
            // Parameters, parameter sets and pins are saved by their parents
            // pre & post conditions are saved by activity action
            break;
        }
    }

    // then saves relations

    for (di = items.first(); di != 0; di = items.next()) {
        switch (di->type()) {
        case UmlFlow:
        case UmlDependOn:
            if (!copy || di->copyable())
                di->save(st, FALSE, warning);

        default:
            break;
        }
    }

    // then saves anchors

    for (di = items.first(); di != 0; di = items.next())
        if ((!copy || di->copyable()) && (di->type() == UmlAnchor))
            di->save(st, FALSE, warning);

    if (!copy && (preferred_zoom != 0)) {
        nl_indent(st);
        st << "preferred_whz " << preferred_size.width() << " "
           << preferred_size.height() << " " << preferred_zoom;
    }

    nl_indent(st);
    st << "end\n";
}
示例#28
0
void SdDurationCanvas::save_sub(Q3TextStream & st) const {
  nl_indent(st);
  st << "overlappingdurationcanvas " << get_ident();
  save_internal(st);
}
示例#29
0
void ExceptionData::save(QTextStream & st, QString & warning) const {
  nl_indent(st);
  type.save(st, warning, "  exception ", "  explicit_exception ");
}
示例#30
0
void SdMsgBaseCanvas::save(QTextStream & st, QString & warning) const {
  nl_indent(st);
  st << "to ";
  dest->save(st, TRUE, warning);
  nl_indent(st);
#ifdef FORCE_INT_COORD
  // note : << float bugged in Qt 3.3.3
  st << "yz " << (int) y() << ' ' << (int) z();
#else
  QString sy, sz;
  
  st << "yz " << sy.setNum(y()) << ' ' << sz.setNum(z());
#endif
  if (msg != 0) {
    // not a lost, dest is duration
    if (msg->deletedp()) {
      warning += QString("<b>") + the_canvas()->browser_diagram()->full_name() +
	"</b> reference the class <b>" +
	  ((SdDurationCanvas *) dest)->get_line()->get_obj()->get_class()->full_name() +
	    "</b> deleted operation <b>" + msg->definition(TRUE, FALSE) + "</b><br>\n<br>\n";
      if (warning[0] == '!') {
	st << " msg ";
	msg->save(st, TRUE, warning);
      }
      else {
	st << " explicitmsg ";
	save_string(msg->get_browser_node()->get_name(), st);
      }
    }
    else {
      st << " msg ";
      msg->save(st, TRUE, warning);
    }
  }
  else if (! explicit_msg.isEmpty()) {
    st << " explicitmsg ";
    save_string(explicit_msg, st);
  }
  else
    st << " unspecifiedmsg";
  
  if (stereotype != 0) {
    nl_indent(st);
    st << "stereotype ";
    save_string(stereotype->get_name(), st);
    save_xyz(st, stereotype, " xyz");
  }
  
  nl_indent(st);
  st << "show_full_operations_definition " << stringify(show_full_oper)
    << " drawing_language " << stringify(drawing_language)
      << " show_context_mode " << stringify(show_context_mode);
  
  if (label != 0) {
    if (! args.isEmpty()) {
      nl_indent(st);
      st << "args ";
      save_string(args, st);
    }
    nl_indent(st);
    save_xy(st, label, "label_xy");
  }
}