package at.fos.ermodel.gui;

import javafx.scene.canvas.GraphicsContext;

import java.io.Serial;


public abstract class Graphic_RS_Main_Elem
        extends Graphic_Figure_Elem
        implements U3 {
    @Serial
    private static final long serialVersionUID = 1L;
    protected boolean createRelation;
    protected String relationPraefix;
    protected String relationName;
    protected boolean createInserts;
    protected long numberRowsToInsert = 1L;


    public Graphic_RS_Main_Elem(GraphicsContext gc, String name, long elementID) {
        super(gc, name, elementID);
        this.relationName = this.name.toLowerCase();
        this.relationName = T3.replaceSpecialChars(this.relationName);
        this.relationPraefix = this.relationName.charAt(0) + "_";
        this.createInserts = true;
    }


    protected void changeName(String name) {
        super.changeName(name);

        this.relationName = T3.replaceSpecialChars(name.toLowerCase());
        this.relationPraefix = this.relationName.charAt(0) + "_";
    }


    public boolean getCreateRelation() {
        return this.createRelation;
    }


    public void setCreateRelation(boolean createRelation) {
        this.createRelation = createRelation;
    }


    public String getRelationPraefix() {
        return this.relationPraefix;
    }


    public void setRelationPraefix(String relationPraefix) {
        this.relationPraefix = relationPraefix;
    }


    public String getRelationName() {
        return this.relationName;
    }


    public void setRelationName(String relationName) {
        this.relationName = relationName;
    }


    public boolean getCreateInserts() {
        return this.createInserts;
    }


    public void setCreateInserts(boolean createInserts) {
        this.createInserts = createInserts;
    }


    public long getNumberRowsToInsert() {
        return this.numberRowsToInsert;
    }


    public void setNumberRowsToInsert(long numberRowsToInsert) {
        this.numberRowsToInsert = numberRowsToInsert;
    }


    public String sdfsdfsd32234243() {
        return super.sdfsdfsd32234243();
    }
}


