<commit_before>package template;

import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.Parent;
import javafx.scene.control.Button;

import java.io.File;
import java.net.URL;
import java.util.List;
import java.util.ResourceBundle;

import javafx.scene.control.Label;
import javafx.scene.control.RadioButton;
import javafx.scene.control.ToggleGroup;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.stage.DirectoryChooser;
import javafx.stage.FileChooser;
import template.ControlledScreen;
import textfile.textFileController;

/**
 * @author Ben
 * This class controls the options screen. It handles creating settings for the operating system, date tolerance,
 * input and output conventions needed for rename and delete functions
 */
public class optionsController implements Initializable, ControlledScreen {
    ScreensController myController;

    @FXML
    public ToggleGroup operatingSystemButtons;

    @FXML
    private Button renameBtn;
    @FXML
    private ImageView renameBtnImg;

    @FXML
    private Label cwdLabel; //current working directory label
    @FXML
    private Button cwdBtn;

    @FXML
    private Label nciLabel; //naming convention input label
    @FXML
    private Button nciBtn;

    @FXML
    private Label ncoLabel; //naming convention output label
    @FXML
    private Button ncoBtn;

    @FXML
    private Label dtLabel; //date tolerance label
    @FXML
    private Button dtBtn;

    @FXML
    private Button cosBtn; //change operating system button
    @FXML
    private RadioButton windowsBtn; //change operating system to Windows
    @FXML
    private RadioButton macBtn; //change operating system to Mac

    @FXML
    private Button resetBtn; //reset to default button

    @FXML
    private Button helpbtn; //help menu button

    @FXML
    Parent root;

    /**
     *
     * @param screenParent
     * @return void
     * @pre
     * @post
     */
    public void setScreenParent(ScreensController screenParent){
        myController = screenParent;
    }


    public String os, input, output, directory, date;
    public textfile.textFileController sender = new textFileController();


    /**
     *
     * @param event
     * @return void
     * @pre the rename button is selected
     * @post screen2ID is set as the current screen
     */
    @FXML
    public void goToRename(ActionEvent event){
        myController.setScreen(template.ScreensFramework.screen2ID);
    }

    public void goToDelete(ActionEvent event){
        myController.setScreen(template.ScreensFramework.screen4ID);
    }

    //this function does nothing useful with it's parameters, but it is needed for intellij to stop whining

    /**
     * @param url unused
     * @param rb unused
     * @return void
     * @pre
     * @post
     */
    @Override
    public void initialize(URL url, ResourceBundle rb) {
        //collectOptions();
    }

    /**
     * @return os
     * @pre the "change operating system" button has been selected by user
     */
    public void setOperatingSystem(){
        if (windowsBtn.isSelected()){
            os = "W";
            //textfile.textFileController sender = new textFileController();
            sender.setOS(os);
        } else if (macBtn.isSelected())  {
            os = "M";
        }
        else {
            System.out.println("No operating system selected");
            //todo throw
        }
        System.out.println("operatingSystem: " + os);
    }

    /**
     * @return void
     * @pre the "change input" button is selected
     * @post
     */
    public void setInput() {
        input = nciLabel.getText();
        sender.setInput(input);
    }

    /**
     * @return void
     * @pre the "change output" button is selected
     * @post
     */
    public void setOutput() {
        output = ncoLabel.getText();
        sender.setOutput(output);
    }

    public void setDirectory(){
        DirectoryChooser fc = new DirectoryChooser();
        File selectedFolder = fc.showDialog(null);
        if (selectedFolder != null){
                cwdLabel.setText(selectedFolder.toString());
        } else {
            System.out.println("Folder is not valid");<commit_msg>your boi got the fuckin alert system for directory selection set up in this MA<commit_after>package template;

import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.Initializable;
import javafx.scene.Parent;
import javafx.scene.control.*;

import java.io.File;
import java.net.URL;
import java.util.List;
import java.util.ResourceBundle;

import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.stage.DirectoryChooser;
import javafx.stage.FileChooser;
import template.ControlledScreen;
import textfile.textFileController;

/**
 * @author Ben
 * This class controls the options screen. It handles creating settings for the operating system, date tolerance,
 * input and output conventions needed for rename and delete functions
 */
public class optionsController implements Initializable, ControlledScreen {
    ScreensController myController;

    @FXML
    public ToggleGroup operatingSystemButtons;

    @FXML
    private Button renameBtn;
    @FXML
    private ImageView renameBtnImg;

    @FXML
    private Label cwdLabel; //current working directory label
    @FXML
    private Button cwdBtn;

    @FXML
    private Label nciLabel; //naming convention input label
    @FXML
    private Button nciBtn;

    @FXML
    private Label ncoLabel; //naming convention output label
    @FXML
    private Button ncoBtn;

    @FXML
    private Label dtLabel; //date tolerance label
    @FXML
    private Button dtBtn;

    @FXML
    private Button cosBtn; //change operating system button
    @FXML
    private RadioButton windowsBtn; //change operating system to Windows
    @FXML
    private RadioButton macBtn; //change operating system to Mac

    @FXML
    private Button resetBtn; //reset to default button

    @FXML
    private Button helpbtn; //help menu button

    @FXML
    Parent root;

    /**
     *
     * @param screenParent
     * @return void
     * @pre
     * @post
     */
    public void setScreenParent(ScreensController screenParent){
        myController = screenParent;
    }


    public String os, input, output, directory, date;
    public textfile.textFileController sender = new textFileController();


    /**
     *
     * @param event
     * @return void
     * @pre the rename button is selected
     * @post screen2ID is set as the current screen
     */
    @FXML
    public void goToRename(ActionEvent event){
        myController.setScreen(template.ScreensFramework.screen2ID);
    }

    public void goToDelete(ActionEvent event){
        myController.setScreen(template.ScreensFramework.screen4ID);
    }

    //this function does nothing useful with it's parameters, but it is needed for intellij to stop whining

    /**
     * @param url unused
     * @param rb unused
     * @return void
     * @pre
     * @post
     */
    @Override
    public void initialize(URL url, ResourceBundle rb) {
        //collectOptions();
    }

    /**
     * @return os
     * @pre the "change operating system" button has been selected by user
     */
    public void setOperatingSystem(){
        if (windowsBtn.isSelected()){
            os = "W";
            //textfile.textFileController sender = new textFileController();
            sender.setOS(os);
        } else if (macBtn.isSelected())  {
            os = "M";
        }
        else {
            System.out.println("No operating system selected");
            //todo throw
        }
        System.out.println("operatingSystem: " + os);
    }

    /**
     * @return void
     * @pre the "change input" button is selected
     * @post
     */
    public void setInput() {
        input = nciLabel.getText();
        sender.setInput(input);
    }

    /**
     * @return void
     * @pre the "change output" button is selected
     * @post
     */
    public void setOutput() {
        output = ncoLabel.getText();
        sender.setOutput(output);
    }

    public void setDirectory(){
        DirectoryChooser fc = new DirectoryChooser();
        File selectedFolder = fc.showDialog(null);
        if (selectedFolder != null){
                cwdLabel.setText(selectedFolder.toString());
        } else {
            Alert a = new Alert(Alert.AlertType.INFORMATION);
            a.setTitle("mpMe Alert");
            a.setHeaderText("Invalid Directory Selection");
            a.setResizable(true);
            String version = System.getProperty("java.version");
            String content = String.format("Please select a valid directory path", version);
            a.setContentText(content);
            a.showAndWait();
{'fraction_non_alphanumeric': 0.08866213151927438, 'fraction_numerical': 0.0006802721088435374, 'mean_word_length': 2.526989204318273, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '652852', 'n_tokens_mistral': 2462, 'n_tokens_neox': 2380, 'n_words': 737}