package com.knecon.fforesight.service.viewerdoc.layers;

import java.awt.Color;
import java.util.List;

import com.knecon.fforesight.service.viewerdoc.LayerIdentifier;
import com.knecon.fforesight.service.viewerdoc.model.Standard14EmbeddableFont;
import com.knecon.fforesight.service.viewerdoc.model.Visualizations;

import lombok.Getter;

public class LayoutDebugLayerConfig extends AbstractLayerGroup {

    @Getter
    public final LayerIdentifier groupIdentifier = LayerIdentifier.KNECON_LAYOUT_DEBUG;

    public static final LayerGroup CONFIG_INSTANCE = new LayoutDebugLayerConfig();

    protected static final Standard14EmbeddableFont FONT = Standard14EmbeddableFont.helvetica();

    public static final float LINE_WIDTH = 0.5f;

    protected static final Color WORDS_COLOR = new Color(68, 84, 147);
    protected static final Color LINES_COLOR = new Color(152, 45, 179);
    protected static final Color TOC_COLOR = new Color(33, 159, 144);
    protected static final Color ZONES_COLOR = new Color(131, 38, 38);

    protected static final Color RULINGS_COLOR = new Color(21, 221, 174);
    protected static final Color TABLE_RULINGS_COLOR = new Color(255, 175, 175);
    protected static final Color HEADER_RULING_COLOR = new Color(171, 131, 6);
    protected static final Color FOOTER_RULING_COLOR = new Color(106, 82, 2);
    protected static final Color UNDERLINE_RULING_COLOR = new Color(6, 39, 171);
    protected static final Color STRIKETROUGH_RULING_COLOR = new Color(171, 6, 6);

    protected static final Color HEADLINE_COLOR = new Color(162, 56, 56);

    protected static final Color CELLS_COLOR = new Color(31, 214, 27);
    protected static final Color OUTLINE_OBJECT_COLOR = new Color(214, 27, 183);

    protected static final Color MAIN_BODY_COLOR = new Color(171, 131, 6);
    protected static final Color MARKED_CONTENT_COLOR = new Color(171, 131, 6);

    protected static final List<Color> ROTATING_CHARACTER_COLOR = List.of(new Color(255, 87, 51),
                                                                          new Color(255, 195, 0),
                                                                          new Color(76, 175, 80),
                                                                          new Color(33, 150, 243),
                                                                          new Color(155, 89, 182),
                                                                          new Color(233, 30, 99),
                                                                          new Color(0, 188, 212),
                                                                          new Color(121, 85, 72));

    protected final Visualizations words = Visualizations.builder().layer(LayerIdentifier.WORDS).build();
    protected final Visualizations lines = Visualizations.builder().layer(LayerIdentifier.LINES).build();
    protected final Visualizations zones = Visualizations.builder().layer(LayerIdentifier.ZONES).visibleByDefault(true).build();
    protected final Visualizations mainBody = Visualizations.builder().layer(LayerIdentifier.MAIN_BODY).build();
    protected final Visualizations clean_rulings = Visualizations.builder().layer(LayerIdentifier.CLEAN_RULINGS).build();
    protected final Visualizations rulings = Visualizations.builder().layer(LayerIdentifier.RULINGS).build();
    protected final Visualizations cells = Visualizations.builder().layer(LayerIdentifier.CELLS).build();
    protected final Visualizations markedContent = Visualizations.builder().layer(LayerIdentifier.MARKED_CONTENT).build();
    protected final Visualizations neighbours = Visualizations.builder().layer(LayerIdentifier.NEIGHBOURS).build();
    protected final Visualizations characters = Visualizations.builder().layer(LayerIdentifier.CHARACTERS).build();
    protected final Visualizations outlineObjects = Visualizations.builder().layer(LayerIdentifier.OUTLINE_OBJECTS).build();
    protected final Visualizations sentences = Visualizations.builder().layer(LayerIdentifier.SENTENCES).build();
    protected final Visualizations tocPages = Visualizations.builder().layer(LayerIdentifier.TOC_PAGES).build();
    protected final Visualizations tocBlocks = Visualizations.builder().layer(LayerIdentifier.TOC_BLOCKS).build();
    protected final Visualizations listIdentifiers = Visualizations.builder().layer(LayerIdentifier.LIST_IDENTIFIERS).build();
    protected final Visualizations outlineHeadlines = Visualizations.builder().layer(LayerIdentifier.OUTLINE_HEADLINES).build();

    public List<Visualizations> getVisualizations() {

        return List.of(characters, //
                       neighbours,//
                       words, //
                       lines, //
                       sentences, //
                       zones, //
                       rulings, //
                       clean_rulings, //
                       cells, //
                       mainBody, //
                       markedContent, //
                       outlineObjects, //
                       outlineHeadlines, //
                       tocPages, //
                       tocBlocks, //
                       listIdentifiers //
        );
    }

}
