<commit_before>/**
  @module ember-flexberry-designer
*/

import Ember from 'ember';

import FdUmlElement from './fd-uml-element';
import { BaseClass } from './fd-uml-class';

/**
  An object that describes a class on the UML diagram.

  @class FdUmlPropertyObject
  @extends FdUmlElement
*/
export default FdUmlElement.extend({
  /**
    The name of the class.

    @property name
    @type String
  */
  name: Ember.computed.alias('primitive.Name.Text'),

  /**
    Stereotype of the class.

    @property stereotype
    @type String
  */
  stereotype: Ember.computed.alias('primitive.StereotypeTxt.Text'),

  /**
    Indicates that the class is in a collapsed state.

    @property collapsed
    @type Boolean
  */
  collapsed: Ember.computed.alias('primitive.Folded'),

  /**
    List of class attributes.

    @property attributes
    @type Array
  */
  attributes: Ember.computed('primitive.AttributesTxt.Text', function() {
    if (!Ember.isEmpty(this.get('primitive.AttributesTxt.Text'))) {
      return this.get('primitive.AttributesTxt.Text').split('\n');
    }

    return [];
  }),

  /**
    List of methods of the class.

    @property methods
    @type Array
  */
  methods: Ember.computed('primitive.MethodsTxt.Text', function() {
    if (!Ember.isEmpty(this.get('primitive.MethodsTxt.Text'))) {
      return this.get('primitive.MethodsTxt.Text').split('\n');
    }

    return [];
  }),

  /**
    See {{#crossLink "FdUmlPrimitive/JointJS:method"}}here{{/crossLink}}.

    @method JointJS
  */
  JointJS() {
    let properties = this.getProperties('id', 'name', 'stereotype', 'size', 'position', 'methods', 'attributes');

    return new PropertyObject(properties);

  },
});

export let PropertyObject = BaseClass.define('flexberry.uml.PropertyObject', {
  attrs: {
    '.flexberry-uml-header-text': {
      'text-decoration': 'underline'
    },
  },
}, {
    markup: [
      '<g class="rotatable">',
      '<g class="scalable">',
      '<rect class="flexberry-uml-header-rect"/><rect class="flexberry-uml-body-rect"/>',
      '</g>',
      '<text class="flexberry-uml-header-text"/><text class="flexberry-uml-body-text"/>',
      '</g>'
    ].join('')<commit_msg>Fix PropertyObject<commit_after>/**
  @module ember-flexberry-designer
*/

import Ember from 'ember';

import { BaseClass } from './fd-uml-class';

import FdUmlElement from './fd-uml-element';

/**
  An object that describes a class on the UML diagram.

  @class FdUmlPropertyObject
  @extends FdUmlElement
*/
export default FdUmlElement.extend({
  /**
    The name of the class.

    @property name
    @type String
  */
  name: Ember.computed.alias('primitive.Name.Text'),

  /**
    Indicates that the class is in a collapsed state.

    @property collapsed
    @type Boolean
  */
  collapsed: Ember.computed.alias('primitive.Name.IsFolded'),

  /**
    List of class attributes.

    @property attributes
    @type Array
  */
  attributes: Ember.computed('primitive.AttributesTxt.Text', function() {
    if (!Ember.isEmpty(this.get('primitive.Prop.Text'))) {
      return this.get('primitive.Prop.Text').split('\n');
    }

    return [];
  }),

  /**
    See {{#crossLink "FdUmlPrimitive/JointJS:method"}}here{{/crossLink}}.

    @method JointJS
  */
  JointJS() {
    let properties = this.getProperties('id', 'name', 'size', 'position', 'attributes');

    return new PropertyObject(properties);

  },
});

export let PropertyObject = BaseClass.define('flexberry.uml.PropertyObject', {
  attrs: {
    '.flexberry-uml-header-text': {
      'text-decoration': 'underline'
    },
  },
}, {
    markup: [
      '<g class="rotatable">',
      '<g class="scalable">',
      '<rect class="flexberry-uml-header-rect"/><rect class="flexberry-uml-body-rect"/>',
      '</g>',
      '<text class="flexberry-uml-header-text"/><text class="flexberry-uml-body-text"/>',
      '</g>'
    ].join('')
{'fraction_non_alphanumeric': 0.17019628099173553, 'fraction_numerical': 0.0, 'mean_word_length': 3.164516129032258, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3222635', 'n_tokens_mistral': 1299, 'n_tokens_neox': 1281, 'n_words': 254}