import javafx.event.ActionEvent;
import javafx.fxml.FXML;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.stage.Stage;
import java.awt.*;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
public class StartFormController
{
@FXML
protected void showDemo()
{
Parent root = null;
try
{
root = FXMLLoader.load(getClass().getResource("demo.fxml"));
} catch (IOException e)
{
e.printStackTrace();
}
Stage stage = new Stage();
stage.setTitle("Демонстрация работы алгоритма перколяции");
stage.getIcons().add(new Image("logo.png"));
stage.setScene(new Scene(root));
stage.show();
}
@FXML
private void showCalculator()
{
javafx.application.Platform.runLater(new Runnable()
{
@Override
public void run()
{
Parent root = null;
try
{
root = FXMLLoader.load(getClass().getResource("calculator.fxml"));
} catch (IOException e)
{
e.printStackTrace();
}
Stage stage = new Stage();
stage.setTitle("Расчет коэффициента перколяции");
stage.getIcons().add(new Image("logo.png"));
stage.setScene(new Scene(root));
stage.show();
}
});
}
@FXML
private void showAnimator(ActionEvent actionEvent)
{
Parent root = null;
try
{
root = FXMLLoader.load(getClass().getResource("GraphSettings.fxml"));
} catch (IOException e)
{
e.printStackTrace();
}
Stage stage = new Stage();
stage.setTitle("Настройки графика");
stage.getIcons().add(new Image("logo.png"));
stage.setScene(new Scene(root));
stage.show();
}
public void showAbout(ActionEvent actionEvent)
{
Parent root = null;
try
{
root = FXMLLoader.load(getClass().getResource("about.fxml"));
} catch (IOException e)
{
e.printStackTrace();
}
Stage stage = new Stage();
stage.setTitle("О программе");
stage.getIcons().add(new Image("logo.png"));
stage.setScene(new Scene(root));
stage.show();
}
public void showHelp(ActionEvent actionEvent)
{
try
{
Desktop.getDesktop().browse(new URI("help.htm"));
} catch (IOException e)
{
e.printStackTrace();
} catch (URISyntaxException e)
{
e.printStackTrace();
}
}
}