Myriarch 2.1 for Swing Released

Version 2.1.0 of Myriarch, a simple real-time simulator for pre-gunpowder tactical combat, is now available for download. As with previous project updates, the Myriarch GUI is now based on Swing due to the removal of JavaFX from Oracle’s Java SE distributions.

The minimum Java requirement was consequently lowered to Java SE 8, although note that you still need Java SE 9 or later to get high DPI scaling. See the updated ReadMe and WhatsNew files for details. Here are some notes on the new Swing GUI:

  • As with the previous Star Chess update, I added a command-line switch to change the Swing Look & Feel from the default Nimbus. Note that the only other tested L&F is Metal, so other L&Fs might not work correctly.
  • Both online help and scenario information are now displayed with Swing JEditorPane and HTMLEditorKit. Here I discovered that styling only worked correctly for help pages, which use <link> tags to import my CSS file. Calling importStyleSheet and setStyleSheet for scenario information broke CSS inheritance and required me to reapply the body font size on the p style. There’s likely more trouble down the road if the styling of scenario information ever gets more complex.
  • Without JavaFX I no longer had its convenient SVGPath parser so I wrote my own, available in class SVGtoPath2D. Others might find it useful too, though it does not support the full SVG path specification. The only difficulty was the complex SVG arc syntax, but fortunately the Apache Batik project provided a method for that which I could use virtually unchanged. You can find details in the ReadMe and source code files.
  • Likewise and as with Star Chess, I could no longer use the JavaFX Chart class for history line charts. But I had already adapted old C chart drawing code for Swing in Star Chess, and somewhat extended it for Myriarch. You can find the result in package myriarch.chart should you be interested.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.