« JSoaggerFX » concept is to build JavaFX IHM from « XML » or « JSON » configuration file.
Each node on the scene is a reusable, configurable and injectable component, described by a configuration file.
The visual IHM is a group of independent components, integrated at runtime by a dependency injection Framework. By default we use « Spring Framework » to assemble the view at runtime. But application framework have been configured to support custom IOC framework.
Builded UI is Responsive, Adaptative and material designed. It can be easily connected to remote cloud server.
With JSoaggerFX, views are described by XML/JSON files and processed by JSoaggerJFX processor.
That's why « JSoaggerFX » upon JavaFX gives developers ability to quickly realise multiplatform application and reuse components as library through mutiple projects.
JSoaggerFX uses a container to manage bean instance. Best practice is to not intanciate manually a component but get an instance from bean manager.
IComponent component = Services.getBean("MyTableViewIdentifier");
component.build(controller, configuration);
JSoaggerFX can be launched with Spring framework as IOC container and bean instances manager. All spring XML configuration files are already packaged inside framework.
ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext();
context.setConfigLocation("classpath:get-started-application-context.xml");
context.refresh();
context.registerShutdownHook();
this.viewStructure = (ViewStructure) Services.getBean("platformViewStructure");
this.viewStructure.buildStructure();
In fact Spring is a RUNTIME ONLY DEPENDENCY, i.e, there is no spring annotation nor spring class used inside framework, except the application launcher.
JSoaggerFX uses XMLCombiner to manage component XML configuration. XMLCombiner gives us ability to merge multiple XML files while removing/adding nodes in output file.
It gives us the ability te reuse and by the way override some attributes of a component, while keeping the source code clean and maintenable.
Example, display the same view without primary menu
- The view With primary menu
<view id="Root" combine.keys="id">
<component id="Content" combine.keys="id">
<properties combine.keys="name">
<property name="headerView" value="PrimaryHeaderToolbarView" />
<property name="primaryMenuView" value="PrimaryMenuView" />
<property name="contentRootStructure" value="GetStartedRSContentView" />
</properties>
</component>
</view>
- Same view Without primary menu
<view id="Root" combine.keys="id">
<component id="Content" combine.keys="id">
<properties combine.keys="name">
<property name="primaryMenuView" combine.self="remove" />
</properties>
</component>
</view>
Each component can be made responsive and adaptative by defining a responsive matrix. Responsive matrix describes the component behaviour according to its parent width.
<util:list id="NavigationBarResponsiveMatrixDefinition" list-class="java.util.ArrayList" value-type="java.lang.String">
<value>0:830#0.50:fixed|500:0.50#:minimize:</value>
<value>830:1000#0.30:0.30:0.40#minimize::</value>
<value>1000#0.40:0.20:0.40#::</value>
</util:list>
This examples configure header component toolbar to behave like following :
- minimize the component on its center and set its width to 500
- set the left node size to 0.50% of remaining
- set the right node size to 0.50% of remaining
Javafx libraries are not included with JDK11, JavaFX runtime must be configured as maven dependencies.
> java -version
java version "1.8.0_65"
Java(TM) SE Runtime Environment (build 1.8.0_65-b17)
Java HotSpot(TM) 64-Bit Server VM (build 25.65-b01, mixed mode)
mvn package
Demo application shows part of JSoaggerFX capabilities.
- Download a version of the demo for your OS from following links:
Platform | Status | Download Demo |
---|---|---|
MacOs | Download | |
Linux | Download | |
Windows | Download |
- Unzip it
> unzip jsoagger-jfxcore-demoapp-macos-11.0.3.zip
> cd jsoagger-jfxcore-demoapp-macos-11.0.3
- Run
> run.sh desktop
> run.sh mobile
> run.sh xpad
DESKTOP | PAD |
---|---|
MOBILE |
---|
Creating cross platform Java application
Creating mobile application with JSoaggerFX
Please read [CONTRIBUTING.md] for details on our code of conduct, and the process for submitting pull requests to us.
- rmvonji - Initial work - JSoagger
- Contact - yvonjisoa@nexitia.com