Skip to content

Commit

Permalink
Merge branch 'develop' into stable
Browse files Browse the repository at this point in the history
  • Loading branch information
manuel-mauky committed Jan 12, 2015
2 parents c3e8f56 + 65de4e3 commit 24b4bcc
Show file tree
Hide file tree
Showing 57 changed files with 1,291 additions and 316 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ env:
- secure: Bm0zIwBo4saIBlfr9YDvNqd8UN50FeT2hZyum3RFDmJqaXiUqwxw7sCz/lRjUwTfQrvGJXQ1I8le7zE4OVQdvpn4/LwwTJIjLY2jZNjzs4mZhkHzsM5IcGcL3lukR6soVYrGloQwmw63Okw2kZxces+1fveisPIKDlVaU1RTtMQ=

after_success:
- "[[ $TRAVIS_BRANCH == \"develop\" ]] && { python addServer.py; mvn clean deploy -DskipTests=true --settings ~/.m2/mySettings.xml; };"
- "[[ $TRAVIS_BRANCH == \"develop\" ]] && { python addServer.py; mvn clean deploy -pl 'mvvmfx,mvvmfx-cdi,mvvmfx-guice,mvvmfx-archetype' -am -DskipTests=true --settings ~/.m2/mySettings.xml; };"
29 changes: 20 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,39 @@ __mvvm(fx)__ is an application framework which provides you necessary components

__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.

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

###[Howto](../../wiki "Howto")###

###Maven dependency###
### Maven dependency###

#### Stable Release
```
<dependency>
<groupId>de.saxsys</groupId>
<artifactId>mvvmfx</artifactId>
<version>1.0.0</version>
</dependency>
```

#### Development Snapshot
```
<dependency>
<groupId>de.saxsys</groupId>
<artifactId>mvvmFX</artifactId>
<version>0.4.0</version>
<artifactId>mvvmfx</artifactId>
<version>1.1.0-SNAPSHOT</version>
</dependency>
```


### Get Help

If you need help you can use the forums on [Google Groups](https://groups.google.com/forum/#!forum/mvvmfx-dev) for asking questions and interacting with the mvvmFX developers. Additionally you can create issues, report bugs and add feature requests on the issue tracker at [github](https://github.com/sialcasa/mvvmFX/issues).

### Links

[javadoc mvvmfx core](http://sialcasa.github.io/mvvmFX/javadoc/0.4.0/mvvmfx/)
- [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-cdi](http://sialcasa.github.io/mvvmFX/javadoc/0.4.0/mvvmfx-cdi/)

[javadoc mvvmfx-guice](http://sialcasa.github.io/mvvmFX/javadoc/0.4.0/mvvmfx-guice/)

[![Build Status](https://travis-ci.org/sialcasa/mvvmFX.svg?branch=develop)](https://travis-ci.org/sialcasa/mvvmFX)
28 changes: 28 additions & 0 deletions deploy_release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/sh

# Script for the deployment of releases to maven central
#
# Expecting a "settings-mvvmfx.xml" file in maven_home with the authentication configuration for the central repository.
#
# The settings file should look something like this:
#
# <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
# xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
# xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
# http://maven.apache.org/xsd/settings-1.0.0.xsd">
#
# <servers>
# <server>
# <id>sonatype-nexus-snapshots</id>
# <username>YOUR USERNAME</username>
# <password>YOUR PASSWORD</password>
# </server>
# <server>
# <id>sonatype-nexus-staging</id>
# <username>YOUR USERNAME</username>
# <password>YOUR PASSWORD</password>
# </server>
# </servers>
# </settings>

mvn clean deploy -pl 'mvvmfx,mvvmfx-cdi,mvvmfx-guice,mvvmfx-archetype' -am -DskipTests=true -Pdeploy-release --settings ~/.m2/settings-mvvmfx.xml
4 changes: 4 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@ as dependency injection framework.
- **mvvmfx-fx-root-example**: contains a small custom control that uses the fx:root element together with mvvmfx.
- **mvvmfx-helloworld-example**: A simple hello world view. This example is used in the [Getting Started/Step-by-Step tutorial](/../../wiki/Getting-Started-HelloWorld-%28deutsch%29).
- **mvvmfx-helloworld-without-fxml**: A hello world example that shows hot to use MvvmFX with a view implemented in pure Java and not with FXML.
- **mvvmfx-contacts**: A contact management application. This example shows a master-detail view, dialogs and the usage of CDI including CDI-Events.
This example also integrates some other JavaFX community libraries.
- **mvvmfx-synchronizefx**: This example uses the library [SynchronizeFX](https://github.com/saxsys/SynchronizeFX) to create a distributed ViewModel.
This way the state of the UI of different instances of the App (on different JVM's, on different computers) is always synchronized between the apps.
24 changes: 24 additions & 0 deletions examples/mvvmfx-books-example/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# MvvmFX Books Example

This example app is a client for a library REST service. You can search for books and view the
details of found books in a master-detail view.

![screenshot](screenshot.png)

This example was used for [a talk](http://www.jug-gr.de/2014/12/03/model-view-star.html) at the
[JavaUserGroup Görlitz](http://www.jug-gr.de) on [UI-Design patterns](https://github.com/lestard/model-view-star).

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.


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
102 changes: 102 additions & 0 deletions examples/mvvmfx-books-example/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
<?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>

<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>

<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>

<!-- 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>


<!-- 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>


</project>
Binary file added examples/mvvmfx-books-example/screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
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);
}
}

Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package de.saxsys.mvvmfx.examples.books;


import de.saxsys.mvvmfx.examples.books.backend.Book;

public class BookViewModel {

private final Book book;

public BookViewModel(Book book){
this.book = book;
}

public String getTitle(){
return book.getTitle();
}

public String getAuthor(){
return book.getAuthor();
}

public String getDescription(){
return book.getDesc();
}

@Override
public String toString() {
return getTitle();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
package de.saxsys.mvvmfx.examples.books;

import de.saxsys.mvvmfx.FxmlView;
import de.saxsys.mvvmfx.InjectViewModel;
import javafx.fxml.FXML;
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.ListView;
import javafx.scene.control.TextField;

public class MainView implements FxmlView<MainViewModel> {


@FXML
private Label titleLabel;

@FXML
private Label authorLabel;

@FXML
private TextField searchTextField;

@FXML
private Button searchButton;

@FXML
private Label descriptionLabel;

@FXML
private ListView<BookViewModel> bookList;

@FXML
private Label errorLabel;

@InjectViewModel
private MainViewModel viewModel;

public void initialize(){
searchTextField.textProperty().bindBidirectional(viewModel.searchStringProperty());
titleLabel.textProperty().bind(viewModel.bookTitleProperty());
authorLabel.textProperty().bind(viewModel.bookAuthorProperty());
descriptionLabel.textProperty().bind(viewModel.bookDescriptionProperty());

bookList.setItems(viewModel.booksProperty());

viewModel.selectedBookProperty().bind(bookList.getSelectionModel().selectedItemProperty());
errorLabel.textProperty().bind(viewModel.errorProperty());
}

public void searchButtonPressed() {
viewModel.search();
}
}
Loading

0 comments on commit 24b4bcc

Please sign in to comment.