<commit_before>package ui.components.pickers;

import backend.resource.TurboLabel;
import javafx.scene.Node;
import javafx.scene.control.Label;
import javafx.scene.control.Tooltip;

// for use with LabelPickerDialog
public class PickerLabel extends TurboLabel {

    private LabelPickerDialog labelPickerDialog;
    private boolean isSelected;
    private boolean isHighlighted;
    private boolean isRemoved;
    private boolean isFaded;

    public PickerLabel(TurboLabel label, LabelPickerDialog labelPickerDialog) {
        super(label.getRepoId(), label.getColour(), label.getActualName());
        this.labelPickerDialog = labelPickerDialog;
        isSelected = false;
        isHighlighted = false;
        isRemoved = false;
    }

    @Override
    public Node getNode() {
        Label label = new Label(getName() + (isSelected ? " ✓" : "")); // add selection tick
        label.getStyleClass().add("labels");
        if (isRemoved) label.getStyleClass().add("labels-removed"); // add strikethrough
        String style = getStyle() + (isHighlighted ? " -fx-border-color: black;" : ""); // add highlight border
        style += (isFaded ? " -fx-opacity: 25%;" : ""); // change opacity if needed
        label.setStyle(style);

        if (getGroup().isPresent()) {
            Tooltip groupTooltip = new Tooltip(getGroup().get());
            label.setTooltip(groupTooltip);
        }

        label.setOnMouseClicked(e -> labelPickerDialog.toggleLabel(getActualName()));
        return label;
    }

    public void setIsSelected(boolean isSelected) {
        this.isSelected = isSelected;
    }

    public boolean isHighlighted() {
        return isHighlighted;
    }

    public void setIsHighlighted(boolean isHighlighted) {
        this.isHighlighted = isHighlighted;
    }

    public boolean isRemoved() {
        return isRemoved;
    }
<commit_msg>added constructor and change opacity for PickerLabel<commit_after>package ui.components.pickers;

import backend.resource.TurboLabel;
import javafx.scene.Node;
import javafx.scene.control.Label;
import javafx.scene.control.Tooltip;

// for use with LabelPickerDialog
public class PickerLabel extends TurboLabel {

    private LabelPickerDialog labelPickerDialog;
    private boolean isSelected;
    private boolean isHighlighted;
    private boolean isRemoved;
    private boolean isFaded;

    public PickerLabel(TurboLabel label, LabelPickerDialog labelPickerDialog) {
        super(label.getRepoId(), label.getColour(), label.getActualName());
        this.labelPickerDialog = labelPickerDialog;
        isSelected = false;
        isHighlighted = false;
        isRemoved = false;
        isFaded = false;
    }

    public PickerLabel(TurboLabel label, LabelPickerDialog labelPickerDialog,
                       boolean isSelected, boolean isHighlighted, boolean isRemoved, boolean isFaded) {
        super(label.getRepoId(), label.getColour(), label.getActualName());
        this.labelPickerDialog = labelPickerDialog;
        this.isSelected = isSelected;
        this.isHighlighted = isHighlighted;
        this.isRemoved = isRemoved;
        this.isFaded = isFaded;
    }

    @Override
    public Node getNode() {
        Label label = new Label(getName() + (isSelected ? " ✓" : "")); // add selection tick
        label.getStyleClass().add("labels");
        if (isRemoved) label.getStyleClass().add("labels-removed"); // add strikethrough
        String style = getStyle() + (isHighlighted ? " -fx-border-color: black;" : ""); // add highlight border
        style += (isFaded ? " -fx-opacity: 40%;" : ""); // change opacity if needed
        label.setStyle(style);

        if (getGroup().isPresent()) {
            Tooltip groupTooltip = new Tooltip(getGroup().get());
            label.setTooltip(groupTooltip);
        }

        label.setOnMouseClicked(e -> labelPickerDialog.toggleLabel(getActualName()));
        return label;
    }

    public void setIsSelected(boolean isSelected) {
        this.isSelected = isSelected;
    }

    public boolean isHighlighted() {
        return isHighlighted;
    }

    public void setIsHighlighted(boolean isHighlighted) {
        this.isHighlighted = isHighlighted;
    }

    public boolean isRemoved() {
        return isRemoved;
    }

{'fraction_non_alphanumeric': 0.10400562192550948, 'fraction_numerical': 0.0009369875849144999, 'mean_word_length': 2.9647168059424325, 'pattern_counts': {'":': 0, '<': 3, '<?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': '5623782', 'n_tokens_mistral': 1201, 'n_tokens_neox': 1170, 'n_words': 274}