public void setRelation(Relation relation) {
    this.relation = relation;

    if (relation != null) {
      switch (relation.getType()) {
        case simple_relation:
          this.initForSimpleRelation();
          break;
        case chain_relation:
          this.initForChainRelation();
          break;
      }
    } else {
      removeAllChildren();
    }
  }
  public RelationEditing(Relation relation, ContentPanel contentPanel, Editor editor) {
    this.relation = relation;
    this.contentPanel = contentPanel;
    this.editor = editor;

    this.setId("relationEditing");
    this.setColor(Color.ORANGE);
    this.setPreferredSize(new Size(100, 100));

    this.addRelation(
        new ChainRelation(
            this, LayoutConstant.ORIENTATION_VERTICAL, LayoutConstant.ALIGNMENT_MIN, 20));

    if (relation != null) {
      switch (relation.getType()) {
        case simple_relation:
          this.initForSimpleRelation();
          break;
        case chain_relation:
          break;
      }
    }
  }