Lordui library interface

Lordui library interface consists only single Java Class::
 ktm.lordui.Lordui
. To initialize Lordui you have to call the static method createInstance. You may create only one instance of Lordui class - every next call will return the previously returned object. When ending the work, call close method. Please find below the list of functions available over Lordui class:
  1. public final void loadProject(File luiFile) throws IOException - opens project from given *.lui file,
  2. public final void setValue(String name, Object value) - stores in Lordui given object (like instance of Window, int, String, Point, etc.) under given global name,
  3. public final Object getValue(String name) - gets from Lordui the object stored under given global name,
  4. public final void runProcedure(String procedureName) - Executes the procedure,
  5. public final void runProcedureAndWait(String procedureName) - Executes the procedure. Function runProcedureAndWait won't end execution until all procedures from the player won't stop running,
  6. public static final Lordui createInstance() - returns the instance of Lordui object,
  7. public final void close() - close Lordui library. Without calling it, Lordui may not dispose all the objects correctly. After calling it, you should no more use the Lordui class instance neither call Lordui:createInstance function,
  8. public final void setVisible(boolean visible) - shows/hides Lordui editor window.

Here is the example of using Lordui library:

public class LorduiLibraryUsage {  private Lordui lui;    public void useLordui() {    lui = Lordui.createInstance();    try {      lui.loadProject(new File("myLorduiProcedureFile.lui"));    } catch (IOException e) {      e.printStackTrace();      return;    }    //Here implement the code start your application, show your user interface    try {      SwingUtilities.invokeAndWait(new Runnable() {        @Override        public void run() {          JFrame fr = new JFrame("Test window");          fr.setSize(800, 600);          fr.setVisible(true);        }      });    } catch (InvocationTargetException e) {      e.printStackTrace();      return;    } catch (InterruptedException e) {      e.printStackTrace();      return;    }        lui.runProcedureAndWait("LorduiProcedureName");    lui.close();  }}

krzys2018-09-16