Ejemplo n.º 1
0
  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();
    }
  }
Ejemplo n.º 2
0
  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;
      }
    }
  }