<commit_before>package com.delormeloic.generator.view.slidesforms;

import com.delormeloic.generator.model.slides.SlideWithTitle;
import com.delormeloic.generator.view.converters.FontStringConverter;
import com.delormeloic.generator.view.helpers.FontsHelper;
import com.delormeloic.generator.view.helpers.GridPaneHelper;
import com.delormeloic.generator.view.helpers.TextHelper;

import javafx.scene.Node;
import javafx.scene.control.CheckBox;
import javafx.scene.control.ComboBox;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
import javafx.scene.text.Font;

/**
 * This class represents a slide with a title form.
 * 
 * @author <NAME>
 * @since 1.0.0
 */
public class SlideWithTitleForm extends SlideForm
{
	/**
	 * Create a slide with a title form.
	 * 
	 * @param slideWithTitle
	 *            The slide with a title.
	 */
	public SlideWithTitleForm(SlideWithTitle slideWithTitle)
	{
		super(slideWithTitle);
	}

	/**
	 * @see com.delormeloic.generator.view.slidesforms.IFormable#toForm()
	 */
	@Override
	public Node toForm()
	{
		final SlideWithTitle slideWithTitle = (SlideWithTitle) this.slide;

		final TextField nameTextField = new TextField();
		final CheckBox headerCheckBox = new CheckBox();
		final CheckBox footerCheckBox = new CheckBox();
		final TextField titleTextField = new TextField();
		final ComboBox<Font> titleFontComboBox = new ComboBox<Font>();

		titleFontComboBox.getItems().addAll(FontsHelper.getAllAvailableFonts());
		titleFontComboBox.setConverter(new FontStringConverter());

		nameTextField.textProperty().bindBidirectional(slideWithTitle.getNameProperty());
		headerCheckBox.selectedProperty().bindBidirectional(slideWithTitle.getHeaderProperty());
		footerCheckBox.selectedProperty().bindBidirectional(slideWithTitle.getFooterProperty());
		titleTextField.textProperty().bindBidirectional(slideWithTitle.getTitleProperty());
		titleFontComboBox.valueProperty().bindBidirectional(slideWithTitle.getTitleFontProperty());

		final Node[] nameField = new Node[] { new Label(TextHelper.getText("slideWithTitleFormNameField")), nameTextField };
		final Node[] headerField = new Node[] { new Label(TextHelper.getText("slideWithTitleFormHeaderField")), headerCheckBox };
		final Node[] footerField = new Node[] { new Label(TextHelper.getText("slideWithTitleFormFooterField")), footerCheckBox };
		final Node[] titleField = new Node[] { new Label(TextHelper.getText("slideWithTitleFormTitleField")), titleTextField };
		final Node[] titleFontField = new Node[] { new Label(TextHelper.getText("slideWithTitleFormTitleFontField")), titleFontComboBox };

		return GridPaneHelper.buildGridPane(new Node[][] { nameField, GridPaneHelper.getSeparators(2), headerField, footerField, GridPaneHelper.getSeparators(2), titleField, titleFontField });
	}
}<commit_msg>[update] improve visual layout by using titled pane instead of gridpane<commit_after>package com.delormeloic.generator.view.slidesforms;

import com.delormeloic.generator.model.slides.SlideWithTitle;
import com.delormeloic.generator.view.converters.FontStringConverter;
import com.delormeloic.generator.view.helpers.FontsHelper;
import com.delormeloic.generator.view.helpers.FormBuilderHelper;
import com.delormeloic.generator.view.helpers.TextHelper;

import javafx.scene.Node;
import javafx.scene.control.CheckBox;
import javafx.scene.control.ComboBox;
import javafx.scene.control.TextField;
import javafx.scene.control.TitledPane;
import javafx.scene.text.Font;

/**
 * This class represents a slide with a title form.
 * 
 * @author <NAME>
 * @since 1.0.0
 */
public class SlideWithTitleForm extends SlideForm
{
	/**
	 * Create a slide with a title form.
	 * 
	 * @param slideWithTitle
	 *            The slide with a title.
	 */
	public SlideWithTitleForm(SlideWithTitle slideWithTitle)
	{
		super(slideWithTitle);
	}

	/**
	 * @see com.delormeloic.generator.view.slidesforms.IFormable#toForm()
	 */
	@Override
	public Node toForm()
	{
		final SlideWithTitle slideWithTitle = (SlideWithTitle) this.slide;

		final TextField nameTextField = new TextField();
		nameTextField.textProperty().bindBidirectional(slideWithTitle.getNameProperty());

		final CheckBox headerCheckBox = new CheckBox();
		headerCheckBox.selectedProperty().bindBidirectional(slideWithTitle.getHeaderProperty());

		final CheckBox footerCheckBox = new CheckBox();
		footerCheckBox.selectedProperty().bindBidirectional(slideWithTitle.getFooterProperty());

		final TextField titleTextField = new TextField();
		titleTextField.textProperty().bindBidirectional(slideWithTitle.getTitleProperty());

		final ComboBox<Font> titleFontComboBox = new ComboBox<Font>(FontsHelper.getAllAvailableFonts());
		titleFontComboBox.setConverter(new FontStringConverter());
		titleFontComboBox.valueProperty().bindBidirectional(slideWithTitle.getTitleFontProperty());

		final TitledPane nameTitledPane = new TitledPane(TextHelper.getText("slideWithTitleFormNameTitledPane"), nameTextField);
		nameTitledPane.setCollapsible(false);
		final TitledPane headerTitledPane = new TitledPane(TextHelper.getText("slideWithTitleFormHeaderTitledPane"), headerCheckBox);
		headerTitledPane.setCollapsible(false);
		final TitledPane footerTitledPane = new TitledPane(TextHelper.getText("slideWithTitleFormFooterTitledPane"), footerCheckBox);
		footerTitledPane.setCollapsible(false);
		final TitledPane titleTextTitledPane = new TitledPane(TextHelper.getText("slideWithTitleFormTitleTextTitledPane"), titleTextField);
		titleTextTitledPane.setCollapsible(false);
		final TitledPane titleTextFontTitledPane = new TitledPane(TextHelper.getText("slideWithTitleFormTitleTextFontTitledPane"), titleFontComboBox);
		titleTextFontTitledPane.setCollapsible(false);

		final TitledPane generalInformationTitledPane = FormBuilderHelper.buildTitledPane(TextHelper.getText("slideWithTitleFormGeneralInformationTitledPane"), new TitledPane[] { nameTitledPane, headerTitledPane, footerTitledPane });
		final TitledPane titleTitledPane = FormBuilderHelper.buildTitledPane(TextHelper.getText("slideWithTitleFormTitleTitledPane"), new TitledPane[] { titleTextTitledPane, titleTextFontTitledPane });

		return FormBuilderHelper.buildTitledPane(TextHelper.getText("dataForm"), new TitledPane[] { generalInformationTitledPane, titleTitledPane });
	}
}
{'fraction_non_alphanumeric': 0.10195641800540799, 'fraction_numerical': 0.0012724669953873072, 'mean_word_length': 6.969581749049429, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '2016458', 'n_tokens_mistral': 1902, 'n_tokens_neox': 1799, 'n_words': 325}