Class: ORMDiagram
Defined in: | web-src/coffee/model/orm/ormdiagram.coffee |
Inherits: | model.Diagram |
Overview
An ER diagram representation.
Instance Method Summary
- # (void) get_factory()
- # (void) set_factory(factory)
- # (void) get_graph()
- # (void) set_graph(graph)
- # (void) get_clases()
- # (void) get_links()
- # (void) get_clase(nombre)
- # (void) find_class_by_name(name)
- # (void) find_class_by_classid(classid)
-
#
(?)
find_IsA_with_parent(parentclass)
Find a generalization that contains the given parent
generalization.
- # (void) add_generalization(class_parent, class_childs, disjoint = false, covering = false) Add a Generalization link.
- # (void) add_generalization_objs(class_parent, class_child, disjoint = false, covering = false) Add a Generalization link.
- # (void) add_association(class_a_id, class_b_id, name = null, mult = null, roles = null)
- # (void) add_association_class(class_a_id, class_b_id, name, mult = null, roles = null)
-
#
(?)
add_class(hash_data)
Hash Data
name
(mandatory)attribs
(optional)methods
(optional) - # (void) agregar_clase(clase)
- # (void) delete_class(c)
- # (?) 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) rename_class(classid, name)
- # (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) 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) 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) actualizar_graph() Update a joint.Graph instance with the new cells.
- # (void) to_json() Return a JSON representing the Diagram.
- # (void) import_json(json) Import all classes and associations from a JSON object.
Constructor Details
#
(void)
constructor(graph = null)
Instance Method Details
#
(void)
get_factory()
#
(void)
set_factory(factory)
#
(void)
get_graph()
#
(void)
set_graph(graph)
#
(void)
get_clases()
#
(void)
get_links()
#
(void)
get_clase(nombre)
#
(void)
find_class_by_name(name)
#
(void)
find_class_by_classid(classid)
#
(?)
find_IsA_with_parent(parentclass)
Find a generalization that contains the given parent
generalization.
#
(void)
add_generalization(class_parent, class_childs, disjoint = false, covering = 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.
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)
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)
add_association(class_a_id, class_b_id, name = null, mult = null, roles = null)
#
(void)
add_association_class(class_a_id, class_b_id, name, mult = null, roles = null)
#
(?)
add_class(hash_data)
Hash Data
name
(mandatory)attribs
(optional)methods
(optional)
Examples:
Adding a class
diagram_instance.add_class({name: "class A"})
diagram_instance.add_class({name: "class B", ["attrib1", "attrib2"], ["method1", "method2"]})
#
(void)
agregar_clase(clase)
#
(void)
delete_class(c)
#
(?)
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)
rename_class(classid, name)
#
(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)
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)
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)
actualizar_graph()
Update a joint.Graph instance with the new cells.
#
(void)
to_json()
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.