Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am drawing a state transition diagram using LibreOffice draw on Ubuntu 11.04. I am able to get almost everything that I needed except the final state. Typically we use two circles embedded in for showing a final state of a state transition diagram. Could someone help me to do that? Please also let me know if there are any better tools for drawing state transition diagrams on Ubuntu. I have looked at Dia, but it is not also useful to draw final state of a state transition diagram like in this.

share|improve this question
1  
You might also want to check out LaTeX' very versatile TikZ package: tex.stackexchange.com/questions/45734/drawing-graphs-in-latex and doofussoftware.blogspot.de/2012/07/…. I was also able to find a package in the official repositories that seems to be able to generate STDs. –  Glutanimate May 2 '13 at 10:22

4 Answers 4

up vote 3 down vote accepted

Actually Dia does allow you to add an end state. Select the UML shapes, then drag the "initial/end state" shape onto your diagram. When you double click the shape, you'll see a button that says "Is final". This lets you define whether the state is initial or final.

EDIT: If you don't like how those look, it's pretty easy to create your own shapes in Dia. They're just SVG files.

Save the following as ~/.dia/shapes/fsm_final_state.shape :

<?xml version="1.0"?>

<shape xmlns="http://www.daa.com.au/~james/dia-shape-ns"
       xmlns:svg="http://www.w3.org/2000/svg">
  <name>Finite State Machine - Final State</name>
  <icon>fsm_final_state_icon.xpm</icon>
  <connections>
    <point x="0.0" y="2.5" />
    <point x="2.5" y="5.0" />
    <point x="5.0" y="2.5" />
    <point x="2.5" y="0.0" />
  </connections>
  <textbox x1="0.0" y1="0.0" x2="5.0" y2="5.0" />
  <svg:svg width="5.0" height="5.0">
    <svg:circle style="fill: default;" cx="2.5" cy="2.5" r="2.5" />
  </svg:svg>
  <svg:svg width="4.0" height="4.0">
    <svg:circle style="fill: default;" cx="2.5" cy="2.5" r="2.0" />
  </svg:svg>
</shape>

Save the following as ~/.dia/shapes/fsm_final_state_icon.xpm :

/* XPM */
static char * fsm_final_state_icon_xpm[] = {
"16 16 14 1",
"   c None",
".  c #FFFFFF",
"+  c #FCFCFC",
"@  c #B6B6B6",
"#  c #545454",
"$  c #000000",
"%  c #101010",
"&  c #D8D8D8",
"*  c #121212",
"=  c #353535",
"-  c #A0A0A0",
";  c #EBEBEB",
">  c #040404",
",  c #9E9E9E",
"................",
"....+@#$%#@+....",
"...&*=-.;-=*&...",
"..&>,......,>&..",
".+*,........,*+.",
".@=..........=@.",
".#-..........-#.",
".%;..........;%.",
".%;..........;%.",
".#-..........-#.",
".@=..........=@.",
".+*,........,*+.",
"..&>,......,>&..",
"...&*=-.;-=*&...",
"....+@#$%#@+....",
"................"};

Finally, save the following as ~/.dia/sheets/Finite_State_Machine.sheet :

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<sheet xmlns="http://www.lysator.liu.se/~alla/dia/dia-sheet-ns">
<!--File: ~/.dia/sheets/Finite_State_Machine.sheet-->

<name>Finite State Machine</name>
<description>Finite state machine diagrams</description>
<contents>
<!--add shapes here-->
<object name="Finite State Machine - Final State">
<description>Final</description></object>

</contents></sheet>

When you restart Dia you should have a "Finite State Machine" sheet with one shape: a decent looking final state!

share|improve this answer
    
Thank you. However, it seems that initial and final states are not looking as good as en.wikipedia.org/wiki/File%3aDFAexample.svg Please let me know if you know any other better tools. –  samarasa Oct 9 '11 at 0:53
    
Edited my answer with an example of how to make your own shapes in Dia. ;-) –  erturne Oct 9 '11 at 1:18

Lucidchart is a good option. Free version available and works in any decent browser. I know that there dev team are all running Linux so there is that as well because I work there :)

share|improve this answer

I suggest you to use Dia software for your state diagram or any other UML or flow diagrams. It contains numbers of shapes and easy drag drop facilities. So go for dia. For more information visit this link.

share|improve this answer

I suggest you to use inkscape Install inkscape to produce graphics like that, it takes a little time to learn how to use the tools but is perfectly awarded with the graphic quality of the product.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.