<commit_before>/**
 * @author <NAME>	
 * @version 0.1.0
 */
package edu.millersville.cs.bitsplease.view;

import edu.millersville.cs.bitsplease.PUMLBuilder;
import javafx.application.Application;
import javafx.beans.property.ReadOnlyObjectProperty;
import javafx.scene.control.Toggle;
import javafx.scene.control.ToggleGroup;
import javafx.scene.layout.VBox;
import javafx.scene.text.Font;

/**
 * 
 */
public class ToolBarPane extends VBox {

	private ToggleGroup tbToggleGroup;
	
	/**
	 * 
	 */
	public ToolBarPane() {
		super();
		
		Font.loadFont(PUMLBuilder.class.getResource("fontawesome-webfont.ttf").toExternalForm(), 12);
		
		// TODO: move style code to CSS files
		this.setStyle("-fx-background-color: #444; -fx-padding: 20; -fx-font-family: FontAwesome");
		this.setMaxWidth(100);
		
		tbToggleGroup = new ToggleGroup();
		
		for (EditorAction a : EditorAction.values()) {
			ToolBarButton button = new ToolBarButton("\uf016");
			
			// store action info for event processing
			button.setUserData(a);
			
			button.setToggleGroup(tbToggleGroup);
			
			// add to toolbar
			this.getChildren().add(button);
		}
		
		tbToggleGroup.getToggles().filtered(t -> t.getUserData() == EditorAction.SELECT);
	}
	
	/**
	 * @return selectedToggleProperty object from internal toggle group
	 */<commit_msg>added icons and tooltips to ToolBar buttons<commit_after>/**
 * @author <NAME>	
 * @author <NAME>
 * @version 0.1.0
 */
package edu.millersville.cs.bitsplease.view;

import edu.millersville.cs.bitsplease.PUMLBuilder;
import javafx.application.Application;
import javafx.beans.property.ReadOnlyObjectProperty;
import javafx.scene.control.Toggle;
import javafx.scene.control.ToggleGroup;
import javafx.scene.control.Tooltip;
import javafx.scene.layout.VBox;
import javafx.scene.text.Font;

/**
 * 
 */
public class ToolBarPane extends VBox {

	private ToggleGroup tbToggleGroup;
	
	/**
	 * 
	 */
	public ToolBarPane() {
		super();
		
		Font.loadFont(PUMLBuilder.class.getResource("fontawesome-webfont.ttf").toExternalForm(), 12);
		
		// TODO: move style code to CSS files
		this.setStyle("-fx-background-color: #444; -fx-padding: 20; -fx-font-family: FontAwesome");
		this.setMaxWidth(100);
		
		tbToggleGroup = new ToggleGroup();
		
		//create the button with icon
		ToolBarButton moveSelectButton = new ToolBarButton("\uf047");
		moveSelectButton.setTooltip(new Tooltip("Move/Select"));
		
		ToolBarButton newClassButton = new ToolBarButton("\uf022");
		newClassButton.setTooltip(new Tooltip("New Class"));
		
		ToolBarButton newRelationButton = new ToolBarButton("\uf040");
		newRelationButton.setTooltip(new Tooltip("New Relation"));
		
		ToolBarButton newDependencyButton = new ToolBarButton("\uf062");
		newDependencyButton.setTooltip(new Tooltip("New Dependency"));
		
		ToolBarButton deleteObjectButton = new ToolBarButton("\uf014");
		deleteObjectButton.setTooltip(new Tooltip("Delete Object"));
		
		
		// store action info for event processing
		moveSelectButton.setUserData(EditorAction.SELECT);
		newClassButton.setUserData(EditorAction.CREATE_CLASS);
		newRelationButton.setUserData(EditorAction.CREATE_ASSOCIATION);
		newDependencyButton.setUserData(EditorAction.CREATE_DEPENDENCY);
		deleteObjectButton.setUserData(EditorAction.DELETE);
		
		moveSelectButton.setToggleGroup(tbToggleGroup);
		newClassButton.setToggleGroup(tbToggleGroup);
		newRelationButton.setToggleGroup(tbToggleGroup);
		newDependencyButton.setToggleGroup(tbToggleGroup);
		deleteObjectButton.setToggleGroup(tbToggleGroup);
		
		
		// add to toolbar
		this.getChildren().add(moveSelectButton);
		this.getChildren().add(newClassButton);
		this.getChildren().add(newRelationButton);
		this.getChildren().add(newDependencyButton);
		this.getChildren().add(deleteObjectButton);
				
		tbToggleGroup.getToggles().filtered(t -> t.getUserData() == EditorAction.SELECT);
	}
	
	/**
	 * @return selectedToggleProperty object from internal toggle group
	 */
{'fraction_non_alphanumeric': 0.12242824485648972, 'fraction_numerical': 0.011176022352044705, 'mean_word_length': 4.868852459016393, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 8, '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': '1459166', 'n_tokens_mistral': 1363, 'n_tokens_neox': 1187, 'n_words': 215}