<commit_before>package org.safehaus.subutai.ui.hadoop.manager.components;

import com.vaadin.server.ThemeResource;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.Embedded;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
import org.safehaus.subutai.api.hadoop.Config;

import java.util.ArrayList;
import java.util.List;
import java.util.UUID;

/**
 * Created by daralbaev on 12.04.14.
 */
public class ClusterNode extends HorizontalLayout {

	public static final int ICON_SIZE = 18;

	protected Config cluster;
	protected Embedded progressButton, startButton, stopButton, restartButton;
	protected List<ClusterNode> slaveNodes;
	protected Label hostname;

	public ClusterNode(Config cluster) {
		this.cluster = cluster;
		slaveNodes = new ArrayList<>();

		setMargin(true);
		setSpacing(true);

		addComponent(getHostnameLabel());
		setComponentAlignment(hostname, Alignment.MIDDLE_CENTER);
		addComponent(getProgressButton());
		setComponentAlignment(progressButton, Alignment.TOP_CENTER);
		addComponent(getStartButton());
		setComponentAlignment(startButton, Alignment.TOP_CENTER);
		addComponent(getStopButton());
		setComponentAlignment(stopButton, Alignment.TOP_CENTER);
		addComponent(getRestartButton());
		setComponentAlignment(restartButton, Alignment.TOP_CENTER);
	}

	private Label getHostnameLabel() {
		hostname = new Label("");
		return hostname;
	}

	public void setHostname(String value) {
		hostname.setValue(value.replace("-", "\\n"));
	}

	private Embedded getProgressButton() {
		progressButton = new Embedded("", new ThemeResource("img/spinner.gif"));
		progressButton.setWidth(ICON_SIZE + 2, Unit.PIXELS);
		progressButton.setHeight(ICON_SIZE + 2, Unit.PIXELS);<commit_msg>hadoop hostnames delimiter is \n<commit_after>package org.safehaus.subutai.ui.hadoop.manager.components;

import com.vaadin.server.ThemeResource;
import com.vaadin.ui.Alignment;
import com.vaadin.ui.Embedded;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
import org.safehaus.subutai.api.hadoop.Config;

import java.util.ArrayList;
import java.util.List;
import java.util.UUID;

/**
 * Created by daralbaev on 12.04.14.
 */
public class ClusterNode extends HorizontalLayout {

	public static final int ICON_SIZE = 18;

	protected Config cluster;
	protected Embedded progressButton, startButton, stopButton, restartButton;
	protected List<ClusterNode> slaveNodes;
	protected Label hostname;

	public ClusterNode(Config cluster) {
		this.cluster = cluster;
		slaveNodes = new ArrayList<>();

		setMargin(true);
		setSpacing(true);

		addComponent(getHostnameLabel());
		setComponentAlignment(hostname, Alignment.MIDDLE_CENTER);
		addComponent(getProgressButton());
		setComponentAlignment(progressButton, Alignment.TOP_CENTER);
		addComponent(getStartButton());
		setComponentAlignment(startButton, Alignment.TOP_CENTER);
		addComponent(getStopButton());
		setComponentAlignment(stopButton, Alignment.TOP_CENTER);
		addComponent(getRestartButton());
		setComponentAlignment(restartButton, Alignment.TOP_CENTER);
	}

	private Label getHostnameLabel() {
		hostname = new Label("");
		return hostname;
	}

	public void setHostname(String value) {
		hostname.setValue(value.replaceAll("-", "\n") + "\n");
	}

	private Embedded getProgressButton() {
		progressButton = new Embedded("", new ThemeResource("img/spinner.gif"));
		progressButton.setWidth(ICON_SIZE + 2, Unit.PIXELS);
		progressButton.setHeight(ICON_SIZE + 2, Unit.PIXELS);
{'fraction_non_alphanumeric': 0.11361014994232987, 'fraction_numerical': 0.0057670126874279125, 'mean_word_length': 6.108606557377049, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '1799972', 'n_tokens_mistral': 1148, 'n_tokens_neox': 1072, 'n_words': 212}