Skip to content

Commit

Permalink
Modularize Showcase Demo Application fix #162
Browse files Browse the repository at this point in the history
  • Loading branch information
sbordes committed Apr 6, 2016
1 parent d0b6300 commit 22c42f9
Show file tree
Hide file tree
Showing 8 changed files with 194 additions and 129 deletions.
194 changes: 187 additions & 7 deletions org.jrebirth.af/showcase/demo/pom.xml
Expand Up @@ -6,7 +6,7 @@
<version>8.1.0-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>

<groupId>org.jrebirth.af.showcase</groupId>
<artifactId>demo</artifactId>
<packaging>jar</packaging>
Expand All @@ -20,7 +20,9 @@
<deployUrl>http://apps.jrebirth.org</deployUrl>
<deployPath>${project.artifactId}/${project.version}</deployPath>

<jnlpFilename>JRebirthAnalyzer.jnlp</jnlpFilename>
<appName>JRebirthDemo</appName>

<jnlpFilename>JRebirthDemo.jnlp</jnlpFilename>
<appClass>org.jrebirth.af.showcase.demo.JRebirthDemo</appClass>

<appletWidth>1024</appletWidth>
Expand All @@ -30,33 +32,211 @@

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>

<configuration>
<archive>
<manifestEntries>
<JavaFX-Version>8.0</JavaFX-Version>
<Main-Class>${appClass}</Main-Class>
<JavaFX-Application-Class>${appClass}</JavaFX-Application-Class>
</manifestEntries>

<manifest>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
<addClasspath>true</addClasspath>
</manifest>
</archive>
</configuration>
</plugin>

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>webstart-maven-plugin</artifactId>
<version>1.0-beta-6</version>

<dependencies>
<dependency>
<groupId>org.codehaus.mojo</groupId>
<artifactId>keytool-api-1.7</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>org.codehaus.mojo</groupId>
<artifactId>webstart-pack200-impl</artifactId>
<version>1.0-beta-6</version>
</dependency>
</dependencies>

<executions>
<execution>
<phase>package</phase>
<goals>
<goal>jnlp-inline</goal>
</goals>
</execution>
</executions>

<configuration>

<filenameMapping>full</filenameMapping>

<updateManifestEntries>
<Application-Name>${project.name}</Application-Name>
<Trusted-Library>true</Trusted-Library>
<Permissions>${permissions}</Permissions>
<Codebase>${codebase}</Codebase>
<Trusted-Only>true</Trusted-Only>
</updateManifestEntries>


<excludeTransitive>false</excludeTransitive>

<libPath>lib</libPath>
<codebase>${codebase}</codebase>

<jnlp>
<outputFile>${jnlpFilename}</outputFile>
<mainClass>${appClass}</mainClass>
<offlineAllowed>true</offlineAllowed>
<allPermissions>true</allPermissions>
</jnlp>

<sign>
<keystore>${keystore}</keystore>
<keypass>${keypass}</keypass>
<storepass>${storepass}</storepass>
<storetype>${storetype}</storetype>

<alias>${keyalias}</alias>

<validity>360</validity>
<dnameCn>JRebirth Self-signed Certificate</dnameCn>
<dnameOu>JRebirth OSS</dnameOu>
<dnameO>JRebirth</dnameO>
<dnameL>Toulouse</dnameL>
<dnameSt>Haute-Garonne</dnameSt>
<dnameC>FR</dnameC>
<verify>true</verify>

<keystoreConfig>
<delete>${deletekeystore}</delete>
<gen>${genkeystore}</gen>
</keystoreConfig>

</sign>

<unsignAlreadySignedJars>true</unsignAlreadySignedJars>

<pack200>
<enabled>true</enabled>
</pack200>
<gzip>true</gzip>

<outputJarVersions>false</outputJarVersions>

<verbose>true</verbose>
</configuration>

</plugin>


<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4.3</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
<configuration>
<shadedArtifactAttached>false</shadedArtifactAttached>
<shadedClassifierName>shaded</shadedClassifierName>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>${appClass}</mainClass>
<manifestEntries>
<Class-Path>.</Class-Path>
</manifestEntries>
</transformer>
</transformers>
</configuration>
</plugin>
<plugin>
<groupId>com.akathist.maven.plugins.launch4j</groupId>
<artifactId>launch4j-maven-plugin</artifactId>
<version>1.5.1</version>
<executions>
<execution>
<id>l4j-clui</id>
<phase>package</phase>
<goals>
<goal>launch4j</goal>
</goals>
<configuration>
<headerType>gui</headerType>
<jar>${project.build.directory}/${groupId}.${artifactId}-${version}.jar</jar>
<outfile>${project.build.directory}/${appName}.exe</outfile>
<downloadUrl>http://java.com/download</downloadUrl>
<classPath>
<mainClass>${appClass}</mainClass>
<addDependencies>false</addDependencies>
<preCp>.</preCp>
</classPath>
<icon>src/main/resources/images/JRebirth_64x64.ico</icon>
<jre>
<minVersion>1.8.0</minVersion>
<jdkPreference>preferJre</jdkPreference>
</jre>
<versionInfo>
<fileVersion>1.0.0.0</fileVersion>
<txtFileVersion>${project.version}</txtFileVersion>
<fileDescription>${project.name}</fileDescription>
<copyright>JRebirth 2016</copyright>
<productVersion>1.0.0.0</productVersion>
<txtProductVersion>1.0.0.0</txtProductVersion>
<productName>${project.name}</productName>
<companyName>JRebirth</companyName>
<internalName>${project.name}</internalName>
<originalFilename>${appName}.exe</originalFilename>
</versionInfo>
</configuration>
</execution>
</executions>
</plugin>

</plugins>
</build>

<dependencies>
<dependency>
<groupId>org.jrebirth.af</groupId>
<artifactId>processor</artifactId>
<version>8.1.0-SNAPSHOT</version>
<scope>provided</scope>
</dependency>

<!-- Modules -->
<dependency>
<groupId>org.jrebirth.af.showcase</groupId>
<artifactId>fxml</artifactId>
<artifactId>undoredo</artifactId>
<version>8.1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.jrebirth.af.showcase</groupId>
<artifactId>undoredo</artifactId>
<artifactId>fxml</artifactId>
<version>8.1.0-SNAPSHOT</version>
</dependency>

</dependencies>

</project>
@@ -1,3 +1,4 @@
package org.jrebirth.af.showcase.demo;

/**
* Get more info at : www.jrebirth.org .
Expand Down
Expand Up @@ -17,8 +17,8 @@
*/
package org.jrebirth.af.showcase.demo.ui;

import javafx.event.ActionEvent;
import javafx.scene.control.Button;
import javafx.scene.input.MouseEvent;

import org.jrebirth.af.api.exception.CoreException;
import org.jrebirth.af.api.key.UniqueKey;
Expand Down Expand Up @@ -46,7 +46,7 @@ public MainController(final MainView view) throws CoreException {
super(view);
}

public void onButtonClicked(MouseEvent event) {
public void onButtonFired(ActionEvent event) {
final Button b = (Button) event.getSource();
final UniqueKey<? extends Model> data = (UniqueKey<? extends Model>) b.getUserData();

Expand Down
Expand Up @@ -45,18 +45,14 @@ protected void initModel() {
for (final ModuleModel mm : getModels(ModuleModel.class)) {
modules.add(mm);
}

getView().getRootNode().setCenter(stackModel.getRootNode());

}

/**
* {@inheritDoc}
*/
@Override
protected void showView() {
// Nothing to do yet

getView().getRootNode().setCenter(stackModel.getRootNode());
}

/**
Expand Down
Expand Up @@ -83,7 +83,7 @@ private Node createMenu() {

private Node createModuleButton(ModuleModel mm) {
final Button b = new Button(mm.moduleName());
b.setOnMouseClicked(getController()::onButtonClicked);
b.setOnAction(getController()::onButtonFired);
b.setUserData(Key.create(mm.getClass()));
buttonList.add(b);
return b;
Expand Down
Binary file not shown.
Expand Up @@ -30,7 +30,6 @@ protected void initModel() {

stackModel = getModel(StackModel.class, FXMLPage.class);

getView().getRootNode().setCenter(stackModel.getRootNode());
}

/**
Expand All @@ -39,6 +38,7 @@ protected void initModel() {
@Override
protected void showView() {
super.showView();
getView().getRootNode().setCenter(stackModel.getRootNode());

// getModel(StackModel.class, FXMLPage.class).doShowView(null);
}
Expand Down

0 comments on commit 22c42f9

Please sign in to comment.