<commit_before>package imageselector;

import imageselector.util.ScaleImage;
import java.io.File;
import java.util.ResourceBundle;
import javafx.geometry.Pos;
import javafx.scene.control.Button;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.layout.HBox;
import javafx.scene.layout.StackPane;
import javafx.scene.layout.VBox;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;
import javafx.scene.text.Text;
import javafx.scene.text.TextAlignment;
import javafx.stage.FileChooser;
import javafx.stage.Stage;

/**
 * Creates a visual interface for selecting and uploading an image.
 * Includes a preview of the selected image, and a UI for a fileChooser.
 * 
 * Create an images folder in your src folder and add selectable images there.
 * 
 * @author <NAME>
 *
 */
public class ImageSelector extends VBox {
    private ImageView preview;
    private String filePath;
    private FileChooser fileChooser;
    
    private double previewImageHeight = 100;
    private double previewImageWidth = 100;
    private static final int LOAD_BUTTON_WIDTH = 65;
    private static final int FILE_DISPLAY_WIDTH = 150;
    private static final int FILE_DISPLAY_HEIGHT = 24;
    private static final int PADDING = 10;
    private static final String NOT_AVAILABLE = "imageselector/img_not_available.png";
    private static final String SELECTOR_RESOURCES = "imageselector/SelectorText.properties";
    
    /**
     * Creates an ImageSelector object.
     * 
     * @param stage the stage that the application is displayed on.
     * This is required to display an open-file dialog window.
     */
    public ImageSelector (Stage stage) {
        super(2*PADDING);
        setAlignment(Pos.CENTER);

        ResourceBundle myResources = ResourceBundle.getBundle(SELECTOR_RESOURCES);
        
        HBox fileSelection = new HBox(PADDING);
        StackPane textDisplay = new StackPane();

        Text fileDisplay = new Text(myResources.getString("filePrompt"));
        Rectangle textBox = new Rectangle(FILE_DISPLAY_WIDTH, FILE_DISPLAY_HEIGHT);
        textBox.setFill(Color.WHITE);

        filePath = NOT_AVAILABLE;
        preview = new ImageView(new Image(filePath));
<commit_msg>Fixed a dumb stupid bug<commit_after>package imageselector;

import imageselector.util.ScaleImage;
import java.io.File;
import java.util.ResourceBundle;
import javafx.geometry.Pos;
import javafx.scene.control.Button;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.layout.HBox;
import javafx.scene.layout.StackPane;
import javafx.scene.layout.VBox;
import javafx.scene.paint.Color;
import javafx.scene.shape.Rectangle;
import javafx.scene.text.Text;
import javafx.scene.text.TextAlignment;
import javafx.stage.FileChooser;
import javafx.stage.Stage;

/**
 * Creates a visual interface for selecting and uploading an image.
 * Includes a preview of the selected image, and a UI for a fileChooser.
 * 
 * Create an images folder in your src folder and add selectable images there.
 * 
 * @author <NAME>
 *
 */
public class ImageSelector extends VBox {
    private ImageView preview;
    private String filePath;
    private FileChooser fileChooser;
    
    private double previewImageHeight = 100;
    private double previewImageWidth = 100;
    private static final int LOAD_BUTTON_WIDTH = 65;
    private static final int FILE_DISPLAY_WIDTH = 150;
    private static final int FILE_DISPLAY_HEIGHT = 24;
    private static final int PADDING = 10;
    private static final String NOT_AVAILABLE = "imageselector/img_not_available.png";
    private static final String SELECTOR_RESOURCES = "imageselector/SelectorText";
    
    /**
     * Creates an ImageSelector object.
     * 
     * @param stage the stage that the application is displayed on.
     * This is required to display an open-file dialog window.
     */
    public ImageSelector (Stage stage) {
        super(2*PADDING);
        setAlignment(Pos.CENTER);

        ResourceBundle myResources = ResourceBundle.getBundle(SELECTOR_RESOURCES);
        
        HBox fileSelection = new HBox(PADDING);
        StackPane textDisplay = new StackPane();

        Text fileDisplay = new Text(myResources.getString("filePrompt"));
        Rectangle textBox = new Rectangle(FILE_DISPLAY_WIDTH, FILE_DISPLAY_HEIGHT);
        textBox.setFill(Color.WHITE);

        filePath = NOT_AVAILABLE;
        preview = new ImageView(new Image(filePath));

{'fraction_non_alphanumeric': 0.07757657053431702, 'fraction_numerical': 0.007154035323049408, 'mean_word_length': 3.719409282700422, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '1440517', 'n_tokens_mistral': 1321, 'n_tokens_neox': 1254, 'n_words': 376}