HowToRun.txt 1.4 KB

12345678910111213
  1. 1- Make sure that the Java code has no errors. Include all external libraries and create mock classes for mxGraph ones.
  2. 2- Run JSweet: mvn generate-sources
  3. 3- Ignore the errors. The JS file are generated although there are errors. [Errors are coming from external libraries that JSweet cannot find]
  4. 4- Start replacing mxGraph mock classes with JS equivalents (e.g., com.mxgraph.io.vsdx.mxPoint => mxPoint). Make sure that the JS classes has the methods needed
  5. 4.a. mxPoint has no getX/Y setX/Y, so replace them with direct fields (e.g., .getX() => .x)
  6. 4.b. mxGeometry has no getX/Y setX/Y (get/set)Width (get/set)Height. The same for: alternateBounds sourcePoint targetPoint points offset relative
  7. 4.c. Make sure that your mock classes do not have overloaded methods such that they are translated with the same name
  8. 5- Do the same with all external libraries. Most of them requires equivalent JS libraries and some are supported natively by JS (e.g., DOM)
  9. 5.a. DOM methods need to be changed to fields: (e.g., getChildNode() => childNode)
  10. 5.b. getAttribute and hasAttribute methods exists in JS
  11. 5.c. DOM getAttribute returns null if attribute is not found, in Java, it returns empty string!
  12. 6- Fix JSweet errors in handling fields initialization. Default initialization must be moved before _super call. Also, !string.contains bug and model.getCells() conversion bug
  13. 7- Try to do a test that covers all the code!