Class: Class

Defined in: web-src/coffee/model/uml/class.coffee
Inherits: model.MyModel

Overview

A Class from our model UML diagram.

Instance Method Summary

Constructor Details

# (void) constructor(name, attrs = [], methods = [])

Parameters:

  • name ( String )
  • attrs ( Array<String> ) Array representing the attributes names.
  • methods ( Array<Strings> ) Array representing the methods names.

Instance Method Details

# (void) get_name()

# (void) set_name(name)

# (void) set_g_name()

Set name for graphical classes. crowd also shows names (without prefixes nor urls)

# (Array<String>) get_attrs()

Retrieve the class attributes.

Returns:

  • ( Array<String> ) — The list of string representing the class attributes.

# (void) get_class_labels()

# (void) add_attr(attr)

Add an attribute string.

Parameters:

  • attr ( String ) The attribute.

# (void) get_methods()

# (void) set_unsatisfiable(bool, csstheme = null)

Set if this class is unsatisfiable. Changing its appearance if csstheme is given.

Parameters:

  • bool ( Boolean ) If it is unsatisfiable or not.
  • csstheme ( CSSTheme ) optional. A csstheme object that if given, will set the appearance of this class depending if it is unsatisfiable. It must have two elements: css_class and css_class_unsatisfiable. Both are CSS templates.

See also:

# (void) set_theme(csstheme)

Set the csstheme to the joint class.

Parameters:

  • csstheme ( Hash ) The theme with two keys: css_class and css_class_unsatisfiale. Both are CSS templates to apply on the SVG elements of the final JointJS attributes.

# (void) create_joint(factory, csstheme = null)

If the joint model wasn't created, make it.

# (void) to_json()

# (void) attach_my_event_handlers()

I attach myself and my event handlers into the joint model for answering myself whenever some important changes happens.

If I have already attached, I don't attach again.

This will attach for:

# (void) attach_on_change_position(object)

Attach an object for notifying whenever the class changes position.

Parameters:

See also:

# (void) notify_change_position(model)

Event handler for notifying all objects attached that the position has been changed.

It will call update_position() to all objects attached.

Parameters:

  • model ( joint.dia.Element ) The Joint element that has recieved the event.

See also:

# (void) same_elts(other)

    Quickly fuzzy find classes, mixins, methods, file:

    Control the navigation frame:

    You can focus and blur the search input: