/*    */
package org.ui.editors.code;
/*    */
/*    */

import org.renderer.PostProcessConfig;

import javax.swing.*;
import java.awt.*;

/*    */
/*    */
/*    */
/*    */
/*    */
/*    */
/*    */
/*    */
/*    */
/*    */
/*    */
/*    */
/*    */
/*    */
/*    */
/*    */
/*    */
/*    */
/*    */
/*    */ public class GraphicsConfig
        /*    */ {
    /*    */   private Box base;
    private JLabel title;
    private JCheckBox dof;
    private JCheckBox fxaa;
    private JCheckBox grain;
    private PostProcessConfig postProcessConfig;

    public GraphicsConfig(PostProcessConfig postProcessConfig) {
        this.postProcessConfig = postProcessConfig;
    }


    public final void open() {
        this.base = Box.createVerticalBox();


        this.title = new JLabel("Settings");

        this.title.setFont(new Font("Dialog", 0, 24));

        this.title.setBorder(BorderFactory.createEmptyBorder(0, 0, 8, 0));


        this.fxaa = new JCheckBox("Toggle Fast approXimate Anti Aliasing");

        this.fxaa.setSelected(this.postProcessConfig.isFilterFXAA());

        this.fxaa.addActionListener(e -> this.postProcessConfig.setFilterFXAA(this.fxaa.isSelected()));


        this.dof = new JCheckBox("Toggle Depth of Field");

        this.dof.setSelected(this.postProcessConfig.isFilterDoF());

        this.dof.addActionListener(e -> this.postProcessConfig.setFilterDoF(this.dof.isSelected()));


        this.grain = new JCheckBox("Toggle Film Grain");

        this.grain.setSelected(this.postProcessConfig.isFilterGrain());

        this.grain.addActionListener(e -> this.postProcessConfig.setFilterGrain(this.grain.isSelected()));


        this.base.add(this.title);
        this.base.add(this.fxaa);
        this.base.add(this.grain);
        this.base.add(this.dof);


        JOptionPane.showConfirmDialog(null, this.base, "RTX-GYTEBOT - Settings", 0);
    }
}
