├── AddressApp-Part-4 ├── .settings │ ├── org.eclipse.core.resources.prefs │ └── org.eclipse.jdt.core.prefs ├── resources │ ├── images │ │ ├── edit.png │ │ ├── calendar.png │ │ └── address_book_32.png │ └── copyright.txt ├── .gitignore ├── build.fxbuild ├── .classpath ├── .project └── src │ └── ch │ └── makery │ └── address │ ├── view │ ├── RootLayout.fxml │ ├── PersonEditDialog.fxml │ ├── DarkTheme.css │ ├── PersonOverview.fxml │ ├── PersonEditDialogController.java │ └── PersonOverviewController.java │ ├── util │ └── DateUtil.java │ ├── model │ └── Person.java │ └── MainApp.java ├── AddressApp-Part-5 ├── .settings │ ├── org.eclipse.core.resources.prefs │ └── org.eclipse.jdt.core.prefs ├── resources │ ├── images │ │ ├── edit.png │ │ ├── calendar.png │ │ └── address_book_32.png │ └── copyright.txt ├── .gitignore ├── build.fxbuild ├── .classpath ├── .project └── src │ └── ch │ └── makery │ └── address │ ├── util │ ├── LocalDateAdapter.java │ └── DateUtil.java │ ├── model │ ├── PersonListWrapper.java │ └── Person.java │ └── view │ ├── RootLayout.fxml │ ├── PersonEditDialog.fxml │ ├── RootLayoutController.java │ ├── DarkTheme.css │ ├── PersonOverview.fxml │ └── PersonEditDialogController.java ├── AddressApp-Part-6 ├── .settings │ ├── org.eclipse.core.resources.prefs │ └── org.eclipse.jdt.core.prefs ├── resources │ ├── images │ │ ├── edit.png │ │ ├── calendar.png │ │ └── address_book_32.png │ └── copyright.txt ├── .gitignore ├── build.fxbuild ├── .classpath ├── .project └── src │ └── ch │ └── makery │ └── address │ ├── util │ ├── LocalDateAdapter.java │ └── DateUtil.java │ ├── model │ ├── PersonListWrapper.java │ └── Person.java │ └── view │ ├── BirthdayStatistics.fxml │ ├── BirthdayStatisticsController.java │ ├── RootLayout.fxml │ ├── PersonEditDialog.fxml │ ├── DarkTheme.css │ ├── RootLayoutController.java │ ├── PersonOverview.fxml │ └── PersonEditDialogController.java ├── AddressApp-Part-7 ├── .settings │ ├── org.eclipse.core.resources.prefs │ └── org.eclipse.jdt.core.prefs ├── resources │ ├── images │ │ ├── edit.png │ │ ├── calendar.png │ │ └── address_book_32.png │ └── copyright.txt ├── build │ ├── dist │ │ └── resources │ │ │ ├── images │ │ │ ├── edit.png │ │ │ ├── calendar.png │ │ │ └── address_book_32.png │ │ │ └── copyright.txt │ ├── package │ │ ├── macosx │ │ │ ├── AddressApp.icns │ │ │ └── AddressApp-volume.icns │ │ └── windows │ │ │ ├── AddressApp.ico │ │ │ └── AddressApp-setup-icon.bmp │ └── build.xml ├── .gitignore ├── .classpath ├── build.fxbuild ├── .project └── src │ └── ch │ └── makery │ └── address │ ├── util │ ├── LocalDateAdapter.java │ └── DateUtil.java │ ├── model │ ├── PersonListWrapper.java │ └── Person.java │ └── view │ ├── BirthdayStatistics.fxml │ ├── BirthdayStatisticsController.java │ ├── RootLayout.fxml │ ├── PersonEditDialog.fxml │ ├── DarkTheme.css │ ├── RootLayoutController.java │ ├── PersonOverview.fxml │ └── PersonEditDialogController.java ├── README.md ├── .gitignore ├── AddressApp-Part-1 ├── .gitignore ├── build.fxbuild ├── .classpath ├── .settings │ └── org.eclipse.jdt.core.prefs ├── .project └── src │ └── ch │ └── makery │ └── address │ ├── view │ ├── RootLayout.fxml │ └── PersonOverview.fxml │ └── MainApp.java ├── AddressApp-Part-2 ├── .gitignore ├── build.fxbuild ├── .classpath ├── .settings │ └── org.eclipse.jdt.core.prefs ├── .project └── src │ └── ch │ └── makery │ └── address │ ├── view │ ├── RootLayout.fxml │ ├── PersonOverviewController.java │ └── PersonOverview.fxml │ ├── model │ └── Person.java │ └── MainApp.java └── AddressApp-Part-3 ├── .gitignore ├── build.fxbuild ├── .classpath ├── .settings └── org.eclipse.jdt.core.prefs ├── .project └── src └── ch └── makery └── address ├── view ├── RootLayout.fxml ├── PersonEditDialog.fxml ├── PersonOverview.fxml ├── PersonEditDialogController.java └── PersonOverviewController.java ├── util └── DateUtil.java ├── model └── Person.java └── MainApp.java /AddressApp-Part-4/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding//resources/copyright.txt=UTF-8 3 | -------------------------------------------------------------------------------- /AddressApp-Part-5/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding//resources/copyright.txt=UTF-8 3 | -------------------------------------------------------------------------------- /AddressApp-Part-6/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding//resources/copyright.txt=UTF-8 3 | -------------------------------------------------------------------------------- /AddressApp-Part-7/.settings/org.eclipse.core.resources.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | encoding//resources/copyright.txt=UTF-8 3 | -------------------------------------------------------------------------------- /AddressApp-Part-4/resources/images/edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcojakob/tutorial-javafx-8/HEAD/AddressApp-Part-4/resources/images/edit.png -------------------------------------------------------------------------------- /AddressApp-Part-5/resources/images/edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcojakob/tutorial-javafx-8/HEAD/AddressApp-Part-5/resources/images/edit.png -------------------------------------------------------------------------------- /AddressApp-Part-6/resources/images/edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcojakob/tutorial-javafx-8/HEAD/AddressApp-Part-6/resources/images/edit.png -------------------------------------------------------------------------------- /AddressApp-Part-7/resources/images/edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcojakob/tutorial-javafx-8/HEAD/AddressApp-Part-7/resources/images/edit.png -------------------------------------------------------------------------------- /AddressApp-Part-4/resources/images/calendar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcojakob/tutorial-javafx-8/HEAD/AddressApp-Part-4/resources/images/calendar.png -------------------------------------------------------------------------------- /AddressApp-Part-5/resources/images/calendar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcojakob/tutorial-javafx-8/HEAD/AddressApp-Part-5/resources/images/calendar.png -------------------------------------------------------------------------------- /AddressApp-Part-6/resources/images/calendar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcojakob/tutorial-javafx-8/HEAD/AddressApp-Part-6/resources/images/calendar.png -------------------------------------------------------------------------------- /AddressApp-Part-7/resources/images/calendar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcojakob/tutorial-javafx-8/HEAD/AddressApp-Part-7/resources/images/calendar.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # JavaFX 8 Tutorial - Sources 2 | 3 | These are example sources for the [JavaFX 8 Tutorial](http://code.makery.ch/java/javafx-8-tutorial-intro/). -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ################# 2 | ## Eclipse 3 | ################# 4 | /bin 5 | /.metadata 6 | /target* 7 | 8 | # Locally stored "Eclipse launch configurations" 9 | /*.launch -------------------------------------------------------------------------------- /AddressApp-Part-4/resources/images/address_book_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcojakob/tutorial-javafx-8/HEAD/AddressApp-Part-4/resources/images/address_book_32.png -------------------------------------------------------------------------------- /AddressApp-Part-5/resources/images/address_book_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcojakob/tutorial-javafx-8/HEAD/AddressApp-Part-5/resources/images/address_book_32.png -------------------------------------------------------------------------------- /AddressApp-Part-6/resources/images/address_book_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcojakob/tutorial-javafx-8/HEAD/AddressApp-Part-6/resources/images/address_book_32.png -------------------------------------------------------------------------------- /AddressApp-Part-7/build/dist/resources/images/edit.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcojakob/tutorial-javafx-8/HEAD/AddressApp-Part-7/build/dist/resources/images/edit.png -------------------------------------------------------------------------------- /AddressApp-Part-7/build/package/macosx/AddressApp.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcojakob/tutorial-javafx-8/HEAD/AddressApp-Part-7/build/package/macosx/AddressApp.icns -------------------------------------------------------------------------------- /AddressApp-Part-7/build/package/windows/AddressApp.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcojakob/tutorial-javafx-8/HEAD/AddressApp-Part-7/build/package/windows/AddressApp.ico -------------------------------------------------------------------------------- /AddressApp-Part-7/resources/images/address_book_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcojakob/tutorial-javafx-8/HEAD/AddressApp-Part-7/resources/images/address_book_32.png -------------------------------------------------------------------------------- /AddressApp-Part-7/build/dist/resources/images/calendar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcojakob/tutorial-javafx-8/HEAD/AddressApp-Part-7/build/dist/resources/images/calendar.png -------------------------------------------------------------------------------- /AddressApp-Part-7/build/package/macosx/AddressApp-volume.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcojakob/tutorial-javafx-8/HEAD/AddressApp-Part-7/build/package/macosx/AddressApp-volume.icns -------------------------------------------------------------------------------- /AddressApp-Part-1/.gitignore: -------------------------------------------------------------------------------- 1 | ################# 2 | ## Eclipse 3 | ################# 4 | /bin 5 | /.metadata 6 | /target* 7 | 8 | # Locally stored "Eclipse launch configurations" 9 | /*.launch -------------------------------------------------------------------------------- /AddressApp-Part-2/.gitignore: -------------------------------------------------------------------------------- 1 | ################# 2 | ## Eclipse 3 | ################# 4 | /bin 5 | /.metadata 6 | /target* 7 | 8 | # Locally stored "Eclipse launch configurations" 9 | /*.launch -------------------------------------------------------------------------------- /AddressApp-Part-3/.gitignore: -------------------------------------------------------------------------------- 1 | ################# 2 | ## Eclipse 3 | ################# 4 | /bin 5 | /.metadata 6 | /target* 7 | 8 | # Locally stored "Eclipse launch configurations" 9 | /*.launch -------------------------------------------------------------------------------- /AddressApp-Part-4/.gitignore: -------------------------------------------------------------------------------- 1 | ################# 2 | ## Eclipse 3 | ################# 4 | /bin 5 | /.metadata 6 | /target* 7 | 8 | # Locally stored "Eclipse launch configurations" 9 | /*.launch -------------------------------------------------------------------------------- /AddressApp-Part-5/.gitignore: -------------------------------------------------------------------------------- 1 | ################# 2 | ## Eclipse 3 | ################# 4 | /bin 5 | /.metadata 6 | /target* 7 | 8 | # Locally stored "Eclipse launch configurations" 9 | /*.launch -------------------------------------------------------------------------------- /AddressApp-Part-6/.gitignore: -------------------------------------------------------------------------------- 1 | ################# 2 | ## Eclipse 3 | ################# 4 | /bin 5 | /.metadata 6 | /target* 7 | 8 | # Locally stored "Eclipse launch configurations" 9 | /*.launch -------------------------------------------------------------------------------- /AddressApp-Part-7/.gitignore: -------------------------------------------------------------------------------- 1 | ################# 2 | ## Eclipse 3 | ################# 4 | /bin 5 | /.metadata 6 | /target* 7 | 8 | # Locally stored "Eclipse launch configurations" 9 | /*.launch -------------------------------------------------------------------------------- /AddressApp-Part-7/build/dist/resources/images/address_book_32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcojakob/tutorial-javafx-8/HEAD/AddressApp-Part-7/build/dist/resources/images/address_book_32.png -------------------------------------------------------------------------------- /AddressApp-Part-7/build/package/windows/AddressApp-setup-icon.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/marcojakob/tutorial-javafx-8/HEAD/AddressApp-Part-7/build/package/windows/AddressApp-setup-icon.bmp -------------------------------------------------------------------------------- /AddressApp-Part-4/resources/copyright.txt: -------------------------------------------------------------------------------- 1 | Copyright by Susumu Yoshida - http://www.mcdodesign.com/ 2 | - address_book_32.png 3 | - AddressApp.ico 4 | 5 | Copyright by Jan Jan Kovařík - http://glyphicons.com/ 6 | - calendar.png 7 | - edit.png 8 | -------------------------------------------------------------------------------- /AddressApp-Part-5/resources/copyright.txt: -------------------------------------------------------------------------------- 1 | Copyright by Susumu Yoshida - http://www.mcdodesign.com/ 2 | - address_book_32.png 3 | - AddressApp.ico 4 | 5 | Copyright by Jan Jan Kovařík - http://glyphicons.com/ 6 | - calendar.png 7 | - edit.png 8 | -------------------------------------------------------------------------------- /AddressApp-Part-6/resources/copyright.txt: -------------------------------------------------------------------------------- 1 | Copyright by Susumu Yoshida - http://www.mcdodesign.com/ 2 | - address_book_32.png 3 | - AddressApp.ico 4 | 5 | Copyright by Jan Jan Kovařík - http://glyphicons.com/ 6 | - calendar.png 7 | - edit.png 8 | -------------------------------------------------------------------------------- /AddressApp-Part-7/resources/copyright.txt: -------------------------------------------------------------------------------- 1 | Copyright by Susumu Yoshida - http://www.mcdodesign.com/ 2 | - address_book_32.png 3 | - AddressApp.ico 4 | 5 | Copyright by Jan Jan Kovařík - http://glyphicons.com/ 6 | - calendar.png 7 | - edit.png 8 | -------------------------------------------------------------------------------- /AddressApp-Part-7/build/dist/resources/copyright.txt: -------------------------------------------------------------------------------- 1 | Copyright by Susumu Yoshida - http://www.mcdodesign.com/ 2 | - address_book_32.png 3 | - AddressApp.ico 4 | 5 | Copyright by Jan Jan Kovařík - http://glyphicons.com/ 6 | - calendar.png 7 | - edit.png 8 | -------------------------------------------------------------------------------- /AddressApp-Part-1/build.fxbuild: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /AddressApp-Part-2/build.fxbuild: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /AddressApp-Part-3/build.fxbuild: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /AddressApp-Part-4/build.fxbuild: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /AddressApp-Part-5/build.fxbuild: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /AddressApp-Part-6/build.fxbuild: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /AddressApp-Part-1/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /AddressApp-Part-2/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /AddressApp-Part-3/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /AddressApp-Part-4/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /AddressApp-Part-5/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /AddressApp-Part-6/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /AddressApp-Part-7/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /AddressApp-Part-7/build.fxbuild: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /AddressApp-Part-1/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 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 12 | -------------------------------------------------------------------------------- /AddressApp-Part-2/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 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 12 | -------------------------------------------------------------------------------- /AddressApp-Part-3/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 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 12 | -------------------------------------------------------------------------------- /AddressApp-Part-4/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 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 12 | -------------------------------------------------------------------------------- /AddressApp-Part-5/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 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 12 | -------------------------------------------------------------------------------- /AddressApp-Part-6/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 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 12 | -------------------------------------------------------------------------------- /AddressApp-Part-7/.settings/org.eclipse.jdt.core.prefs: -------------------------------------------------------------------------------- 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 12 | -------------------------------------------------------------------------------- /AddressApp-Part-1/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | AddressApp-Part-1 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.xtext.ui.shared.xtextBuilder 15 | 16 | 17 | 18 | 19 | 20 | org.eclipse.xtext.ui.shared.xtextNature 21 | org.eclipse.jdt.core.javanature 22 | 23 | 24 | -------------------------------------------------------------------------------- /AddressApp-Part-2/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | AddressApp-Part-2 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.xtext.ui.shared.xtextBuilder 15 | 16 | 17 | 18 | 19 | 20 | org.eclipse.xtext.ui.shared.xtextNature 21 | org.eclipse.jdt.core.javanature 22 | 23 | 24 | -------------------------------------------------------------------------------- /AddressApp-Part-3/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | AddressApp-Part-3 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.xtext.ui.shared.xtextBuilder 15 | 16 | 17 | 18 | 19 | 20 | org.eclipse.xtext.ui.shared.xtextNature 21 | org.eclipse.jdt.core.javanature 22 | 23 | 24 | -------------------------------------------------------------------------------- /AddressApp-Part-4/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | AddressApp-Part-4 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.xtext.ui.shared.xtextBuilder 15 | 16 | 17 | 18 | 19 | 20 | org.eclipse.xtext.ui.shared.xtextNature 21 | org.eclipse.jdt.core.javanature 22 | 23 | 24 | -------------------------------------------------------------------------------- /AddressApp-Part-5/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | AddressApp-Part-5 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.xtext.ui.shared.xtextBuilder 15 | 16 | 17 | 18 | 19 | 20 | org.eclipse.xtext.ui.shared.xtextNature 21 | org.eclipse.jdt.core.javanature 22 | 23 | 24 | -------------------------------------------------------------------------------- /AddressApp-Part-6/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | AddressApp-Part-6 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.xtext.ui.shared.xtextBuilder 15 | 16 | 17 | 18 | 19 | 20 | org.eclipse.xtext.ui.shared.xtextNature 21 | org.eclipse.jdt.core.javanature 22 | 23 | 24 | -------------------------------------------------------------------------------- /AddressApp-Part-7/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | AddressApp-Part-7 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.xtext.ui.shared.xtextBuilder 15 | 16 | 17 | 18 | 19 | 20 | org.eclipse.xtext.ui.shared.xtextNature 21 | org.eclipse.jdt.core.javanature 22 | 23 | 24 | -------------------------------------------------------------------------------- /AddressApp-Part-5/src/ch/makery/address/util/LocalDateAdapter.java: -------------------------------------------------------------------------------- 1 | package ch.makery.address.util; 2 | 3 | import java.time.LocalDate; 4 | 5 | import javax.xml.bind.annotation.adapters.XmlAdapter; 6 | 7 | /** 8 | * Adapter (for JAXB) to convert between the LocalDate and the ISO 8601 9 | * String representation of the date such as '2012-12-03'. 10 | * 11 | * @author Marco Jakob 12 | */ 13 | public class LocalDateAdapter extends XmlAdapter { 14 | 15 | @Override 16 | public LocalDate unmarshal(String v) throws Exception { 17 | return LocalDate.parse(v); 18 | } 19 | 20 | @Override 21 | public String marshal(LocalDate v) throws Exception { 22 | return v.toString(); 23 | } 24 | } -------------------------------------------------------------------------------- /AddressApp-Part-6/src/ch/makery/address/util/LocalDateAdapter.java: -------------------------------------------------------------------------------- 1 | package ch.makery.address.util; 2 | 3 | import java.time.LocalDate; 4 | 5 | import javax.xml.bind.annotation.adapters.XmlAdapter; 6 | 7 | /** 8 | * Adapter (for JAXB) to convert between the LocalDate and the ISO 8601 9 | * String representation of the date such as '2012-12-03'. 10 | * 11 | * @author Marco Jakob 12 | */ 13 | public class LocalDateAdapter extends XmlAdapter { 14 | 15 | @Override 16 | public LocalDate unmarshal(String v) throws Exception { 17 | return LocalDate.parse(v); 18 | } 19 | 20 | @Override 21 | public String marshal(LocalDate v) throws Exception { 22 | return v.toString(); 23 | } 24 | } -------------------------------------------------------------------------------- /AddressApp-Part-7/src/ch/makery/address/util/LocalDateAdapter.java: -------------------------------------------------------------------------------- 1 | package ch.makery.address.util; 2 | 3 | import java.time.LocalDate; 4 | 5 | import javax.xml.bind.annotation.adapters.XmlAdapter; 6 | 7 | /** 8 | * Adapter (for JAXB) to convert between the LocalDate and the ISO 8601 9 | * String representation of the date such as '2012-12-03'. 10 | * 11 | * @author Marco Jakob 12 | */ 13 | public class LocalDateAdapter extends XmlAdapter { 14 | 15 | @Override 16 | public LocalDate unmarshal(String v) throws Exception { 17 | return LocalDate.parse(v); 18 | } 19 | 20 | @Override 21 | public String marshal(LocalDate v) throws Exception { 22 | return v.toString(); 23 | } 24 | } -------------------------------------------------------------------------------- /AddressApp-Part-5/src/ch/makery/address/model/PersonListWrapper.java: -------------------------------------------------------------------------------- 1 | package ch.makery.address.model; 2 | 3 | import java.util.List; 4 | 5 | import javax.xml.bind.annotation.XmlElement; 6 | import javax.xml.bind.annotation.XmlRootElement; 7 | 8 | /** 9 | * Helper class to wrap a list of persons. This is used for saving the 10 | * list of persons to XML. 11 | * 12 | * @author Marco Jakob 13 | */ 14 | @XmlRootElement(name = "persons") 15 | public class PersonListWrapper { 16 | 17 | private List persons; 18 | 19 | @XmlElement(name = "person") 20 | public List getPersons() { 21 | return persons; 22 | } 23 | 24 | public void setPersons(List persons) { 25 | this.persons = persons; 26 | } 27 | } -------------------------------------------------------------------------------- /AddressApp-Part-6/src/ch/makery/address/model/PersonListWrapper.java: -------------------------------------------------------------------------------- 1 | package ch.makery.address.model; 2 | 3 | import java.util.List; 4 | 5 | import javax.xml.bind.annotation.XmlElement; 6 | import javax.xml.bind.annotation.XmlRootElement; 7 | 8 | /** 9 | * Helper class to wrap a list of persons. This is used for saving the 10 | * list of persons to XML. 11 | * 12 | * @author Marco Jakob 13 | */ 14 | @XmlRootElement(name = "persons") 15 | public class PersonListWrapper { 16 | 17 | private List persons; 18 | 19 | @XmlElement(name = "person") 20 | public List getPersons() { 21 | return persons; 22 | } 23 | 24 | public void setPersons(List persons) { 25 | this.persons = persons; 26 | } 27 | } -------------------------------------------------------------------------------- /AddressApp-Part-7/src/ch/makery/address/model/PersonListWrapper.java: -------------------------------------------------------------------------------- 1 | package ch.makery.address.model; 2 | 3 | import java.util.List; 4 | 5 | import javax.xml.bind.annotation.XmlElement; 6 | import javax.xml.bind.annotation.XmlRootElement; 7 | 8 | /** 9 | * Helper class to wrap a list of persons. This is used for saving the 10 | * list of persons to XML. 11 | * 12 | * @author Marco Jakob 13 | */ 14 | @XmlRootElement(name = "persons") 15 | public class PersonListWrapper { 16 | 17 | private List persons; 18 | 19 | @XmlElement(name = "person") 20 | public List getPersons() { 21 | return persons; 22 | } 23 | 24 | public void setPersons(List persons) { 25 | this.persons = persons; 26 | } 27 | } -------------------------------------------------------------------------------- /AddressApp-Part-6/src/ch/makery/address/view/BirthdayStatistics.fxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /AddressApp-Part-7/src/ch/makery/address/view/BirthdayStatistics.fxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /AddressApp-Part-1/src/ch/makery/address/view/RootLayout.fxml: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /AddressApp-Part-2/src/ch/makery/address/view/RootLayout.fxml: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /AddressApp-Part-3/src/ch/makery/address/view/RootLayout.fxml: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /AddressApp-Part-4/src/ch/makery/address/view/RootLayout.fxml: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /AddressApp-Part-2/src/ch/makery/address/view/PersonOverviewController.java: -------------------------------------------------------------------------------- 1 | package ch.makery.address.view; 2 | 3 | import javafx.fxml.FXML; 4 | import javafx.scene.control.Label; 5 | import javafx.scene.control.TableColumn; 6 | import javafx.scene.control.TableView; 7 | import ch.makery.address.MainApp; 8 | import ch.makery.address.model.Person; 9 | 10 | public class PersonOverviewController { 11 | @FXML 12 | private TableView personTable; 13 | @FXML 14 | private TableColumn firstNameColumn; 15 | @FXML 16 | private TableColumn lastNameColumn; 17 | 18 | @FXML 19 | private Label firstNameLabel; 20 | @FXML 21 | private Label lastNameLabel; 22 | @FXML 23 | private Label streetLabel; 24 | @FXML 25 | private Label postalCodeLabel; 26 | @FXML 27 | private Label cityLabel; 28 | @FXML 29 | private Label birthdayLabel; 30 | 31 | // Reference to the main application. 32 | private MainApp mainApp; 33 | 34 | /** 35 | * The constructor. 36 | * The constructor is called before the initialize() method. 37 | */ 38 | public PersonOverviewController() { 39 | } 40 | 41 | /** 42 | * Initializes the controller class. This method is automatically called 43 | * after the fxml file has been loaded. 44 | */ 45 | @FXML 46 | private void initialize() { 47 | // Initialize the person table with the two columns. 48 | firstNameColumn.setCellValueFactory(cellData -> cellData.getValue().firstNameProperty()); 49 | lastNameColumn.setCellValueFactory(cellData -> cellData.getValue().lastNameProperty()); 50 | } 51 | 52 | /** 53 | * Is called by the main application to give a reference back to itself. 54 | * 55 | * @param mainApp 56 | */ 57 | public void setMainApp(MainApp mainApp) { 58 | this.mainApp = mainApp; 59 | 60 | // Add observable list data to the table 61 | personTable.setItems(mainApp.getPersonData()); 62 | } 63 | } -------------------------------------------------------------------------------- /AddressApp-Part-3/src/ch/makery/address/util/DateUtil.java: -------------------------------------------------------------------------------- 1 | package ch.makery.address.util; 2 | 3 | import java.time.LocalDate; 4 | import java.time.format.DateTimeFormatter; 5 | import java.time.format.DateTimeParseException; 6 | 7 | /** 8 | * Helper functions for handling dates. 9 | * 10 | * @author Marco Jakob 11 | */ 12 | public class DateUtil { 13 | 14 | /** The date pattern that is used for conversion. Change as you wish. */ 15 | private static final String DATE_PATTERN = "dd.MM.yyyy"; 16 | 17 | /** The date formatter. */ 18 | private static final DateTimeFormatter DATE_FORMATTER = 19 | DateTimeFormatter.ofPattern(DATE_PATTERN); 20 | 21 | /** 22 | * Returns the given date as a well formatted String. The above defined 23 | * {@link DateUtil#DATE_PATTERN} is used. 24 | * 25 | * @param date the date to be returned as a string 26 | * @return formatted string 27 | */ 28 | public static String format(LocalDate date) { 29 | if (date == null) { 30 | return null; 31 | } 32 | return DATE_FORMATTER.format(date); 33 | } 34 | 35 | /** 36 | * Converts a String in the format of the defined {@link DateUtil#DATE_PATTERN} 37 | * to a {@link LocalDate} object. 38 | * 39 | * Returns null if the String could not be converted. 40 | * 41 | * @param dateString the date as String 42 | * @return the date object or null if it could not be converted 43 | */ 44 | public static LocalDate parse(String dateString) { 45 | try { 46 | return DATE_FORMATTER.parse(dateString, LocalDate::from); 47 | } catch (DateTimeParseException e) { 48 | return null; 49 | } 50 | } 51 | 52 | /** 53 | * Checks the String whether it is a valid date. 54 | * 55 | * @param dateString 56 | * @return true if the String is a valid date 57 | */ 58 | public static boolean validDate(String dateString) { 59 | // Try to parse the String. 60 | return DateUtil.parse(dateString) != null; 61 | } 62 | } -------------------------------------------------------------------------------- /AddressApp-Part-4/src/ch/makery/address/util/DateUtil.java: -------------------------------------------------------------------------------- 1 | package ch.makery.address.util; 2 | 3 | import java.time.LocalDate; 4 | import java.time.format.DateTimeFormatter; 5 | import java.time.format.DateTimeParseException; 6 | 7 | /** 8 | * Helper functions for handling dates. 9 | * 10 | * @author Marco Jakob 11 | */ 12 | public class DateUtil { 13 | 14 | /** The date pattern that is used for conversion. Change as you wish. */ 15 | private static final String DATE_PATTERN = "dd.MM.yyyy"; 16 | 17 | /** The date formatter. */ 18 | private static final DateTimeFormatter DATE_FORMATTER = 19 | DateTimeFormatter.ofPattern(DATE_PATTERN); 20 | 21 | /** 22 | * Returns the given date as a well formatted String. The above defined 23 | * {@link DateUtil#DATE_PATTERN} is used. 24 | * 25 | * @param date the date to be returned as a string 26 | * @return formatted string 27 | */ 28 | public static String format(LocalDate date) { 29 | if (date == null) { 30 | return null; 31 | } 32 | return DATE_FORMATTER.format(date); 33 | } 34 | 35 | /** 36 | * Converts a String in the format of the defined {@link DateUtil#DATE_PATTERN} 37 | * to a {@link LocalDate} object. 38 | * 39 | * Returns null if the String could not be converted. 40 | * 41 | * @param dateString the date as String 42 | * @return the date object or null if it could not be converted 43 | */ 44 | public static LocalDate parse(String dateString) { 45 | try { 46 | return DATE_FORMATTER.parse(dateString, LocalDate::from); 47 | } catch (DateTimeParseException e) { 48 | return null; 49 | } 50 | } 51 | 52 | /** 53 | * Checks the String whether it is a valid date. 54 | * 55 | * @param dateString 56 | * @return true if the String is a valid date 57 | */ 58 | public static boolean validDate(String dateString) { 59 | // Try to parse the String. 60 | return DateUtil.parse(dateString) != null; 61 | } 62 | } -------------------------------------------------------------------------------- /AddressApp-Part-5/src/ch/makery/address/util/DateUtil.java: -------------------------------------------------------------------------------- 1 | package ch.makery.address.util; 2 | 3 | import java.time.LocalDate; 4 | import java.time.format.DateTimeFormatter; 5 | import java.time.format.DateTimeParseException; 6 | 7 | /** 8 | * Helper functions for handling dates. 9 | * 10 | * @author Marco Jakob 11 | */ 12 | public class DateUtil { 13 | 14 | /** The date pattern that is used for conversion. Change as you wish. */ 15 | private static final String DATE_PATTERN = "dd.MM.yyyy"; 16 | 17 | /** The date formatter. */ 18 | private static final DateTimeFormatter DATE_FORMATTER = 19 | DateTimeFormatter.ofPattern(DATE_PATTERN); 20 | 21 | /** 22 | * Returns the given date as a well formatted String. The above defined 23 | * {@link DateUtil#DATE_PATTERN} is used. 24 | * 25 | * @param date the date to be returned as a string 26 | * @return formatted string 27 | */ 28 | public static String format(LocalDate date) { 29 | if (date == null) { 30 | return null; 31 | } 32 | return DATE_FORMATTER.format(date); 33 | } 34 | 35 | /** 36 | * Converts a String in the format of the defined {@link DateUtil#DATE_PATTERN} 37 | * to a {@link LocalDate} object. 38 | * 39 | * Returns null if the String could not be converted. 40 | * 41 | * @param dateString the date as String 42 | * @return the date object or null if it could not be converted 43 | */ 44 | public static LocalDate parse(String dateString) { 45 | try { 46 | return DATE_FORMATTER.parse(dateString, LocalDate::from); 47 | } catch (DateTimeParseException e) { 48 | return null; 49 | } 50 | } 51 | 52 | /** 53 | * Checks the String whether it is a valid date. 54 | * 55 | * @param dateString 56 | * @return true if the String is a valid date 57 | */ 58 | public static boolean validDate(String dateString) { 59 | // Try to parse the String. 60 | return DateUtil.parse(dateString) != null; 61 | } 62 | } -------------------------------------------------------------------------------- /AddressApp-Part-6/src/ch/makery/address/util/DateUtil.java: -------------------------------------------------------------------------------- 1 | package ch.makery.address.util; 2 | 3 | import java.time.LocalDate; 4 | import java.time.format.DateTimeFormatter; 5 | import java.time.format.DateTimeParseException; 6 | 7 | /** 8 | * Helper functions for handling dates. 9 | * 10 | * @author Marco Jakob 11 | */ 12 | public class DateUtil { 13 | 14 | /** The date pattern that is used for conversion. Change as you wish. */ 15 | private static final String DATE_PATTERN = "dd.MM.yyyy"; 16 | 17 | /** The date formatter. */ 18 | private static final DateTimeFormatter DATE_FORMATTER = 19 | DateTimeFormatter.ofPattern(DATE_PATTERN); 20 | 21 | /** 22 | * Returns the given date as a well formatted String. The above defined 23 | * {@link DateUtil#DATE_PATTERN} is used. 24 | * 25 | * @param date the date to be returned as a string 26 | * @return formatted string 27 | */ 28 | public static String format(LocalDate date) { 29 | if (date == null) { 30 | return null; 31 | } 32 | return DATE_FORMATTER.format(date); 33 | } 34 | 35 | /** 36 | * Converts a String in the format of the defined {@link DateUtil#DATE_PATTERN} 37 | * to a {@link LocalDate} object. 38 | * 39 | * Returns null if the String could not be converted. 40 | * 41 | * @param dateString the date as String 42 | * @return the date object or null if it could not be converted 43 | */ 44 | public static LocalDate parse(String dateString) { 45 | try { 46 | return DATE_FORMATTER.parse(dateString, LocalDate::from); 47 | } catch (DateTimeParseException e) { 48 | return null; 49 | } 50 | } 51 | 52 | /** 53 | * Checks the String whether it is a valid date. 54 | * 55 | * @param dateString 56 | * @return true if the String is a valid date 57 | */ 58 | public static boolean validDate(String dateString) { 59 | // Try to parse the String. 60 | return DateUtil.parse(dateString) != null; 61 | } 62 | } -------------------------------------------------------------------------------- /AddressApp-Part-7/src/ch/makery/address/util/DateUtil.java: -------------------------------------------------------------------------------- 1 | package ch.makery.address.util; 2 | 3 | import java.time.LocalDate; 4 | import java.time.format.DateTimeFormatter; 5 | import java.time.format.DateTimeParseException; 6 | 7 | /** 8 | * Helper functions for handling dates. 9 | * 10 | * @author Marco Jakob 11 | */ 12 | public class DateUtil { 13 | 14 | /** The date pattern that is used for conversion. Change as you wish. */ 15 | private static final String DATE_PATTERN = "dd.MM.yyyy"; 16 | 17 | /** The date formatter. */ 18 | private static final DateTimeFormatter DATE_FORMATTER = 19 | DateTimeFormatter.ofPattern(DATE_PATTERN); 20 | 21 | /** 22 | * Returns the given date as a well formatted String. The above defined 23 | * {@link DateUtil#DATE_PATTERN} is used. 24 | * 25 | * @param date the date to be returned as a string 26 | * @return formatted string 27 | */ 28 | public static String format(LocalDate date) { 29 | if (date == null) { 30 | return null; 31 | } 32 | return DATE_FORMATTER.format(date); 33 | } 34 | 35 | /** 36 | * Converts a String in the format of the defined {@link DateUtil#DATE_PATTERN} 37 | * to a {@link LocalDate} object. 38 | * 39 | * Returns null if the String could not be converted. 40 | * 41 | * @param dateString the date as String 42 | * @return the date object or null if it could not be converted 43 | */ 44 | public static LocalDate parse(String dateString) { 45 | try { 46 | return DATE_FORMATTER.parse(dateString, LocalDate::from); 47 | } catch (DateTimeParseException e) { 48 | return null; 49 | } 50 | } 51 | 52 | /** 53 | * Checks the String whether it is a valid date. 54 | * 55 | * @param dateString 56 | * @return true if the String is a valid date 57 | */ 58 | public static boolean validDate(String dateString) { 59 | // Try to parse the String. 60 | return DateUtil.parse(dateString) != null; 61 | } 62 | } -------------------------------------------------------------------------------- /AddressApp-Part-1/src/ch/makery/address/MainApp.java: -------------------------------------------------------------------------------- 1 | package ch.makery.address; 2 | 3 | import java.io.IOException; 4 | 5 | import javafx.application.Application; 6 | import javafx.fxml.FXMLLoader; 7 | import javafx.scene.Scene; 8 | import javafx.scene.layout.AnchorPane; 9 | import javafx.scene.layout.BorderPane; 10 | import javafx.stage.Stage; 11 | 12 | public class MainApp extends Application { 13 | 14 | private Stage primaryStage; 15 | private BorderPane rootLayout; 16 | 17 | @Override 18 | public void start(Stage primaryStage) { 19 | this.primaryStage = primaryStage; 20 | this.primaryStage.setTitle("AddressApp"); 21 | 22 | initRootLayout(); 23 | 24 | showPersonOverview(); 25 | } 26 | 27 | /** 28 | * Initializes the root layout. 29 | */ 30 | public void initRootLayout() { 31 | try { 32 | // Load root layout from fxml file. 33 | FXMLLoader loader = new FXMLLoader(); 34 | loader.setLocation(MainApp.class.getResource("view/RootLayout.fxml")); 35 | rootLayout = (BorderPane) loader.load(); 36 | 37 | // Show the scene containing the root layout. 38 | Scene scene = new Scene(rootLayout); 39 | primaryStage.setScene(scene); 40 | primaryStage.show(); 41 | } catch (IOException e) { 42 | e.printStackTrace(); 43 | } 44 | } 45 | 46 | /** 47 | * Shows the person overview inside the root layout. 48 | */ 49 | public void showPersonOverview() { 50 | try { 51 | // Load person overview. 52 | FXMLLoader loader = new FXMLLoader(); 53 | loader.setLocation(MainApp.class.getResource("view/PersonOverview.fxml")); 54 | AnchorPane personOverview = (AnchorPane) loader.load(); 55 | 56 | // Set person overview into the center of root layout. 57 | rootLayout.setCenter(personOverview); 58 | } catch (IOException e) { 59 | e.printStackTrace(); 60 | } 61 | } 62 | 63 | /** 64 | * Returns the main stage. 65 | * @return 66 | */ 67 | public Stage getPrimaryStage() { 68 | return primaryStage; 69 | } 70 | 71 | public static void main(String[] args) { 72 | launch(args); 73 | } 74 | } -------------------------------------------------------------------------------- /AddressApp-Part-5/src/ch/makery/address/view/RootLayout.fxml: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /AddressApp-Part-6/src/ch/makery/address/view/BirthdayStatisticsController.java: -------------------------------------------------------------------------------- 1 | package ch.makery.address.view; 2 | 3 | import java.text.DateFormatSymbols; 4 | import java.util.Arrays; 5 | import java.util.List; 6 | import java.util.Locale; 7 | 8 | import javafx.collections.FXCollections; 9 | import javafx.collections.ObservableList; 10 | import javafx.fxml.FXML; 11 | import javafx.scene.chart.BarChart; 12 | import javafx.scene.chart.CategoryAxis; 13 | import javafx.scene.chart.XYChart; 14 | import ch.makery.address.model.Person; 15 | 16 | /** 17 | * The controller for the birthday statistics view. 18 | * 19 | * @author Marco Jakob 20 | */ 21 | public class BirthdayStatisticsController { 22 | 23 | @FXML 24 | private BarChart barChart; 25 | 26 | @FXML 27 | private CategoryAxis xAxis; 28 | 29 | private ObservableList monthNames = FXCollections.observableArrayList(); 30 | 31 | /** 32 | * Initializes the controller class. This method is automatically called 33 | * after the fxml file has been loaded. 34 | */ 35 | @FXML 36 | private void initialize() { 37 | // Get an array with the English month names. 38 | String[] months = DateFormatSymbols.getInstance(Locale.ENGLISH).getMonths(); 39 | // Convert it to a list and add it to our ObservableList of months. 40 | monthNames.addAll(Arrays.asList(months)); 41 | 42 | // Assign the month names as categories for the horizontal axis. 43 | xAxis.setCategories(monthNames); 44 | } 45 | 46 | /** 47 | * Sets the persons to show the statistics for. 48 | * 49 | * @param persons 50 | */ 51 | public void setPersonData(List persons) { 52 | // Count the number of people having their birthday in a specific month. 53 | int[] monthCounter = new int[12]; 54 | for (Person p : persons) { 55 | int month = p.getBirthday().getMonthValue() - 1; 56 | monthCounter[month]++; 57 | } 58 | 59 | XYChart.Series series = new XYChart.Series<>(); 60 | 61 | // Create a XYChart.Data object for each month. Add it to the series. 62 | for (int i = 0; i < monthCounter.length; i++) { 63 | series.getData().add(new XYChart.Data<>(monthNames.get(i), monthCounter[i])); 64 | } 65 | 66 | barChart.getData().add(series); 67 | } 68 | } -------------------------------------------------------------------------------- /AddressApp-Part-7/src/ch/makery/address/view/BirthdayStatisticsController.java: -------------------------------------------------------------------------------- 1 | package ch.makery.address.view; 2 | 3 | import java.text.DateFormatSymbols; 4 | import java.util.Arrays; 5 | import java.util.List; 6 | import java.util.Locale; 7 | 8 | import javafx.collections.FXCollections; 9 | import javafx.collections.ObservableList; 10 | import javafx.fxml.FXML; 11 | import javafx.scene.chart.BarChart; 12 | import javafx.scene.chart.CategoryAxis; 13 | import javafx.scene.chart.XYChart; 14 | import ch.makery.address.model.Person; 15 | 16 | /** 17 | * The controller for the birthday statistics view. 18 | * 19 | * @author Marco Jakob 20 | */ 21 | public class BirthdayStatisticsController { 22 | 23 | @FXML 24 | private BarChart barChart; 25 | 26 | @FXML 27 | private CategoryAxis xAxis; 28 | 29 | private ObservableList monthNames = FXCollections.observableArrayList(); 30 | 31 | /** 32 | * Initializes the controller class. This method is automatically called 33 | * after the fxml file has been loaded. 34 | */ 35 | @FXML 36 | private void initialize() { 37 | // Get an array with the English month names. 38 | String[] months = DateFormatSymbols.getInstance(Locale.ENGLISH).getMonths(); 39 | // Convert it to a list and add it to our ObservableList of months. 40 | monthNames.addAll(Arrays.asList(months)); 41 | 42 | // Assign the month names as categories for the horizontal axis. 43 | xAxis.setCategories(monthNames); 44 | } 45 | 46 | /** 47 | * Sets the persons to show the statistics for. 48 | * 49 | * @param persons 50 | */ 51 | public void setPersonData(List persons) { 52 | // Count the number of people having their birthday in a specific month. 53 | int[] monthCounter = new int[12]; 54 | for (Person p : persons) { 55 | int month = p.getBirthday().getMonthValue() - 1; 56 | monthCounter[month]++; 57 | } 58 | 59 | XYChart.Series series = new XYChart.Series<>(); 60 | 61 | // Create a XYChart.Data object for each month. Add it to the series. 62 | for (int i = 0; i < monthCounter.length; i++) { 63 | series.getData().add(new XYChart.Data<>(monthNames.get(i), monthCounter[i])); 64 | } 65 | 66 | barChart.getData().add(series); 67 | } 68 | } -------------------------------------------------------------------------------- /AddressApp-Part-6/src/ch/makery/address/view/RootLayout.fxml: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /AddressApp-Part-7/src/ch/makery/address/view/RootLayout.fxml: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /AddressApp-Part-3/src/ch/makery/address/view/PersonEditDialog.fxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 38 | 39 | 40 | 41 |