Class: UMLDiagram
Defined in: | web-src/coffee/model/uml/umldiagram.coffee |
Inherits: | model.Diagram |
Overview
A UML diagram representation.
Instance Method Summary
- # (void) get_factory()
- # (void) set_factory(factory)
- # (void) get_graph()
- # (void) set_graph(graph)
- # (void) refresh_URIs_diag() Refreshing URIs in diagram for namespaces changes.
- # (void) _add_events() Bound Add events to the joint.Graph instance assigned to @graph.
- # (void) get_clases()
- # (void) get_links()
- # (void) get_generalizations()
- # (void) get_associations()
- # (void) get_attributes()
- # (void) get_clase(nombre)
-
#
(Class)
find_class_by_name(name)
Find Primitive Messages
- # (Class) find_class_by_classid(classid)
- # (Link) find_link_by_id(linkid)
- # (Link) find_link_by_source_and_target(name, class_a, class_b)
- # (Generalization) find_generalization_by_id(generalizationid)
- # (void) find_generalization_by_link(link)
- # (Association) find_association_by_id(associationid)
- # (void) find_association_by_role(role)
- # (Attribute) find_attribute_by_id(attributeid)
- # (void) find_attribute_by_name(name)
- # (void) find_attribute_by_source_and_target(name, class_a, type_a)
-
#
(Generalization)
find_IsA_with_parent(parentclass)
Find a generalization that contains the given parent
generalization.
- # (Array) find_links_by_name(name) Find the Link instances with the given name.
- # (void) show_class_info(class_id)
- # (void) show_gen_info(gen_id)
- # (void) show_assoc_info(assoc_id)
- # (void) add_generalization(class_parent, class_childs, disjoint = false, covering = false, name = null, position = null, inferred = false) Add a Generalization link.
- # (void) add_generalization_objs(class_parent, class_child, disjoint = false, covering = false, name = null, position, inferred = false) Add a Generalization link.
- # (void) edit_covering(gen_id, covering)
- # (void) edit_disjoint(gen_id, disjoint)
- # (void) add_association(class_a_id, class_b_id, name = null, mult = null, roles = null, position = null, inferred = false) Add a new UML association between two or more classes.
- # (void) add_association_class(class_a_id, class_b_id, name, mult = null, roles = null, position = null) Add a new UML association with class between two or more classes.
-
#
(Class)
add_class(hash_data)
Hash Data
name
(mandatory)attribs
(optional)methods
(optional)position
(optional)diagram_instance.add_class({name: "class A"}) diagram_instance.add_class({name: "class B", attrs: ["attrib1", "attrib2"], methods: ["method1", "method2"], position: {x: 20, y: 20}})
- # (void) agregar_clase(clase)
- # (void) add_attribute(class_a_id, name, type) Class are created in crowd without attributes.
- # (void) add_assoc_class(hash_data)
- # (void) agregar_assoc_clase(clase)
- # (void) delete_class(c)
- # (Generalization) agregar_generalization(generalization)
- # (void) delete_generalization(c)
- # (void) delete_association(c) Delete association removes also internal associated classes (non shown) for n-ary associations without class
- # (?) find_associated_links(c) Search for all links associated to the given class.
- # (void) remove_associated_links(c) Remove all links associated to the given class.
- # (void) delete_association_by_id(associationid)
- # (void) delete_generalization_by_id(generalizationid)
- # (Association) agregar_association(association)
- # (void) rename_class(classid, name) Rename class takes name, prefix and url and validate if both prefix and url are different from null Otherwise, it updates the uri associated to classid class @param classid.
- # (void) delete_link_by_id(linkid) Remove the link by its Joint CellID from the diagram.
- # (void) delete_link_by_source_and_target(name, class_a, class_b) Remove the link by its source and target from the diagram.
- # (void) delete_link(link) Remove the given link from the diagram.
- # (void) update_view(class_id, paper) Update the view associated to the given class's classid if it have already created its joint object.
- # (void) update_gen_view(gen_id, paper) Update the view associated to the given class's classid if it have already created its joint object.
- # (void) delete_class_by_name(name) Remove the class from the diagram.
- # (void) delete_class_by_classid(classid) Delete a class selecting by using its Joint Model
- # (void) reset() Reset the current diagram to start over empty.
- # (void) agregar_link(link) Limitations If the link is a generalization it adds as a new generalization, not as part of another one. For example, if you want to add another child into an already existent generalization, use add_generalization(same_parent, new_child) message.
- # (void) set_satisfiable(classes_list) Show these classes as satisifiable.
- # (void) set_class_satisfiable(class_name) Satisfiability Satifiability objects managent messages. Show this class as satisfiable.
- # (void) set_unsatisfiable(classes_list) Show these classes as unsatisifiable.
- # (void) set_class_unsatisfiable(class_name) Show this class as unsatisfiable.
- # (void) set_inferredSubs(isubs_list) Show new inferred subsumptions.
- # (void) set_inferredSub_elt(isub)
- # (void) set_inferredCards(icards_list) Show new inferred cardinalities.
- # (void) set_inferredCards_elt(icard)
- # (void) to_json() JSON Import/Export Messages for supporting JSON translation. Return a JSON representing the Diagram. We want to send only some things not all the JSON the object has. So, we drop some things, like JointJS graph objects. Use JSON.stringify(json_object) to translate a JSON object to string.
- # (void) import_json(json) Import all classes and associations from a JSON object.
-
#
(void)
actualizar_graph()
Joint Graph Management
Update a joint.Graph instance with the new cells. -
#
(boolean)
same_elts(diag)
Comparing Diagrams
Two diagram are equivalents if has the same classes and links with the same names and attributes.
Constructor Details
#
(void)
constructor(graph = null)
Instance Method Details
#
(void)
get_factory()
#
(void)
set_factory(factory)
#
(void)
get_graph()
#
(void)
set_graph(graph)
#
(void)
refresh_URIs_diag()
Refreshing URIs in diagram for namespaces changes.
#
(void)
_add_events()
Bound
Add events to the joint.Graph instance assigned to @graph. This method should consider each link in any association (also remove roles) and any generalization.
#
(void)
get_clases()
#
(void)
get_links()
#
(void)
get_generalizations()
#
(void)
get_associations()
#
(void)
get_attributes()
#
(void)
get_clase(nombre)
#
(Class)
find_class_by_name(name)
Find Primitive Messages
#
(Class)
find_class_by_classid(classid)
#
(Link)
find_link_by_id(linkid)
#
(Link)
find_link_by_source_and_target(name, class_a, class_b)
#
(Generalization)
find_generalization_by_id(generalizationid)
#
(void)
find_generalization_by_link(link)
#
(Association)
find_association_by_id(associationid)
#
(void)
find_association_by_role(role)
#
(Attribute)
find_attribute_by_id(attributeid)
#
(void)
find_attribute_by_name(name)
#
(void)
find_attribute_by_source_and_target(name, class_a, type_a)
#
(Generalization)
find_IsA_with_parent(parentclass)
Find a generalization that contains the given parent
generalization.
#
(Array)
find_links_by_name(name)
Find the Link instances with the given name.
#
(void)
show_class_info(class_id)
#
(void)
show_gen_info(gen_id)
#
(void)
show_assoc_info(assoc_id)
#
(void)
add_generalization(class_parent, class_childs, disjoint = false, covering = false, name = null, position = null, inferred = false)
Add a Generalization link.
If a generalziation already exists for the same parent, just add the class into the same Generalization instance. Constraints are ignored in this case.
This methods try to normalize all parameters and then call add_generalization_objs().
#
(void)
add_generalization_objs(class_parent, class_child, disjoint = false, covering = false, name = null, position, inferred = false)
Add a Generalization link.
If a generalziation already exists for the same parent, just add the class into the same Generalizatino instance. Constraints are ignored in this case.
#
(void)
edit_covering(gen_id, covering)
#
(void)
edit_disjoint(gen_id, disjoint)
#
(void)
add_association(class_a_id, class_b_id, name = null, mult = null, roles = null, position = null, inferred = false)
Add a new UML association between two or more classes. It also manage adding classes to assoc and editing roles
to the first relationship while remaining 2..n contain the associated ones to respective target classes.
#
(void)
add_association_class(class_a_id, class_b_id, name, mult = null, roles = null, position = null)
Add a new UML association with class between two or more classes. It also manage adding classes to assoc and editing roles
to the first relationship while remaining 2..n contain the associated ones to respective target classes.
#
(Class)
add_class(hash_data)
Hash Data
name
(mandatory)attribs
(optional)methods
(optional)position
(optional)
diagram_instance.add_class({name: "class A"})
diagram_instance.add_class({name: "class B", attrs: ["attrib1", "attrib2"], methods: ["method1", "method2"], position: {x: 20, y: 20}})
#
(void)
agregar_clase(clase)
#
(void)
add_attribute(class_a_id, name, type)
Class are created in crowd without attributes. This function adds attributes to classes by associating the current class to a attribute name (uri) and its datatype (another uri)
@param
#
(void)
add_assoc_class(hash_data)
#
(void)
agregar_assoc_clase(clase)
#
(void)
delete_class(c)
#
(Generalization)
agregar_generalization(generalization)
#
(void)
delete_generalization(c)
#
(void)
delete_association(c)
Delete association removes also internal associated classes (non shown) for n-ary associations without class
#
(?)
find_associated_links(c)
Search for all links associated to the given class.
#
(void)
remove_associated_links(c)
Remove all links associated to the given class.
#
(void)
delete_association_by_id(associationid)
#
(void)
delete_generalization_by_id(generalizationid)
#
(Association)
agregar_association(association)
#
(void)
rename_class(classid, name)
Rename class takes name, prefix and url and validate if both prefix and url are different from null Otherwise, it updates the uri associated to classid class
@param classid. A String with the class id to be renamed @param name. A String with the name for class id
#
(void)
delete_link_by_id(linkid)
Remove the link by its Joint CellID from the diagram.
#
(void)
delete_link_by_source_and_target(name, class_a, class_b)
Remove the link by its source and target from the diagram.
@param name,class_a,class_b are strings
#
(void)
delete_link(link)
Remove the given link from the diagram.
#
(void)
update_view(class_id, paper)
Update the view associated to the given class's classid if it have already created its joint object. The view to be updated must be of the given paper
#
(void)
update_gen_view(gen_id, paper)
Update the view associated to the given class's classid if it have already created its joint object. The view to be updated must be of the given paper
#
(void)
delete_class_by_name(name)
Remove the class from the diagram.
#
(void)
delete_class_by_classid(classid)
Delete a class selecting by using its Joint Model
#
(void)
reset()
Reset the current diagram to start over empty.
Remove all classes and associations.
#
(void)
agregar_link(link)
Limitations
If the link is a generalization it adds as a new generalization, not as part of another one.
For example, if you want to add another child into an already existent generalization, use add_generalization(same_parent, new_child) message.
#
(void)
set_satisfiable(classes_list)
Show these classes as satisifiable.
#
(void)
set_class_satisfiable(class_name)
Satisfiability
Satifiability objects managent messages.
Show this class as satisfiable.
#
(void)
set_unsatisfiable(classes_list)
Show these classes as unsatisifiable.
#
(void)
set_class_unsatisfiable(class_name)
Show this class as unsatisfiable.
#
(void)
set_inferredSubs(isubs_list)
Show new inferred subsumptions.
#
(void)
set_inferredSub_elt(isub)
#
(void)
set_inferredCards(icards_list)
Show new inferred cardinalities.
#
(void)
set_inferredCards_elt(icard)
#
(void)
to_json()
JSON Import/Export
Messages for supporting JSON translation.
Return a JSON representing the Diagram.
We want to send only some things not all the JSON the object has. So, we drop some things, like JointJS graph objects.
Use JSON.stringify(json_object) to translate a JSON object to string.
#
(void)
import_json(json)
Import all classes and associations from a JSON object.
Make sure to reset() this diagram if you don't want the classes already on this model.
#
(void)
actualizar_graph()
Joint Graph Management
Update a joint.Graph instance with the new cells.
#
(boolean)
same_elts(diag)
Comparing Diagrams
Two diagram are equivalents if has the same classes and links with the same names and attributes.