<commit_before>package lt.markmerkk.controllers;

import eu.schudt.javafx.controls.calendar.DatePicker;
import java.text.SimpleDateFormat;
import java.util.Collections;
import java.util.Date;
import java.util.Locale;
import javafx.application.Platform;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.event.EventHandler;
import javafx.fxml.FXML;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.PasswordField;
import javafx.scene.control.ProgressIndicator;
import javafx.scene.control.TableView;
import javafx.scene.control.TextArea;
import javafx.scene.control.TextField;
import javafx.scene.input.KeyCode;
import javafx.scene.input.KeyEvent;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.BorderPane;
import javafx.scene.text.Text;
import javafx.stage.Stage;
import lt.markmerkk.jira.IRemote;
import lt.markmerkk.jira.JiraExecutor;
import lt.markmerkk.jira.JiraListener;
import lt.markmerkk.storage2.SimpleLogBuilder;
import lt.markmerkk.storage2.entities.SimpleLog;
import lt.markmerkk.storage2.jobs.DeleteJob;
import lt.markmerkk.storage2.jobs.InsertJob;
import lt.markmerkk.storage2.jobs.QueryListJob;
import lt.markmerkk.utils.LogDisplayController;
import lt.markmerkk.utils.TableDisplayController;
import lt.markmerkk.utils.Utils;
import lt.markmerkk.utils.hourglass.HourGlass;
import lt.markmerkk.utils.hourglass.interfaces.Listener;
import lt.markmerkk.utils.os_formatter.IOSOutput;
import lt.markmerkk.utils.os_formatter.OSXOutput;
import org.joda.time.DateTime;
import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter;

/**
 * Created by mariusmerkevicius on 11/16/15.
 * Represents the main controller to display UI elements and business logic
 */
public class MainController extends BaseController {
  private final HourGlass hourGlass;
  private final DateTimeFormatter shortFormat = DateTimeFormat.forPattern("HH:mm");
  private final DateTimeFormatter longFormat = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm");

  private ObservableList<SimpleLog> logs;
  private DateTime filterDate;

  @FXML TextField inputTo;
  @FXML TextField inputFrom;
  @FXML TextField outputDuration;
  @FXML TextField inputTask;
  @FXML TextArea inputComment;
  @FXML Button buttonClock;
  @FXML Button buttonEnter;
  @FXML TextArea outputLogger;

  @FXML TextField inputHost;
  @FXML TextField inputUsername;
  @FXML PasswordField inputPassword;
  @FXML Button buttonTest;

  @FXML TableView tableLogs;

  @FXML Text totalView;
  @FXML BorderPane footer;
  @FXML ProgressIndicator progressIndicator;
  DatePicker datePicker;

  IRemote remote;
  IOSOutput osOutput;

  public MainController() {
    hourGlass = new HourGlass();
    hourGlass.setListener(hourglassListener);
    osOutput = new OSXOutput();
  }

  @Override
  public void setupController(BaseControllerDelegate listener, Scene scene, Stage primaryStage) {
    super.setupController(listener, scene, primaryStage);
    scene.getStylesheets().add(
        getClass().getResource("/text-field-red-border.css").toExternalForm());

    remote = new JiraExecutor(jiraListener);

    initViewListeners();
    initViews();

    Platform.runLater(() -> {
      progressIndicator.setManaged(false);
      progressIndicator.setVisible(false);
    });
  }

  @Override void onInternalOutput(String message) {
    outputLogger.appendText(message);
  }

  //region Init

  /**
   * Initializes missing views for the controller
   */
  private void initViews() {
    // Initialize the DatePicker for birthday
    datePicker = new DatePicker(Locale.ENGLISH);
    datePicker.setDateFormat(new SimpleDateFormat("yyyy-MM-dd"));
    datePicker.getCalendarView().todayButtonTextProperty().set("Today");
    datePicker.getCalendarView().setShowWeeks(false);
    datePicker.getStylesheets().add("datepicker.css");
    datePicker.selectedDateProperty().addListener(new ChangeListener<Date>() {
      @Override
      public void changed(ObservableValue<? extends Date> observableValue, Date date, Date date2) {
        filterDate = new DateTime(date2);
        hourGlass.setCurrentDay(filterDate);
        notifyLogsChanged();
      }
    });<commit_msg>Hooked up ad loging indicator.<commit_after>package lt.markmerkk.controllers;

import eu.schudt.javafx.controls.calendar.DatePicker;
import java.text.SimpleDateFormat;
import java.util.Collections;
import java.util.Date;
import java.util.Locale;
import javafx.application.Platform;
import javafx.beans.value.ChangeListener;
import javafx.beans.value.ObservableValue;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.event.EventHandler;
import javafx.fxml.FXML;
import javafx.scene.Scene;
import javafx.scene.control.Button;
import javafx.scene.control.PasswordField;
import javafx.scene.control.ProgressIndicator;
import javafx.scene.control.TableView;
import javafx.scene.control.TextArea;
import javafx.scene.control.TextField;
import javafx.scene.input.KeyCode;
import javafx.scene.input.KeyEvent;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.BorderPane;
import javafx.scene.text.Text;
import javafx.stage.Stage;
import lt.markmerkk.jira.IRemote;
import lt.markmerkk.jira.JiraExecutor;
import lt.markmerkk.jira.JiraListener;
import lt.markmerkk.storage2.SimpleLogBuilder;
import lt.markmerkk.storage2.entities.SimpleLog;
import lt.markmerkk.storage2.jobs.DeleteJob;
import lt.markmerkk.storage2.jobs.InsertJob;
import lt.markmerkk.storage2.jobs.QueryListJob;
import lt.markmerkk.utils.LogDisplayController;
import lt.markmerkk.utils.TableDisplayController;
import lt.markmerkk.utils.Utils;
import lt.markmerkk.utils.hourglass.HourGlass;
import lt.markmerkk.utils.hourglass.interfaces.Listener;
import lt.markmerkk.utils.os_formatter.IOSOutput;
import lt.markmerkk.utils.os_formatter.OSXOutput;
import org.joda.time.DateTime;
import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter;

/**
 * Created by mariusmerkevicius on 11/16/15.
 * Represents the main controller to display UI elements and business logic
 */
public class MainController extends BaseController {
  private final HourGlass hourGlass;
  private final DateTimeFormatter shortFormat = DateTimeFormat.forPattern("HH:mm");
  private final DateTimeFormatter longFormat = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm");

  private ObservableList<SimpleLog> logs;
  private DateTime filterDate;

  @FXML TextField inputTo;
  @FXML TextField inputFrom;
  @FXML TextField outputDuration;
  @FXML TextField inputTask;
  @FXML TextArea inputComment;
  @FXML Button buttonClock;
  @FXML Button buttonEnter;
  @FXML TextArea outputLogger;

  @FXML TextField inputHost;
  @FXML TextField inputUsername;
  @FXML PasswordField inputPassword;
  @FXML Button buttonTest;

  @FXML TableView tableLogs;

  @FXML Text totalView;
  @FXML BorderPane footer;
  @FXML ProgressIndicator progressIndicator;
  DatePicker datePicker;

  IRemote remote;
  IOSOutput osOutput;

  public MainController() {
    hourGlass = new HourGlass();
    hourGlass.setListener(hourglassListener);
    osOutput = new OSXOutput();
  }

  @Override
  public void setupController(BaseControllerDelegate listener, Scene scene, Stage primaryStage) {
    super.setupController(listener, scene, primaryStage);
    scene.getStylesheets().add(
        getClass().getResource("/text-field-red-border.css").toExternalForm());

    remote = new JiraExecutor(jiraListener);

    initViewListeners();
    initViews();

    Platform.runLater(() -> { 
      progressIndicator.setManaged(false);
      progressIndicator.setVisible(false);
    });
  }

  @Override void onInternalOutput(String message) {
    outputLogger.appendText(message);
  }

  //region Init

  /**
   * Initializes missing views for the controller
   */
  private void initViews() {
    // Initialize the DatePicker for birthday
    datePicker = new DatePicker(Locale.ENGLISH);
    datePicker.setDateFormat(new SimpleDateFormat("yyyy-MM-dd"));
    datePicker.getCalendarView().todayButtonTextProperty().set("Today");
    datePicker.getCalendarView().setShowWeeks(false);
    datePicker.getStylesheets().add("datepicker.css");
    datePicker.selectedDateProperty().addListener(new ChangeListener<Date>() {
      @Override
      public void changed(ObservableValue<? extends Date> observableValue, Date date, Date date2) {
        filterDate = new DateTime(date2);
        hourGlass.setCurrentDay(filterDate);
        notifyLogsChanged();
      }
    });
{'fraction_non_alphanumeric': 0.09907514450867053, 'fraction_numerical': 0.003005780346820809, 'mean_word_length': 5.1398154719659335, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '4739202', 'n_tokens_mistral': 2660, 'n_tokens_neox': 2568, 'n_words': 528}