static DiaObject * lifeline_load(ObjectNode obj_node, int version,DiaContext *ctx) { DiaObject *obj = object_load_using_properties(&lifeline_type, obj_node,version,ctx); return obj; }
static DiaObject * dependency_load(ObjectNode obj_node, int version, const char *filename) { DiaObject *obj = object_load_using_properties(&dependency_type, obj_node,version,filename); if (version == 0) { AttributeNode attr; /* In old objects with no autorouting, set it to false. */ attr = object_find_attribute(obj_node, "autorouting"); if (attr == NULL) ((OrthConn*)obj)->autorouting = FALSE; } return obj; }
static DiaObject * compfeat_load(ObjectNode obj_node, int version,DiaContext *ctx) { DiaObject *obj = object_load_using_properties(&compfeat_type, obj_node,version,ctx); if (version == 0) { AttributeNode attr; /* In old objects with no autorouting, set it to false. */ attr = object_find_attribute(obj_node, "autorouting"); if (attr == NULL) ((OrthConn*)obj)->autorouting = FALSE; } return obj; }
static DiaObject * usecase_load(ObjectNode obj_node, int version,DiaContext *ctx) { DiaObject *obj = object_load_using_properties(&usecase_type, obj_node,version,ctx); AttributeNode attr; /* For compatibility with previous dia files. If no line_width, use * USECASE_LINEWIDTH, that was the previous line width. */ attr = object_find_attribute(obj_node, PROP_STDNAME_LINE_WIDTH); if (attr == NULL) ((Usecase*)obj)->line_width = USECASE_LINEWIDTH; return obj; }
static DiaObject * largepackage_load(ObjectNode obj_node, int version, const char *filename) { DiaObject *obj = object_load_using_properties(&largepackage_type, obj_node,version,filename); AttributeNode attr; /* For compatibility with previous dia files. If no line_width, use * LARGEPACKAGE_BORDERWIDTH, that was the previous line width. */ attr = object_find_attribute(obj_node, PROP_STDNAME_LINE_WIDTH); if (attr == NULL) ((LargePackage*)obj)->line_width = LARGEPACKAGE_BORDERWIDTH; return obj; }
static DiaObject *transition_load(ObjectNode obj_node, int version,DiaContext *ctx) { DiaObject *obj = object_load_using_properties(¨_transition_type, obj_node,version,ctx); if (version == 0) { AttributeNode attr; /* In old objects with no autorouting, set it to false. */ attr = object_find_attribute(obj_node, "autorouting"); if (attr == NULL) ((OrthConn*)obj)->autorouting = FALSE; } if (version < 2) { /* Versions prior to 2 have the arrowheads inverted */ ((Transition*)obj)->direction_inverted = TRUE; } return obj; }
static DiaObject * _dae_load (ObjectNode obj_node, int version, DiaContext *ctx) { DiaObject *obj; DiagramAsElement *dae; obj = object_load_using_properties (&diagram_as_element_type, obj_node, version, ctx); /* filename de-normalization */ dae = (DiagramAsElement*)obj; if (strlen(dae->filename) && !g_path_is_absolute (dae->filename)) { gchar *dirname = g_path_get_dirname (dia_context_get_filename(ctx)); gchar *fname = g_build_filename (dirname, dae->filename, NULL); g_free (dae->filename); dae->filename = fname; g_free (dirname); /* need to update again with new filenames */ _dae_update_data(dae); } return obj; }
static DiaObject * mbr_load(ObjectNode obj_node, int version,DiaContext *ctx) { return object_load_using_properties(&kaos_mbr_type, obj_node,version,ctx); }
static DiaObject * outline_load(ObjectNode obj_node, int version,DiaContext *ctx) { return object_load_using_properties(&outline_type, obj_node,version,ctx); }
static DiaObject * message_load(ObjectNode obj_node, int version,DiaContext *ctx) { return object_load_using_properties(&jackson_phenomenon_type, obj_node,version,ctx); }
static DiaObject * analog_clock_load(ObjectNode obj_node, int version, DiaContext *ctx) { return object_load_using_properties(&analog_clock_type, obj_node,version,ctx); }
static DiaObject * transition_load(ObjectNode obj_node, int version, DiaContext *ctx) { return object_load_using_properties(&transition_type, obj_node,version,ctx); }
static DiaObject * goal_load(ObjectNode obj_node, int version, DiaContext *ctx) { return object_load_using_properties(&istar_goal_type, obj_node,version,ctx); }
static DiaObject * component_load(ObjectNode obj_node, int version, const char *filename) { return object_load_using_properties(&component_type, obj_node,version,filename); }
static DiaObject * req_load(ObjectNode obj_node, int version,DiaContext *ctx) { return object_load_using_properties(&jackson_requirement_type, obj_node,version,ctx); }
static DiaObject * sadtarrow_load(ObjectNode obj_node, int version, const char *filename) { return object_load_using_properties(&sadtarrow_type, obj_node,version,filename); }
static DiaObject * state_load(ObjectNode obj_node, int version, const char *filename) { return object_load_using_properties(&activity_type, obj_node,version,filename); }
static DiaObject * association_load(ObjectNode obj_node, int version, const char *filename) { Association *assoc; AttributeNode attr; DataNode composite; OrthConn *orth; DiaObject *obj; int i; /* first calls our _create() method */ obj = object_load_using_properties(&association_type, obj_node, version, filename); assoc = (Association *)obj; orth = &assoc->orth; /* ... butnot orthconn_load() */ if (version < 1) orth->autorouting = FALSE; if (version < 2) { /* vesrion 1 used to name it differently */ attr = object_find_attribute(obj_node, "autorouting"); if (attr != NULL) orth->autorouting = data_boolean(attribute_first_data(attr)); attr = object_find_attribute(obj_node, "ends"); composite = attribute_first_data(attr); for (i=0;i<2;i++) { assoc->end[i].role = NULL; attr = composite_find_attribute(composite, "role"); if (attr != NULL) { assoc->end[i].role = data_string(attribute_first_data(attr)); } if ( assoc->end[i].role != NULL && 0 == strcmp(assoc->end[i].role, "")) { g_free(assoc->end[i].role); assoc->end[i].role = NULL; } assoc->end[i].multiplicity = NULL; attr = composite_find_attribute(composite, "multiplicity"); if (attr != NULL) { assoc->end[i].multiplicity = data_string(attribute_first_data(attr)); } if ( assoc->end[i].multiplicity != NULL && 0 == strcmp(assoc->end[i].multiplicity, "")) { g_free(assoc->end[i].multiplicity); assoc->end[i].multiplicity = NULL; } assoc->end[i].arrow = FALSE; attr = composite_find_attribute(composite, "arrow"); if (attr != NULL) assoc->end[i].arrow = data_boolean(attribute_first_data(attr)); assoc->end[i].aggregate = AGGREGATE_NONE; attr = composite_find_attribute(composite, "aggregate"); if (attr != NULL) assoc->end[i].aggregate = data_enum(attribute_first_data(attr)); assoc->end[i].visibility = FALSE; attr = composite_find_attribute(composite, "visibility"); if (attr != NULL) assoc->end[i].visibility = data_enum( attribute_first_data(attr) ); assoc->end[i].text_width = 0.0; if (assoc->end[i].role != NULL) { assoc->end[i].text_width = dia_font_string_width(assoc->end[i].role, assoc_font, ASSOCIATION_FONTHEIGHT); } if (assoc->end[i].multiplicity != NULL) { assoc->end[i].text_width = MAX(assoc->end[i].text_width, dia_font_string_width(assoc->end[i].multiplicity, assoc_font, ASSOCIATION_FONTHEIGHT) ); } composite = data_next(composite); } /* derive new members state from ends */ assoc->show_direction = (assoc->direction != ASSOC_NODIR); if (assoc->end[0].aggregate == AGGREGATE_NORMAL) { assoc->assoc_type = AGGREGATE_NORMAL; assoc->direction = ASSOC_RIGHT; } else if (assoc->end[0].aggregate == AGGREGATE_COMPOSITION) { assoc->assoc_type = AGGREGATE_COMPOSITION; assoc->direction = ASSOC_RIGHT; } else if (assoc->end[1].aggregate == AGGREGATE_NORMAL) { assoc->assoc_type = AGGREGATE_NORMAL; assoc->direction = ASSOC_LEFT; } else if (assoc->end[1].aggregate == AGGREGATE_COMPOSITION) { assoc->assoc_type = AGGREGATE_COMPOSITION; assoc->direction = ASSOC_LEFT; } } /* version < 2 */ association_set_state(assoc, association_get_state(assoc)); return &assoc->orth.object; }
static DiaObject * chronoref_load(ObjectNode obj_node, int version, DiaContext *ctx) { return object_load_using_properties(&chronoref_type, obj_node,version,ctx); }
static DiaObject * other_load(ObjectNode obj_node, int version, const char *filename) { return object_load_using_properties(&kaos_other_type, obj_node,version,filename); }
static DiaObject * message_load(ObjectNode obj_node, int version, const char *filename) { return object_load_using_properties(&jackson_phenomenon_type, obj_node,version,filename); }