<commit_before>package org.ugate.gui.view;

import javafx.animation.Timeline;
import javafx.application.Platform;
import javafx.geometry.Insets;
import javafx.scene.Node;
import javafx.scene.control.Button;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.HBox;
import javafx.scene.layout.VBox;
import javafx.util.Duration;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.ugate.UGateEvent;
import org.ugate.UGateKeeper;
import org.ugate.UGateListener;
import org.ugate.gui.ControlBar;
import org.ugate.gui.GuiUtil;
import org.ugate.gui.components.StatusIcon;
import org.ugate.gui.components.UGateComboBox;
import org.ugate.gui.components.UGateCtrlBox;
import org.ugate.gui.components.UGateToggleSwitchBox;
import org.ugate.resources.RS;
import org.ugate.resources.RS.KEY;
import org.ugate.service.ServiceProvider;
import org.ugate.service.entity.ActorType;
import org.ugate.service.entity.Command;
import org.ugate.service.entity.Model;
import org.ugate.service.entity.jpa.Actor;

public class HostConnection extends VBox {
	
	private static final Logger log = LoggerFactory.getLogger(HostConnection.class);
	public final UGateComboBox<String> port;
	public final UGateComboBox<Integer> baud;
	public final UGateCtrlBox<Actor, Model, Void> hostAddress;
	public final UGateToggleSwitchBox<Actor> wirelessOnAtStartSwitch;
	public final Button wirelessBtn;
	public final UGateCtrlBox<Actor, Model, Void> webHost;
	public final UGateCtrlBox<Actor, Model, Void> webPort;
	public final UGateCtrlBox<Actor, Model, Void> webHostLocal;
	public final UGateCtrlBox<Actor, Model, Void> webPortLocal;
	public final UGateToggleSwitchBox<Actor> webOnAtStartSwitch;
	public final Button webBtn;
	public final ControlBar cb;

	/**
	 * Creates the wireless connection view
	 */
	public HostConnection(final ControlBar controlBar) {
		super(20);
		this.cb = controlBar;
		
		final StatusIcon wirelessIcon = new StatusIcon(
				RS.imgView(RS.IMG_WIRELESS_ICON), GuiUtil.COLOR_OFF);
		cb.addServiceBehavior(wirelessIcon, null, ServiceProvider.Type.WEB, KEY.WIRELESS_CONNECT_DESC);
		final StatusIcon webIcon = new StatusIcon(
				RS.imgView(RS.IMG_WEB_ICON), GuiUtil.COLOR_OFF);
		cb.addServiceBehavior(webIcon, null, ServiceProvider.Type.WEB, KEY.WIRELESS_WEB_START_STOP_DESC);
		port = createComPortBox();
	    baud = createBaudRateBox();
	    hostAddress = new UGateCtrlBox<>(cb.getActorPA(), ActorType.COM_ADDY, 
				UGateCtrlBox.Type.TEXT, RS.rbLabel(KEY.WIRELESS_HOST_ADDY), null);
	    controlBar.addHelpTextTrigger(hostAddress, RS.rbLabel(KEY.WIRELESS_HOST_ADDY_DESC));

	    listenForAppEvents(wirelessIcon, webIcon);
		
	    webHost = new UGateCtrlBox<>(cb.getActorPA(), ActorType.WEB_HOST, 
				UGateCtrlBox.Type.TEXT, RS.rbLabel(KEY.WEB_HOST), null);
	    controlBar.addHelpTextTrigger(webHost, RS.rbLabel(KEY.WEB_HOST_DESC));
	    webPort = new UGateCtrlBox<>(cb.getActorPA(), ActorType.WEB_PORT, 
				UGateCtrlBox.Type.TEXT, RS.rbLabel(KEY.WEB_PORT), null);
	    controlBar.addHelpTextTrigger(webPort, RS.rbLabel(KEY.WEB_PORT_DESC));
	    webHostLocal = new UGateCtrlBox<>(cb.getActorPA(), ActorType.WEB_HOST_LOCAL, 
				UGateCtrlBox.Type.TEXT, RS.rbLabel(KEY.WEB_HOST_LOCAL), null);
	    controlBar.addHelpTextTrigger(webHostLocal, RS.rbLabel(KEY.WEB_HOST_LOCAL_DESC));
	    webPortLocal = new UGateCtrlBox<>(cb.getActorPA(), ActorType.WEB_PORT_LOCAL, 
				UGateCtrlBox.Type.TEXT, RS.rbLabel(KEY.WEB_PORT_LOCAL), null);
	    controlBar.addHelpTextTrigger(webPortLocal, RS.rbLabel(KEY.WEB_PORT_LOCAL_DESC));
		
		final HBox wirelessBtnView = new HBox();
		wirelessOnAtStartSwitch = new UGateToggleSwitchBox<>(
				controlBar.getActorPA(), ActorType.COM_ON_AT_APP_STARTUP, null,<commit_msg>Corrected connection icon click to connect to local wireless versus web<commit_after>package org.ugate.gui.view;

import javafx.animation.Timeline;
import javafx.application.Platform;
import javafx.geometry.Insets;
import javafx.scene.Node;
import javafx.scene.control.Button;
import javafx.scene.layout.GridPane;
import javafx.scene.layout.HBox;
import javafx.scene.layout.VBox;
import javafx.util.Duration;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.ugate.UGateEvent;
import org.ugate.UGateKeeper;
import org.ugate.UGateListener;
import org.ugate.gui.ControlBar;
import org.ugate.gui.GuiUtil;
import org.ugate.gui.components.StatusIcon;
import org.ugate.gui.components.UGateComboBox;
import org.ugate.gui.components.UGateCtrlBox;
import org.ugate.gui.components.UGateToggleSwitchBox;
import org.ugate.resources.RS;
import org.ugate.resources.RS.KEY;
import org.ugate.service.ServiceProvider;
import org.ugate.service.entity.ActorType;
import org.ugate.service.entity.Command;
import org.ugate.service.entity.Model;
import org.ugate.service.entity.jpa.Actor;

public class HostConnection extends VBox {
	
	private static final Logger log = LoggerFactory.getLogger(HostConnection.class);
	public final UGateComboBox<String> port;
	public final UGateComboBox<Integer> baud;
	public final UGateCtrlBox<Actor, Model, Void> hostAddress;
	public final UGateToggleSwitchBox<Actor> wirelessOnAtStartSwitch;
	public final Button wirelessBtn;
	public final UGateCtrlBox<Actor, Model, Void> webHost;
	public final UGateCtrlBox<Actor, Model, Void> webPort;
	public final UGateCtrlBox<Actor, Model, Void> webHostLocal;
	public final UGateCtrlBox<Actor, Model, Void> webPortLocal;
	public final UGateToggleSwitchBox<Actor> webOnAtStartSwitch;
	public final Button webBtn;
	public final ControlBar cb;

	/**
	 * Creates the wireless connection view
	 */
	public HostConnection(final ControlBar controlBar) {
		super(20);
		this.cb = controlBar;
		
		final StatusIcon wirelessIcon = new StatusIcon(
				RS.imgView(RS.IMG_WIRELESS_ICON), GuiUtil.COLOR_OFF);
		cb.addServiceBehavior(wirelessIcon, null, ServiceProvider.Type.WIRELESS, KEY.WIRELESS_CONNECT_DESC);
		final StatusIcon webIcon = new StatusIcon(
				RS.imgView(RS.IMG_WEB_ICON), GuiUtil.COLOR_OFF);
		cb.addServiceBehavior(webIcon, null, ServiceProvider.Type.WEB, KEY.WIRELESS_WEB_START_STOP_DESC);
		port = createComPortBox();
	    baud = createBaudRateBox();
	    hostAddress = new UGateCtrlBox<>(cb.getActorPA(), ActorType.COM_ADDY, 
				UGateCtrlBox.Type.TEXT, RS.rbLabel(KEY.WIRELESS_HOST_ADDY), null);
	    controlBar.addHelpTextTrigger(hostAddress, RS.rbLabel(KEY.WIRELESS_HOST_ADDY_DESC));

	    listenForAppEvents(wirelessIcon, webIcon);
		
	    webHost = new UGateCtrlBox<>(cb.getActorPA(), ActorType.WEB_HOST, 
				UGateCtrlBox.Type.TEXT, RS.rbLabel(KEY.WEB_HOST), null);
	    controlBar.addHelpTextTrigger(webHost, RS.rbLabel(KEY.WEB_HOST_DESC));
	    webPort = new UGateCtrlBox<>(cb.getActorPA(), ActorType.WEB_PORT, 
				UGateCtrlBox.Type.TEXT, RS.rbLabel(KEY.WEB_PORT), null);
	    controlBar.addHelpTextTrigger(webPort, RS.rbLabel(KEY.WEB_PORT_DESC));
	    webHostLocal = new UGateCtrlBox<>(cb.getActorPA(), ActorType.WEB_HOST_LOCAL, 
				UGateCtrlBox.Type.TEXT, RS.rbLabel(KEY.WEB_HOST_LOCAL), null);
	    controlBar.addHelpTextTrigger(webHostLocal, RS.rbLabel(KEY.WEB_HOST_LOCAL_DESC));
	    webPortLocal = new UGateCtrlBox<>(cb.getActorPA(), ActorType.WEB_PORT_LOCAL, 
				UGateCtrlBox.Type.TEXT, RS.rbLabel(KEY.WEB_PORT_LOCAL), null);
	    controlBar.addHelpTextTrigger(webPortLocal, RS.rbLabel(KEY.WEB_PORT_LOCAL_DESC));
		
		final HBox wirelessBtnView = new HBox();
		wirelessOnAtStartSwitch = new UGateToggleSwitchBox<>(
				controlBar.getActorPA(), ActorType.COM_ON_AT_APP_STARTUP, null,
{'fraction_non_alphanumeric': 0.10374716628883851, 'fraction_numerical': 0.0010668089078543807, 'mean_word_length': 5.899724011039559, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 33, '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': '6883972', 'n_tokens_mistral': 2681, 'n_tokens_neox': 2527, 'n_words': 451}