Skip to content

Commit cc613cb

Browse files
committed
Add example
1 parent ad21260 commit cc613cb

32 files changed

+2175
-0
lines changed

.github/workflows/test-example.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Build and Push
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
- release/*
9+
tags: "*"
10+
release:
11+
types:
12+
- created
13+
14+
jobs:
15+
test:
16+
name: Run Tests of Example Application
17+
runs-on: ubuntu-latest
18+
steps:
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@v4
22+
23+
- name: Copy solution to tests/assignment
24+
run: |
25+
mkdir -p example/tests/assignment
26+
cp -r example/solution/* example/tests/assignment/
27+
28+
- name: Run Gradle Tests
29+
working-directory: example/tests/assignment
30+
run: ./gradlew test

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
build/
33
!**/src/main/**/build/
44
!**/src/test/**/build/
5+
example/tests/assignment
56

67
### IntelliJ IDEA ###
78
.idea

example/Problem.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# JavaFX Exercise
2+
3+
1. [task][Button Functionality](testInput())
4+
Implement the button's click behavior so that when it's clicked, the label displays the number of characters entered in the input field.
5+
Hint: You can use `countButton.setOnAction()` to set up the event handler.
6+
7+
2. [task][Consistent Layout](testLayout())
8+
Ensure that the overall user interface is clean and visually consistent. All elements should be neatly aligned vertically for a tidy look.

example/solution/.gitattributes

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Handle line endings automatically for files detected as text
2+
# and leave all files detected as binary untouched.
3+
* text=auto
4+
5+
#
6+
# The above will handle all files NOT found below
7+
#
8+
# These files are text and should be normalized (Convert crlf => lf)
9+
*.bash text eol=lf
10+
*.css text diff=css
11+
*.df text
12+
*.htm text diff=html
13+
*.html text diff=html
14+
*.java text diff=java
15+
*.js text
16+
*.json text
17+
*.jsp text
18+
*.jspf text
19+
*.jspx text
20+
*.properties text
21+
*.sh text eol=lf
22+
*.tld text
23+
*.txt text
24+
*.tag text
25+
*.tagx text
26+
*.xml text
27+
*.yml text
28+
29+
# These files are binary and should be left untouched
30+
# (binary is a macro for -text -diff)
31+
*.class binary
32+
*.dll binary
33+
*.ear binary
34+
*.gif binary
35+
*.ico binary
36+
*.jar binary
37+
*.jpg binary
38+
*.jpeg binary
39+
*.png binary
40+
*.so binary
41+
*.war binary

example/solution/.gitignore

Lines changed: 206 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,206 @@
1+
.gradle
2+
**/build/
3+
!src/**/build/
4+
target/
5+
6+
# Taken from https://github.com/github/gitignore
7+
8+
### Java
9+
# Compiled class file
10+
*.class
11+
12+
# Log file
13+
*.log
14+
15+
# Mobile Tools for Java (J2ME)
16+
.mtj.tmp/
17+
18+
# Package Files #
19+
*.jar
20+
*.war
21+
*.nar
22+
*.ear
23+
*.zip
24+
*.tar.gz
25+
*.rar
26+
27+
### Eclipse
28+
.project
29+
.classpath
30+
.metadata
31+
bin/
32+
tmp/
33+
*.tmp
34+
*.bak
35+
*.swp
36+
*~.nib
37+
local.properties
38+
.settings/
39+
.loadpath
40+
.recommenders
41+
42+
# External tool builders
43+
.externalToolBuilders/
44+
45+
# Locally stored "Eclipse launch configurations"
46+
*.launch
47+
48+
# CDT- autotools
49+
.autotools
50+
51+
# Java annotation processor (APT)
52+
.factorypath
53+
54+
# PDT-specific (PHP Development Tools)
55+
.buildpath
56+
57+
# sbteclipse plugin
58+
.target
59+
60+
# Tern plugin
61+
.tern-project
62+
63+
# TeXlipse plugin
64+
.texlipse
65+
66+
# STS (Spring Tool Suite)
67+
.springBeans
68+
69+
# Code Recommenders
70+
.recommenders/
71+
72+
# Annotation Processing
73+
.apt_generated/
74+
.apt_generated_test/
75+
76+
### JetBrains
77+
.idea
78+
79+
# Gradle and Maven with auto-import
80+
*.iml
81+
*.ipr
82+
83+
# File-based project format
84+
*.iws
85+
86+
# IntelliJ
87+
out/
88+
89+
# mpeltonen/sbt-idea plugin
90+
.idea_modules/
91+
92+
# JIRA plugin
93+
atlassian-ide-plugin.xml
94+
95+
# Crashlytics plugin (for Android Studio and IntelliJ)
96+
com_crashlytics_export_strings.xml
97+
crashlytics.properties
98+
crashlytics-build.properties
99+
fabric.properties
100+
101+
### VSCode
102+
.vscode/*
103+
!.vscode/settings.json
104+
!.vscode/tasks.json
105+
!.vscode/launch.json
106+
!.vscode/extensions.json
107+
!.vscode/*.code-snippets
108+
109+
# Local History for Visual Studio Code
110+
.history/
111+
112+
# Built Visual Studio Code Extensions
113+
*.vsix
114+
115+
### Vim
116+
# Swap
117+
[._]*.s[a-v][a-z]
118+
!*.svg # comment out if you don't need vector files
119+
[._]*.sw[a-p]
120+
[._]s[a-rt-v][a-z]
121+
[._]ss[a-gi-z]
122+
[._]sw[a-p]
123+
124+
# Session
125+
Session.vim
126+
Sessionx.vim
127+
128+
# Temporary
129+
.netrwhist
130+
*~
131+
# Auto-generated tag files
132+
tags
133+
# Persistent undo
134+
[._]*.un~
135+
136+
### MacOs
137+
# General
138+
.DS_Store
139+
.AppleDouble
140+
.LSOverride
141+
142+
# Icon must end with two \r
143+
Icon
144+
145+
# Thumbnails
146+
._*
147+
148+
# Files that might appear in the root of a volume
149+
.DocumentRevisions-V100
150+
.fseventsd
151+
.Spotlight-V100
152+
.TemporaryItems
153+
.Trashes
154+
.VolumeIcon.icns
155+
.com.apple.timemachine.donotpresent
156+
157+
# Directories potentially created on remote AFP share
158+
.AppleDB
159+
.AppleDesktop
160+
Network Trash Folder
161+
Temporary Items
162+
.apdisk
163+
164+
### Windows
165+
# Windows thumbnail cache files
166+
Thumbs.db
167+
Thumbs.db:encryptable
168+
ehthumbs.db
169+
ehthumbs_vista.db
170+
171+
# Dump file
172+
*.stackdump
173+
174+
# Folder config file
175+
[Dd]esktop.ini
176+
177+
# Recycle Bin used on file shares
178+
$RECYCLE.BIN/
179+
180+
# Windows Installer files
181+
*.cab
182+
*.msi
183+
*.msix
184+
*.msm
185+
*.msp
186+
187+
# Windows shortcuts
188+
*.lnk
189+
190+
### Linux
191+
*~
192+
193+
# temporary files which can be created if a process still has a handle open of a deleted file
194+
.fuse_hidden*
195+
196+
# KDE directory preferences
197+
.directory
198+
199+
# Linux trash folder which might appear on any partition or disk
200+
.Trash-*
201+
202+
# .nfs files are created when an open file is removed but is still being accessed
203+
.nfs*
204+
205+
### Include gradle-wrapper
206+
!gradle/wrapper/gradle-wrapper.jar

example/solution/build.gradle

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
plugins{
2+
id 'java'
3+
id 'application'
4+
id 'org.openjfx.javafxplugin' version '0.1.0'
5+
}
6+
7+
sourceCompatibility = 17
8+
version = '1.0.0'
9+
compileJava.options.encoding = 'UTF-8'
10+
11+
repositories {
12+
mavenCentral()
13+
}
14+
15+
dependencies {
16+
}
17+
18+
javafx {
19+
version = "17.0.8"
20+
modules = ['javafx.base', 'javafx.graphics', 'javafx.controls']
21+
}
22+
23+
application {
24+
mainModule = "ExampleApp"
25+
mainClass = "de.tum.cit.ase.javafx.exercise.ExampleApp"
26+
}
27+
28+
sourceSets {
29+
main {
30+
java {
31+
srcDir 'src'
32+
}
33+
}
34+
test {
35+
java {
36+
srcDirs = []
37+
}
38+
}
39+
}
42.6 KB
Binary file not shown.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
6+
zipStoreBase=GRADLE_USER_HOME
7+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)