public Component(String id, ComponentType type) {
    this.id = id;
    this.type = type;
    this.parent = null;
    directChildren = new ArrayList<>();
    attributes = new Attributes(this.id);
    allChildren = new HashMap<>();
    attributeId = new HashMap<>();

    initAttributesId();
  }
  public Component(ComponentType type) {
    this.id = generateCustomId();
    this.type = type;
    this.parent = null;
    directChildren = new ArrayList<>();
    attributes = new Attributes(this.id);
    allChildren = new HashMap<>();
    attributeId = new HashMap<>();

    initAttributesId();
  }
  public Component(Component parent) {
    this.id = generateCustomId();
    this.type = ComponentType.PANEL;
    this.parent = parent;
    directChildren = new ArrayList<>();
    attributes = new Attributes(this.id);
    allChildren = new HashMap<>();
    attributeId = new HashMap<>();

    initAttributesId();
    parent.addChild(this);
  }
  public void setId(String id) {
    id = id.isEmpty() == true ? generateCustomId() : id;

    if (this.parent != null) removeIndexComponent(this.parent, this);

    this.id = id;

    if (this.parent != null) indexComponent(this.parent, this);

    attributes.setId(this.id);
    initAttributesId();
  }