Skip to content

Commit

Permalink
modules open properly
Browse files Browse the repository at this point in the history
  • Loading branch information
kamil-sita committed Mar 20, 2019
1 parent 7cd1fa0 commit 33b6439
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 15 deletions.
6 changes: 2 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.0</version>
<configuration>
<release>11</release>
<source>11</source>
<target>11</target>
</configuration>
Expand Down Expand Up @@ -109,10 +110,7 @@
<filtering>false</filtering>
<directory>src/main/java</directory>
<includes>
<include>**/*.fxml</include>
<include>**/*.html</include>
<include>**/*.css</include>
<include>**/*.MF</include>
<include>**/*</include>
</includes>
</resource>
</resources>
Expand Down
3 changes: 2 additions & 1 deletion src/main/java/XIS/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ public static void main(String[] args) {

@Override
public void start(Stage stage) throws Exception{
var res = getClass().getResource("XIS/main/mainView.fxml");
var res = getClass().getResource("main/mainView.fxml");

Parent root = FXMLLoader.load(res);
stage.setTitle("XIS 0.3.1");
stage.setScene(new Scene (root, 1280, 800));
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/XIS/sections/Vista.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import javafx.scene.layout.Pane;

import java.io.IOException;
import java.net.URL;

/**
* Abstract class of XIS.main vista in user interface.
Expand Down Expand Up @@ -35,10 +34,10 @@ protected void lazyLoad() {
}

protected void load(String location) {
URL url = Vista.class.getClassLoader().getResource(location);
var str = getClass().getResourceAsStream(location);
try {
FXMLLoader fxmlLoader = new FXMLLoader();
pane = fxmlLoader.load(url.openStream());
pane = fxmlLoader.load(str);
xisController = fxmlLoader.getController();
} catch (IOException e) {
e.printStackTrace();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
public final class AutomatedFilter extends Vista {

public AutomatedFilter() {
this.defaultLocation = "XIS/sections/automatedfilter/automatedFilter.fxml";
this.defaultLocation = "/XIS/sections/automatedfilter/automatedFilter.fxml";
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
public final class CompressionVista extends Vista {

public CompressionVista() {
this.defaultLocation = "XIS/sections/compression/compression.fxml";
this.defaultLocation = "/XIS/sections/compression/compression.fxml";
}

}
2 changes: 1 addition & 1 deletion src/main/java/XIS/sections/defaultpage/WelcomePage.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
public final class WelcomePage extends Vista {

public WelcomePage() {
this.defaultLocation = "XIS/sections/defaultpage/welcomePage.fxml";
this.defaultLocation = "/XIS/sections/defaultpage/welcomePage.fxml";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
public final class HighPassFilter extends Vista {

public HighPassFilter() {
this.defaultLocation = "XIS/sections/highpassfilter/highPassFilter.fxml";
this.defaultLocation = "/XIS/sections/highpassfilter/highPassFilter.fxml";
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@

public final class ImageCopyFinderVista extends Vista {

private static final String LOCATION_VIEW1 = "XIS/sections/imagecopyfinder/view1settings/view1.fxml";
private static final String LOCATION_VIEW2 = "XIS/sections/imagecopyfinder/view2comparison/view2.fxml";
private static final String LOCATION_VIEW1 = "/XIS/sections/imagecopyfinder/view1settings/view1.fxml";
private static final String LOCATION_VIEW2 = "/XIS/sections/imagecopyfinder/view2comparison/view2.fxml";
private static ImageComparator imageComparator;
private static String deleteDirectory;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
public final class ScannerToNote extends Vista {

public ScannerToNote() {
this.defaultLocation = "XIS/sections/scannertonote/scannerToNote.fxml";
this.defaultLocation = "/XIS/sections/scannertonote/scannerToNote.fxml";
}

}
13 changes: 13 additions & 0 deletions src/main/java/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,18 @@
requires java.sql;

requires simple.kmeans;

exports XIS;

exports XIS.main;

opens XIS.sections.defaultpage to javafx.fxml;
opens XIS.sections.automatedfilter to javafx.fxml;
opens XIS.sections.compression to javafx.fxml;
opens XIS.sections.highpassfilter to javafx.fxml;
opens XIS.sections.imagecopyfinder to javafx.fxml;
opens XIS.sections.imagecopyfinder.view1settings to javafx.fxml;
opens XIS.sections.imagecopyfinder.view2comparison to javafx.fxml;
opens XIS.sections.scannertonote to javafx.fxml;
opens XIS.main to javafx.fxml;
}

0 comments on commit 33b6439

Please sign in to comment.