Skip to content

Commit 636fa0b

Browse files
JIMMYJIMMY
authored andcommitted
Lab02
1 parent c9b7233 commit 636fa0b

File tree

12 files changed

+161
-0
lines changed

12 files changed

+161
-0
lines changed

Lab2_Alien/.classpath

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" path="src"/>
4+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
5+
<classpathentry kind="con" path="org.eclipse.fx.ide.jdt.core.JAVAFX_CONTAINER"/>
6+
<classpathentry kind="output" path="bin"/>
7+
</classpath>

Lab2_Alien/.project

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>Lab2_Alien</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
</buildSpec>
19+
<natures>
20+
<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
21+
<nature>org.eclipse.jdt.core.javanature</nature>
22+
</natures>
23+
</projectDescription>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
eclipse.preferences.version=1
2+
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
4+
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
5+
org.eclipse.jdt.core.compiler.compliance=1.8
6+
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
7+
org.eclipse.jdt.core.compiler.debug.localVariable=generate
8+
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
9+
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
10+
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
11+
org.eclipse.jdt.core.compiler.source=1.8

Lab2_Alien/bin/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/it/

Lab2_Alien/build.fxbuild

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="ASCII"?>
2+
<anttasks:AntTask xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:anttasks="http://org.eclipse.fx.ide.jdt/1.0" buildDirectory="${project}/build">
3+
<deploy>
4+
<application name="Lab1_Alien"/>
5+
<info/>
6+
</deploy>
7+
<signjar/>
8+
</anttasks:AntTask>

Lab2_Alien/rsc/Alien-512.png

19.2 KB
Loading
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
3+
<?import javafx.geometry.Insets?>
4+
<?import javafx.scene.control.Label?>
5+
<?import javafx.scene.layout.BorderPane?>
6+
<?import javafx.scene.text.Font?>
7+
8+
<BorderPane prefHeight="343.0" prefWidth="513.0" xmlns="http://javafx.com/javafx/8.0.65" xmlns:fx="http://javafx.com/fxml/1" fx:controller="it.polito.tdp.alien.AlienController">
9+
<top>
10+
<Label text="Lab 1 - Alien Translator" BorderPane.alignment="CENTER">
11+
<BorderPane.margin>
12+
<Insets bottom="10.0" />
13+
</BorderPane.margin>
14+
<font>
15+
<Font name="System Bold" size="13.0" />
16+
</font>
17+
</Label>
18+
</top>
19+
<padding>
20+
<Insets bottom="10.0" left="10.0" right="10.0" top="10.0" />
21+
</padding>
22+
</BorderPane>
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
package it.polito.tdp.alien;
2+
3+
/**
4+
* Sample Skeleton for 'Alien.fxml' Controller Class
5+
*/
6+
7+
8+
9+
import java.net.URL;
10+
import java.util.ResourceBundle;
11+
12+
import javafx.event.ActionEvent;
13+
import javafx.fxml.FXML;
14+
import javafx.scene.control.Button;
15+
import javafx.scene.control.TextArea;
16+
import javafx.scene.control.TextField;
17+
18+
public class AlienController {
19+
20+
@FXML
21+
private ResourceBundle resources;
22+
@FXML
23+
private URL location;
24+
@FXML
25+
private TextField txtWord;
26+
@FXML
27+
private TextArea txtResult;
28+
@FXML
29+
private Button btnTranslate;
30+
@FXML
31+
private Button btnReset;
32+
33+
34+
@FXML // This method is called by the FXMLLoader when initialization is complete
35+
void initialize() {
36+
assert txtWord != null : "fx:id=\"txtWord\" was not injected: check your FXML file 'Alien.fxml'.";
37+
assert txtResult != null : "fx:id=\"txtResult\" was not injected: check your FXML file 'Alien.fxml'.";
38+
assert btnTranslate != null : "fx:id=\"bntTranslate\" was not injected: check your FXML file 'Alien.fxml'.";
39+
assert btnReset != null : "fx:id=\"btnReset\" was not injected: check your FXML file 'Alien.fxml'.";
40+
41+
}
42+
43+
44+
@FXML
45+
void doTranslate(ActionEvent event) {
46+
47+
}
48+
49+
50+
@FXML
51+
void doReset(ActionEvent event) {
52+
53+
}
54+
55+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package it.polito.tdp.alien;
2+
3+
import javafx.application.Application;
4+
import javafx.stage.Stage;
5+
import javafx.scene.Scene;
6+
import javafx.scene.layout.BorderPane;
7+
import javafx.fxml.FXMLLoader;
8+
9+
10+
11+
public class Main extends Application {
12+
@Override
13+
public void start(Stage primaryStage) {
14+
try {
15+
BorderPane root = (BorderPane)FXMLLoader.load(getClass().getResource("Alien.fxml"));
16+
Scene scene = new Scene(root);
17+
scene.getStylesheets().add(getClass().getResource("application.css").toExternalForm());
18+
primaryStage.setScene(scene);
19+
primaryStage.show();
20+
} catch(Exception e) {
21+
e.printStackTrace();
22+
}
23+
}
24+
25+
public static void main(String[] args) {
26+
launch(args);
27+
}
28+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
package it.polito.tdp.alien;
2+
3+
public class Test {
4+
5+
}

0 commit comments

Comments
 (0)