fesch / Structorizer.Desktop

Structorizer is a little tool which you can use to create Nassi-Schneiderman Diagrams (NSD).
https://structorizer.fisch.lu
GNU General Public License v3.0
65 stars 20 forks source link

Turtleizer enhancement ideas #704

Closed codemanyak closed 3 years ago

codemanyak commented 5 years ago

In analogy to Arranger, Turtleizer (actually the TurtleBox) could be enhanced as follows:

  1. Zooming could be enabled.
  2. A status bar could be added, showing
    • the bounds of the drawn lines (in turtle coordinates);
    • the current view region (in turtle coordinates);
    • the coordinates and orientation of the turtle;
    • the current zoom factor.
  3. It could be allowed to draw a selection rectangle.
  4. A context menu could be added, allowing to
    • export the entire drawn area, the current view region, the selected region, or possibly a specifiable coordinate region as PNG or SVG image;
    • export a linear sequence of Turtleizer draw commands to reproduce the current image (or optionally only the parts within a selected region - all completely included elements or all touched elements or actually the cropped content?) as:
      • NSD subroutine diagram (optionally either all moves relative or with start coordinates and orientation as arguments),
      • CSV file,
      • simple text file;
    • set the zoom factor explicitly;
    • go to a specified centre coordinate.
  5. Respective key bindings and mouse actions should be introduced as well.
codemanyak commented 5 years ago

The CSV export mentioned in the (edited) description might follow one of he following choosable conventions

codemanyak commented 5 years ago

As TurtleBox is located in an independent package outside the structorizer hierarchy (and shall remain importable from other Java projects), the proposed enhancements would mean to subclass TurtleBox in Structorizer to allow the subclass to join the Locale mechanism of Structorizer. Likewise, the proposed export of nsd files wouldn't make sense apart from Structorizer. So it would be kind of "Turtleizer Plus" that is fully compatible on the API side but has some GUI-controllable functional additions.

There is no urgence in these ideas. I just wanted to keep them recorded, lest they should be forgotten.

codemanyak commented 3 years ago

I wrote in https://github.com/fesch/Structorizer.Desktop/issues/704#issuecomment-473372405:

As TurtleBox is located in an independent package outside the structorizer hierarchy (and shall remain importable from other Java projects), the proposed enhancements would mean to subclass TurtleBox in Structorizer to allow the subclass to join the Locale mechanism of Structorizer. Likewise, the proposed export of nsd files wouldn't make sense apart from Structorizer. So it would be kind of "Turtleizer Plus" that is fully compatible on the API side but has some GUI-controllable functional additions.

This preoccupation was unsubstantial, at least with respect to the Locales mechanism since this works via Java Reflection "from outside" and does not require collaboration of the treated GUI component nor even a specific interface. The component can be registered for localisation by a third party (e.g. Structorizer). If it is not then there will simply not be a localisation support and the GUI stays in English. Hence, nothing to worry about. The CSV export would not be a problem, either. The proposed NSD export is highly questionable anyway as it would produce a mere linear instruction sequence with little chance to infer loops or sensible subroutines.

codemanyak commented 3 years ago

With exception of item 3 (selection of segments) the proposals have been implemented in a first version. Something might be disputed or improved later (e.g. whether background colour and turtle visibility must still be reset on every diagram start).