Skip to content

Commit

Permalink
Merge commit '86a4cf4d39abd3cf8ea94a4b62af1b60cc32672e' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
manuel-mauky committed May 4, 2015
2 parents 24b4bcc + 86a4cf4 commit 5cfc304
Show file tree
Hide file tree
Showing 258 changed files with 12,028 additions and 8,004 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@
same "printed page" as the copyright notice for easier
identification within third-party archives.

Copyright 2013 Alexander Casall
Copyright 2015 Alexander Casall, Manuel Mauky

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
14 changes: 8 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

__mvvm(fx)__ is an application framework which provides you necessary components to implement the [MVVM](../../wiki/MVVM "MVVM") pattern with JavaFX.

__MVVM__ is the enhanced version of the [Presentation Model](http://martinfowler.com/eaaDev/PresentationModel.html "Presentation Model") pattern and was created by Microsoft engineers for [WPF](http://msdn.microsoft.com/en-us/library/ms754130.aspx "WPF") . JavaFX and WPF does have similarities like Databinding and descriptive UI declaration (FXML/XAML). Because of this fact we aptopt best practices of the development with the Microsoft technology.
__MVVM__ is the enhanced version of the [Presentation Model](http://martinfowler.com/eaaDev/PresentationModel.html "Presentation Model") pattern and was created by Microsoft engineers for [WPF](http://msdn.microsoft.com/en-us/library/ms754130.aspx "WPF") . JavaFX and WPF does have similarities like Databinding and descriptive UI declaration (FXML/XAML). Because of this fact we adopt best practices of the development with the Microsoft technology.

[![Build Status](https://travis-ci.org/sialcasa/mvvmFX.svg?branch=develop)](https://travis-ci.org/sialcasa/mvvmFX)

Expand All @@ -15,7 +15,7 @@ __MVVM__ is the enhanced version of the [Presentation Model](http://martinfowler
<dependency>
<groupId>de.saxsys</groupId>
<artifactId>mvvmfx</artifactId>
<version>1.0.0</version>
<version>1.1.0</version>
</dependency>
```

Expand All @@ -24,7 +24,7 @@ __MVVM__ is the enhanced version of the [Presentation Model](http://martinfowler
<dependency>
<groupId>de.saxsys</groupId>
<artifactId>mvvmfx</artifactId>
<version>1.1.0-SNAPSHOT</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
```

Expand All @@ -36,7 +36,9 @@ If you need help you can use the forums on [Google Groups](https://groups.google
### Links

- [Project Page](http://sialcasa.github.io/mvvmFX/)
- [javadoc mvvmfx core](http://sialcasa.github.io/mvvmFX/javadoc/1.0.0/mvvmfx/)
- [javadoc mvvmfx-cdi](http://sialcasa.github.io/mvvmFX/javadoc/1.0.0/mvvmfx-cdi/)
- [javadoc mvvmfx-guice](http://sialcasa.github.io/mvvmFX/javadoc/1.0.0/mvvmfx-guice/)
- [javadoc mvvmfx core](http://sialcasa.github.io/mvvmFX/javadoc/1.1.0/mvvmfx/)
- [javadoc mvvmfx-cdi](http://sialcasa.github.io/mvvmFX/javadoc/1.1.0/mvvmfx-cdi/)
- [javadoc mvvmfx-guice](http://sialcasa.github.io/mvvmFX/javadoc/1.1.0/mvvmfx-guice/)
- [javadoc mvvmfx-utils](http://sialcasa.github.io/mvvmFX/javadoc/1.1.0/mvvmfx-utils/)
- [javadoc mvvmfx-testing-utils](http://sialcasa.github.io/mvvmFX/javadoc/1.1.0/mvvmfx-testing-utils/)

2 changes: 1 addition & 1 deletion deploy_release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@
# </servers>
# </settings>

mvn clean deploy -pl 'mvvmfx,mvvmfx-cdi,mvvmfx-guice,mvvmfx-archetype' -am -DskipTests=true -Pdeploy-release --settings ~/.m2/settings-mvvmfx.xml
mvn clean deploy -pl 'mvvmfx,mvvmfx-cdi,mvvmfx-guice,mvvmfx-archetype,mvvmfx-utils,mvvmfx-testing-utils' -am -DskipTests=true -Pdeploy-release --settings ~/.m2/settings-mvvmfx.xml
1 change: 1 addition & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

Content:

- **mvvmfx-books-example**: An app to search for books in a library. Connects to a REST backend.
- **mvvmfx-complex-example**: contains the user interface and logic code for an example application.
To run this example you need either mvvmfx-cdi-starter or mvvmfx-guice-starter.
- **mvvmfx-cdi-starter**: contains the startup code to run the mvvmfx-complex-example with CDI/Weld
Expand Down
28 changes: 25 additions & 3 deletions examples/mvvmfx-books-example/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,37 @@ This example was used for [a talk](http://www.jug-gr.de/2014/12/03/model-view-st

Originally [this app](https://github.com/sbley/hypermedia-library-client/tree/javafx) was created by [Stefan Bley](https://github.com/sbley) and
[Alexander Casall](https://github.com/sialcasa) for a talk on Hypermedia-APIs.
To run the app you need to have the [Hypermedia-API server](https://github.com/sbley/hypermedia-library-server)
up and running on `localhost` so that the client can make the necessary REST-Requests.

### Run the example with a inmemory mock backend

By default this examples uses an inmemory backend were the books are stored in a simple `Set`.
This is for easy testing and for people who don't like to download and setup the REST backend.

### Run the example with a REST backend

The example can also be used with a "real" REST-Backend that Stefan Bley has used it for his talk.
To setup the app with the REST-Backend follow these steps:
- git clone the hypermedia server from [https://github.com/sbley/hypermedia-library-server](https://github.com/sbley/hypermedia-library-server)
- open up a command line and change into the cloned directory
- run `mvn clean install` to build the hypermedia server
- run `mvn wildfly:run`. This will download the server runtime and startup the server automatically.

After a few seconds you will see a message like "... Deployed "ear-0.0.1-SNAPSHOT.ear" ...". This means everything is ok and the server is running.

To tell the client application to use the REST-Backend instead of the immemory mock backend you have to change the flag
[ENABLE_MOCK_SERVICE](/examples/mvvmfx-books-example/src/main/java/de/saxsys/mvvmfx/examples/books/App.java#L21)
in the class `de.saxsys.mvvmfx.examples.books.App` to `false`.

Now you can start the client app `de.saxsys.mvvmfx.examples.books.App` and play around with the example.


## Used third party libraries
The app uses the following libraries (among others):

- [FontAwesomeFX](https://bitbucket.org/Jerady/fontawesomefx) // Icons
- [FlatterFX](http://www.guigarage.com/javafx-themes/flatter/) // Styling
- [Advanced-Bindings](https://github.com/lestard/advanced-bindings) // Binding-Utils
- [EasyDI](https://github.com/lestard/EasyDI) // Dependency-Injection
- [AssertJ-JavaFX](https://github.com/lestard/assertj-javafx) // Testing
- [HALBuilder](https://github.com/HalBuilder) // REST-Client
- [HALBuilder](https://github.com/HalBuilder) // REST-Client
- [TestFX](https://github.com/TestFX/TestFX) // Integration-Test
180 changes: 92 additions & 88 deletions examples/mvvmfx-books-example/pom.xml
Original file line number Diff line number Diff line change
@@ -1,102 +1,106 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>mvvmfx-examples</artifactId>
<groupId>de.saxsys</groupId>
<version>1.0.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>mvvmfx-examples</artifactId>
<groupId>de.saxsys</groupId>
<version>1.1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>mvvmfx-library-example</artifactId>
<artifactId>mvvmfx-library-example</artifactId>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
</properties>

<dependencies>
<dependency>
<groupId>de.saxsys</groupId>
<artifactId>mvvmfx</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>eu.lestard</groupId>
<artifactId>easy-di</artifactId>
<version>0.1.0</version>
</dependency>
<dependency>
<groupId>de.jensd</groupId>
<artifactId>fontawesomefx</artifactId>
<version>8.0.10</version>
</dependency>
<dependency>
<groupId>com.guigarage</groupId>
<artifactId>flatter</artifactId>
<version>0.7</version>
</dependency>
<dependency>
<groupId>eu.lestard</groupId>
<artifactId>advanced-bindings</artifactId>
<version>0.2.0</version>
</dependency>
<dependencies>
<dependency>
<groupId>de.saxsys</groupId>
<artifactId>mvvmfx</artifactId>
<version>${project.parent.version}</version>
</dependency>
<dependency>
<groupId>eu.lestard</groupId>
<artifactId>easy-di</artifactId>
<version>0.2.0</version>
</dependency>
<dependency>
<groupId>de.jensd</groupId>
<artifactId>fontawesomefx</artifactId>
<version>8.0.13</version>
</dependency>
<dependency>
<groupId>com.guigarage</groupId>
<artifactId>flatter</artifactId>
<version>0.7</version>
</dependency>
<dependency>
<groupId>eu.lestard</groupId>
<artifactId>advanced-bindings</artifactId>
</dependency>

<!-- Backend -->
<dependency>
<groupId>com.theoryinpractise</groupId>
<artifactId>halbuilder-json</artifactId>
<version>4.0.2</version>
</dependency>
<dependency>
<groupId>com.theoryinpractise</groupId>
<artifactId>halbuilder-jaxrs</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-client</artifactId>
<version>3.0.9.Final</version>
</dependency>
<!-- Backend -->
<dependency>
<groupId>com.theoryinpractise</groupId>
<artifactId>halbuilder-json</artifactId>
<version>4.0.2</version>
</dependency>
<dependency>
<groupId>com.theoryinpractise</groupId>
<artifactId>halbuilder-jaxrs</artifactId>
<version>1.1.1</version>
</dependency>
<dependency>
<groupId>org.jboss.resteasy</groupId>
<artifactId>resteasy-client</artifactId>
<version>3.0.9.Final</version>
</dependency>


<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.1.2</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.1.2</version>
</dependency>


<!-- Testing -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<!-- Testing -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>eu.lestard</groupId>
<artifactId>assertj-javafx</artifactId>
<version>0.2.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>eu.lestard</groupId>
<artifactId>assertj-javafx</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.loadui</groupId>
<artifactId>testFx</artifactId>
<version>3.1.0</version>
<scope>test</scope>
</dependency>
</dependencies>


</project>
Original file line number Diff line number Diff line change
@@ -1,40 +1,53 @@
package de.saxsys.mvvmfx.examples.books;

import com.guigarage.flatterfx.FlatterFX;
import com.guigarage.flatterfx.FlatterInputType;
import de.saxsys.mvvmfx.FluentViewLoader;
import de.saxsys.mvvmfx.MvvmFX;
import de.saxsys.mvvmfx.examples.books.backend.LibraryService;
import de.saxsys.mvvmfx.examples.books.backend.LibraryServiceImpl;
import eu.lestard.easydi.EasyDI;
import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.paint.Color;
import javafx.stage.Stage;

public class App extends Application {

public static void main(String[] args) {
launch(args);
}

@Override
public void start(Stage primaryStage) throws Exception {
EasyDI context = new EasyDI();
context.bindInterface(LibraryService.class, LibraryServiceImpl.class);
MvvmFX.setCustomDependencyInjector(context::getInstance);

primaryStage.setTitle("Library JavaFX");
primaryStage.setMinWidth(1200);
primaryStage.setMaxWidth(1200);
primaryStage.setMinHeight(700);

Scene scene = new Scene(FluentViewLoader.fxmlView(MainView.class).load().getView(), 1200, 700);

scene.setFill(Color.TRANSPARENT);
primaryStage.setScene(scene);
primaryStage.show();
FlatterFX.style(FlatterInputType.DEFAULT);
}
}

package de.saxsys.mvvmfx.examples.books;

import javafx.application.Application;
import javafx.scene.Scene;
import javafx.scene.paint.Color;
import javafx.stage.Stage;

import com.guigarage.flatterfx.FlatterFX;
import com.guigarage.flatterfx.FlatterInputType;

import de.saxsys.mvvmfx.FluentViewLoader;
import de.saxsys.mvvmfx.MvvmFX;
import de.saxsys.mvvmfx.examples.books.backend.LibraryService;
import de.saxsys.mvvmfx.examples.books.backend.LibraryServiceImpl;
import de.saxsys.mvvmfx.examples.books.backend.LibraryServiceMockImpl;
import eu.lestard.easydi.EasyDI;

public class App extends Application {

private static final boolean ENABLE_MOCK_SERVICE = true;

private EasyDI context = new EasyDI();


public static void main(String[] args) {
launch(args);
}

@Override
public void start(Stage primaryStage) throws Exception {
if (ENABLE_MOCK_SERVICE) {
context.bindInterface(LibraryService.class, LibraryServiceMockImpl.class);
LibraryServiceMockImpl libraryServiceMock = context.getInstance(LibraryServiceMockImpl.class);
libraryServiceMock.addSomeBooks();
} else {
context.bindInterface(LibraryService.class, LibraryServiceImpl.class);
}


MvvmFX.setCustomDependencyInjector(type -> context.getInstance(type));

primaryStage.setTitle("Library JavaFX");
primaryStage.setMinWidth(1200);
primaryStage.setMaxWidth(1200);
primaryStage.setMinHeight(700);

Scene scene = new Scene(FluentViewLoader.fxmlView(MainView.class).load().getView());
scene.setFill(Color.TRANSPARENT);
primaryStage.setScene(scene);
primaryStage.show();
FlatterFX.style(FlatterInputType.DEFAULT);
}
}
Loading

0 comments on commit 5cfc304

Please sign in to comment.