package dev.fyloz.trial.colorrecipesexplorer.xlsx.component.cells;

import dev.fyloz.trial.colorrecipesexplorer.xlsx.component.Document;
import dev.fyloz.trial.colorrecipesexplorer.xlsx.component.cells.styles.IBiggerCell;
import dev.fyloz.trial.colorrecipesexplorer.xlsx.component.cells.styles.IColoredCell;
import dev.fyloz.trial.colorrecipesexplorer.xlsx.component.cells.styles.IFontCell;
import org.apache.poi.ss.usermodel.CellType;
import org.apache.poi.ss.usermodel.IndexedColors;


public class SectionTitleCell extends Cell implements IColoredCell, IBiggerCell, IFontCell {

    private static final int WIDTH = Document.WIDTH;
    private static final int HEIGHT = 2;
    private static final IndexedColors BG_COLOR = IndexedColors.BLACK;
    private static final IndexedColors FONT_COLOR = IndexedColors.WHITE;
    private static final int FONT_HEIGHT = 24;

    private String title;

    public SectionTitleCell(String title) {
        super(CellType.STRING);

        this.title = title.toUpperCase();
    }

    @Override
    public int getWidth() {
        return WIDTH;
    }

    @Override
    public int getHeight() {
        return HEIGHT;
    }

    @Override
    public IndexedColors getBackgroundColor() {
        return BG_COLOR;
    }

    @Override
    public IndexedColors getFontColor() {
        return FONT_COLOR;
    }

    @Override
    public short getFontHeight() {
        return FONT_HEIGHT;
    }

    @Override
    public String getContentText() {
        return title;
    }
}
