A way to run the JavaFX version of the Model Editor under a Java project.

1. Import class library

    Please refer to the pom.xml below to introduce the relevant class library into your own Java project, where the sonatype repository is for the use of the SNAPSHOT version of the class library.

<project xmlns="" xmlns:xsi=""
            <name>sonatype Repository</name>

2. Run the model editor

    Write a Java program to run the Model Editor.

import org.xmeta.World;
import xworker.webserver.XWorkerWebServer;
public class FXExplorer {
    public static void main(String[] args){
            //Initialize the engine, if there is a problem with the code coloring, please set the path of the color dll
            World world = World.getInstance();
            //Add a model manager, that is, the directory where the model is stored, which is needed to edit the model. Test is the name of the model manager and cannot be duplicated with other model managers.
            world.addFileThingManager("myproject", new File("./src/main/resources"), false, true);
           //The model can be placed in the Java source directory, and the model can be compiled and packaged with Java, but the model in the jar is generally read-only
        }catch(Exception e){

    The first time it is executed or when the Jar that the project depends on changes, the initialization operation will be performed. After the initialization is performed, the application will exit and need to be reopened. The function of initialization is to decompress the class libraries and resources that cannot be imported through Maven to the ./xworker/ directory.

Copyright ©  2007-2019  版权所有  沪ICP备08000575号