While working on homework for my Theory of Computation class, I found myself in the need for a tool that would allow me to generate Finite State Machine (FSM) diagrams. I tried Keynote and Power Point, and while they were both good, they weren't great. I was wondering if I should just draw them by hand, when I remembered that OmniGraffle would be perfect for this.
I fired up OmniGraffle and got to work. It was great. The Shape Tool and Line Tool were perfect for creating the shapes and connectors I needed. The Lines and Shape style palette was also perfect for creating accepting states.
As we got more and more assignments, I kept going back to the previous ones and copying and pasting shapes into the new ones. This worked for the first couple of times, but I soon found myself wondering if I could just create a basic FSM diagram and save it as a stencil — similar to the ones you download from Graffletopia or Stenciltown. I did some poking around in the internets and found that creating a custom stencil for OmniGraffle is trivial. Ken Case quoting the online help:
Just select New Stencil from the Stencils menu; a document window appears. Add objects to it just like you would in a normal OmniGraffle diagram. A preview of the stencil appears in the stencil window as you work. Once the stencil looks just how you want it, select Save from the File menu; the default location for saving is the Application Support folder inside your Library.
Awesome. So after some doodling I finished my stencil and installed it. Boom!
You can download my FSM stencils here. To install them just unzip the archive and open the file in OmniGraffle. A "install" button should appear in the Stencil inspector. Alternatively you can copy the unzipped folder into the directory:
~/Library/Application Support/The Omni Group/OmniGraffle/Stencils/
This will have the added benefit of creating a folder named "Finite State Machines" in the stencil library.