Creating a FSA-design program. Should I go for Swing or SWT?

Hi!

I’m planning to create an application to handle Finite State Automatas.

For this I’ll have to create my own widget where in the actual automatas reside. This widget will hold:

  • Nodes. Circles which holds text inside.
  • Edges. An edge is a line connecting two nodes with a text describing the transition. The line may be a straight line or a bézier curve.

And you will be able to handle the widget contents using the following actions:

  • Create a node.
  • Delete a node.
  • Create an edge.
  • Delete an edge.
  • Change the text of a node/edge.
  • Drag a node to a new position.
  • Change an edge between being a straight line <=>bézier curve.
  • Change the curve of a bézier curve edge. By dragging the two control points.
  • Bring a node/edge forward. Puts the node/edge on layer forward.
  • Bring a node/edge back. Puts the node/edge on layer forward.
  • Bring a node/edge to front. Puts the node/edge on topmost layer.
  • Bring a node/edge to back. Puts the node/edge on bottommost layer.
  • Set/Unset a node as the start node. Marked by an arrow pointing at the node.
  • Set/Unset a node as an accepting state. The node will be drawn using double lines.

To see what it could look like I’ve attached a picture (which I in turn have snitched. It’s just an example). In the attached picture the circles with LR_x are Nodes and the lines with text like SS(B) and S(a) are Edges.

Now to my questions:

  • Do you think that I should go for Swing or SWT? Which one would result in the “best” program? (I know “best” is subjective) And which one would result in the easiest development? I am leaning towards SWT as I suspect it will give me a more responsive GUI with native look and feel. As long as I can publish my program for Windows, Linux and MacOS I’m satisfied.
  • Have you got any advice/tips which could be useful for me during the devlopment? (And if so, care to share? :wink: )
  • What do you think will be the hardest part of creating my widget?

Thank you for your time! I’ll appreciate all helping efforts!

Swing :wink:

If you want to write an edit application I would suggest to use one of the available graph frameworks:

If your focus is on visualization, you could utilize:

If you want to create such a framework yourself, the choice over SWT vs. Swing is a matter of personal taste and target audience. I doubt that there is a significant performance difference between the two in this usecase, since you will not use much of them, but implementing a repaint method and widget management yourself.

I would go for a good library and an application framework like NetBeans Platform, Eclipse RCP or Spring Rich Client. I find the NetBeans Platform the best, but it is only easy to use from within NetBeans IDE (at least at the start).