import javafx event ActionEvent import javafx fxml FXML import javafx

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
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();
}
}
}