リビジョン d6eefca2
| src/main/java/com/torutk/spectrum/view/SpectrumFileViewApp.java | ||
|---|---|---|
|
package com.torutk.spectrum.view;
|
||
|
|
||
|
import javafx.application.Application;
|
||
|
import javafx.fxml.FXMLLoader;
|
||
|
import javafx.scene.Parent;
|
||
|
import javafx.scene.Scene;
|
||
|
import javafx.stage.Stage;
|
||
|
|
||
|
public class SpectrumFileViewApp extends Application {
|
||
|
|
||
|
@Override
|
||
|
public void start(Stage primaryStage) {
|
||
|
public void start(Stage primaryStage) throws Exception {
|
||
|
Parent root = FXMLLoader.load(SpectrumFileViewApp.class.getResource("SpectrumFileView.fxml"));
|
||
|
var scene = new Scene(root);
|
||
|
primaryStage.setScene(scene);
|
||
|
primaryStage.show();
|
||
|
}
|
||
|
}
|
||
| src/main/java/com/torutk/spectrum/view/SpectrumFileViewController.java | ||
|---|---|---|
|
package com.torutk.spectrum.view;
|
||
|
|
||
|
import javafx.fxml.Initializable;
|
||
|
|
||
|
import java.net.URL;
|
||
|
import java.util.ResourceBundle;
|
||
|
|
||
|
public class SpectrumFileViewController implements Initializable {
|
||
|
private ResourceBundle resources;
|
||
|
|
||
|
@Override
|
||
|
public void initialize(URL url, ResourceBundle resourceBundle) {
|
||
|
resources = resourceBundle;
|
||
|
}
|
||
|
}
|
||
| src/main/java/module-info.java | ||
|---|---|---|
|
module com.torutk.spectrum {
|
||
|
requires javafx.graphics;
|
||
|
opens com.torutk.spectrum.view to javafx.graphics;
|
||
|
requires javafx.controls;
|
||
|
requires javafx.fxml;
|
||
|
opens com.torutk.spectrum.view to javafx.graphics, javafx.fxml;
|
||
|
}
|
||
| src/main/resources/com/torutk/spectrum/view/SpectrumFileView.fxml | ||
|---|---|---|
|
<?xml version="1.0" encoding="UTF-8"?>
|
||
|
|
||
|
<?import javafx.scene.chart.*?>
|
||
|
<?import javafx.scene.layout.*?>
|
||
|
|
||
|
|
||
|
<BorderPane xmlns="http://javafx.com/javafx/10.0.2-internal" xmlns:fx="http://javafx.com/fxml/1" fx:controller="com.torutk.spectrum.view.SpectrumFileViewController">
|
||
|
<center>
|
||
|
<LineChart BorderPane.alignment="CENTER">
|
||
|
<xAxis>
|
||
|
<NumberAxis side="BOTTOM" />
|
||
|
</xAxis>
|
||
|
<yAxis>
|
||
|
<NumberAxis side="LEFT" />
|
||
|
</yAxis>
|
||
|
</LineChart>
|
||
|
</center>
|
||
|
</BorderPane>
|
||
Add FXML file to define UI and view controller class