<commit_before>/*
 * Copyright 2013 <NAME> <<EMAIL>>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package tido;

import java.io.InputStream;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import java.security.cert.X509Certificate;
import java.util.logging.Level;
import java.util.logging.Logger;

import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSession;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;

import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.paint.Color;
import javafx.stage.Stage;

import tido.config.ConfigManager;
import tido.viewmodel.TicketDownloaderViewModel;

/**
 * Main TiDoFx application class.
 *
 * @author <NAME>
 */
public class App extends Application {

    private static final Logger log = Logger.getLogger( App.class.getName() );

    private static final String FXML_FILE = "TiDoFx.fxml";

    // enable using system proxy if set
    static { System.setProperty( "java.net.useSystemProxies", "true" ); }

    /** The only ModelView of the application. */
    private TicketDownloaderViewModel ticketModelView;

    //---- Application -------------------------------------------------------------

    /*
     * @see Application.init()
     */
    @Override
    public void init() throws Exception {

        // disable SSL certificates check
        setTrustAllCerts();

        // load configuration
        ConfigManager.get();
    }

    /*
     * @see Application.start(Stage stage)
     */
    @Override
    public void start(Stage stage) throws Exception {

        FXMLLoader loader = new FXMLLoader();

        loader.setLocation( getClass().getResource( FXML_FILE ) );
        log.log( Level.INFO, "loading from {0}", loader.getLocation());

        Parent page;
        try ( InputStream is = App.class.getResourceAsStream( FXML_FILE) )
        {
            page = (Parent) loader.load( is );
        }

        setupModelView( loader );

        Scene scene = new Scene( page, Color.WHITESMOKE );

        stage.setTitle( "TiDoFx - Lite" );
        stage.setScene( scene );
        stage.sizeToScene();

        String uri = getClass().getResource( "TiDoFx.css" ).toExternalForm();
        scene.getStylesheets().add( uri );

        stage.show();<commit_msg>Added min width and height to main window.<commit_after>/*
 * Copyright 2013 <NAME> <<EMAIL>>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package tido;

import java.io.InputStream;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import java.security.cert.X509Certificate;
import java.util.logging.Level;
import java.util.logging.Logger;

import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.HttpsURLConnection;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSession;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;

import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.paint.Color;
import javafx.stage.Stage;

import tido.config.ConfigManager;
import tido.viewmodel.TicketDownloaderViewModel;

/**
 * Main TiDoFx application class.
 *
 * @author <NAME>
 */
public class App extends Application {

    private static final Logger log = Logger.getLogger( App.class.getName() );

    private static final String FXML_FILE = "TiDoFx.fxml";

    private static final double STAGE_MIN_WIDTH = 700d;
    private static final double STAGE_MIN_HEIGHT = 500d;

    // enable using system proxy if set
    static { System.setProperty( "java.net.useSystemProxies", "true" ); }

    /** The only ModelView of the application. */
    private TicketDownloaderViewModel ticketModelView;

    //---- Application -------------------------------------------------------------

    /*
     * @see Application.init()
     */
    @Override
    public void init() throws Exception {

        // disable SSL certificates check
        setTrustAllCerts();

        // load configuration
        ConfigManager.get();
    }

    /*
     * @see Application.start(Stage stage)
     */
    @Override
    public void start(Stage stage) throws Exception {

        FXMLLoader loader = new FXMLLoader();

        loader.setLocation( getClass().getResource( FXML_FILE ) );
        log.log( Level.INFO, "loading from {0}", loader.getLocation());

        Parent page;
        try ( InputStream is = App.class.getResourceAsStream( FXML_FILE) )
        {
            page = (Parent) loader.load( is );
        }

        setupModelView( loader );

        Scene scene = new Scene( page, Color.WHITESMOKE );

        stage.setTitle( "TiDoFx - Lite" );
        stage.setMinHeight( STAGE_MIN_HEIGHT );
        stage.setMinWidth( STAGE_MIN_WIDTH );
        stage.setScene( scene );
        stage.sizeToScene();

        String uri = getClass().getResource( "TiDoFx.css" ).toExternalForm();
        scene.getStylesheets().add( uri );

        stage.show();
{'fraction_non_alphanumeric': 0.12042219734527426, 'fraction_numerical': 0.005757236526467296, 'mean_word_length': 2.9532237673830593, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 4}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4894106', 'n_tokens_mistral': 1791, 'n_tokens_neox': 1723, 'n_words': 508}