Files
Greenify/GoGreen/Client/build/jacocoHtml/gogreen.client/Application.java.html
2019-03-04 17:54:50 +01:00

68 lines
3.9 KiB
HTML

<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en"><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/><link rel="stylesheet" href="../jacoco-resources/report.css" type="text/css"/><link rel="shortcut icon" href="../jacoco-resources/report.gif" type="image/gif"/><title>Application.java</title><link rel="stylesheet" href="../jacoco-resources/prettify.css" type="text/css"/><script type="text/javascript" src="../jacoco-resources/prettify.js"></script></head><body onload="window['PR_TAB_WIDTH']=4;prettyPrint()"><div class="breadcrumb" id="breadcrumb"><span class="info"><a href="../jacoco-sessions.html" class="el_session">Sessions</a></span><a href="../index.html" class="el_report">Client</a> &gt; <a href="index.source.html" class="el_package">gogreen.client</a> &gt; <span class="el_source">Application.java</span></div><h1>Application.java</h1><pre class="source lang-java linenums">package gogreen.client;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.web.client.RestTemplate;
@SpringBootApplication
<span class="nc" id="L18">public class Application extends javafx.application.Application {</span>
private ConfigurableApplicationContext springContext;
private Parent rootNode;
private FXMLLoader fxmlLoader;
<span class="nc" id="L22"> private static final Logger log = LoggerFactory.getLogger(Application.class);</span>
public static void main(String[] args) {
<span class="nc" id="L25"> launch(args);</span>
<span class="nc" id="L26"> }</span>
// @Bean
// public RestTemplate restTemplate(RestTemplateBuilder builder) {
// return builder.build();
// }
@Override
public void init() throws Exception {
<span class="nc" id="L35"> springContext = SpringApplication.run(Application.class);</span>
<span class="nc" id="L36"> fxmlLoader = new FXMLLoader();</span>
<span class="nc" id="L37"> fxmlLoader.setControllerFactory(springContext::getBean);</span>
<span class="nc" id="L38"> }</span>
@Override
public void start(Stage primaryStage) throws Exception{
<span class="nc" id="L42"> fxmlLoader.setLocation(this.getClass().getClassLoader().getResource(&quot;fxml/sample.fxml&quot;));</span>
<span class="nc" id="L43"> rootNode = fxmlLoader.load();</span>
// rootNode = FXMLLoader.load(this.getClass().getClassLoader().getResource(&quot;fxml/sample.fxml&quot;));
<span class="nc" id="L47"> primaryStage.setTitle(&quot;GoGreen&quot;);</span>
<span class="nc" id="L48"> Scene scene = new Scene(rootNode);</span>
<span class="nc" id="L49"> primaryStage.setScene(scene);</span>
<span class="nc" id="L50"> primaryStage.show();</span>
<span class="nc" id="L51"> }</span>
@Override
public void stop() {
<span class="nc" id="L55"> springContext.stop();</span>
<span class="nc" id="L56"> }</span>
// @Bean
// public CommandLineRunner run(RestTemplate restTemplate) throws Exception {
// return args -&gt; {
// User user = restTemplate.getForObject(
// &quot;http://localhost:8080/user&quot;, User.class);
// log.info(user.toString());
//
// };
// }
}
</pre><div class="footer"><span class="right">Created with <a href="http://www.jacoco.org/jacoco">JaCoCo</a> 0.8.2.201808211720</span></div></body></html>