/**
 * Copyright (C) 2015 The Authors.
 */
package dk.itu.kelvin.controller;

// JavaFX layout
import javafx.scene.layout.BorderPane;

// JavaFX shapes

// JavaFX input

// JavaFX transformations

// Java FX event

// Controls FX

// FXML utilities
import javafx.fxml.FXML;

// Components

// Models

/**
 * Application controller class.
 *
 * @version 1.0.0
 */
public class ApplicationController {
  /**
   * Field that holds only instance of the class.
   */
  private static ApplicationController applicationController;

  /**
   * Borderpane element.
   */
  @FXML
  private BorderPane borderPane;

  /**
   * JavaFX constructor for the ApplicationController.
   */
  public final void initialize() {
    ApplicationController.applicationController = this;
  }

  /**
   *  Method to point to this instance from a static context.
   * @return this instance of the class.
   */
  public static ApplicationController instance() {
    return ApplicationController.applicationController;
  }

  /**
   * Add a styleclass to borderpane element.
   * This enables us to change colours of the map.
   */
  public static void highContrast() {
    if (!ApplicationController.instance().borderPane.getStyleClass().
      contains("high-contrast")) {
      ApplicationController.instance().borderPane.getStyleClass().
      add("high-contrast");
      System.out.println(ApplicationController.instance().borderPane.
      getStyleClass());
    } else {
      ApplicationController.instance().borderPane.getStyleClass().
      remove("high-contrast");
      System.out.println(ApplicationController.instance().borderPane.
      getStyleClass());
    }
  }
}



@@ -132,104 +132,8 @@
 e;%0A%0A
-// JavaFX shapes%0A%0A// JavaFX input%0A%0A// JavaFX transformations%0A%0A// Java FX event%0A%0A// Controls FX%0A%0A
 // F
@@ -176,34 +176,8 @@
 L;%0A%0A
-// Components%0A%0A// Models%0A%0A
 /**%0A
@@ -241,16 +241,22 @@
 %0Apublic 
+final 
 class Ap
@@ -378,37 +378,24 @@
 troller 
-applicationController
+instance
 ;%0A%0A  /**
@@ -544,22 +544,16 @@
  public 
-final 
 void ini
@@ -582,32 +582,72 @@
 ationController.
+instance(this);%0A  %7D%0A%0A  /**%0A   * Get the 
 applicationContr
@@ -633,33 +633,34 @@
  the application
-C
+ c
 ontroller = this
@@ -657,153 +657,261 @@
 ler 
-= this;%0A  %7D%0A%0A  /**%0A   *  Method to point to this instance from a static context.
+instance.%0A   *%0A   * @return The application controller instance.%0A   */%0A  public static ApplicationController instance() %7B
 %0A   
-* @
+ 
 return 
-this instance of the class
+ApplicationController.instance;%0A  %7D%0A%0A  /**%0A   * Set the application controller instance
 .%0A   *
-/
 %0A  
-public static A
+ * @param instance The a
 ppli
@@ -908,33 +908,34 @@
  The application
-C
+ c
 ontroller instan
@@ -932,39 +932,68 @@
 ler instance
-() %7B%0A    return
+.%0A   */%0A  private static void instance(final
  Application
@@ -1006,10 +1006,26 @@
 ller
-.a
+ instance) %7B%0A    A
 ppli
@@ -1040,16 +1040,36 @@
 ntroller
+.instance = instance
 ;%0A  %7D%0A%0A 
@@ -1724,10 +1724,8 @@
 %7D%0A  %7D%0A%7D%0A
-%0A%0A

Fix static access bug in application controller.