From OpenFlow Wiki
This ENVI extension tutorial will walk you through the basics of how to extend this OpenFlow network visualization and control platform.
It is highly recommended that you read through the additions made in the origin/example branch (do git checkout -b example origin/example after cloning the repository to see the example extension code - probably a good starting point for your project). This example code is the foundation of this tutorial. The abbreviation “ex” is used as a prefix to extension-specific classes and types - you should use an abbreviation appropriate for your project. Also make sure you modify the gui/build.xml so that the main-class property is set to launch your main class.
Here are the steps to create your own custom GUI:
Display and Interface
If you need to display custom controls, then extend PZLayoutManager to EXLayoutManager (in org.openflow.gui.ex) -- this is discussed in-depth in the custom controls section. You will also have to extend this class If you happen to be in the unusual circumstance which requires that you draw in the topology area or add special processing to addition/removal of Drawables or the drawing pipeline -- discussion on this is in the custom display section. Using a custom topology layout is described in the layout section.
Communications
Extend ConnectionHandler to something like EXConnectionHandler (in org.openflow.gui.ex) if you need to handle custom messages (likely) or multiple topologies (unlikely). Details on how to do this and add new messages is discussed in the communications section.
Options
Read through the settings in the Options class. It contains global settings which you may want to change depending on your application.
User Interactions
You may wish to provide custom handling of user interactions like mouse and keyboard input as described in the user interaction section.
Main method
Create a new class in org.openflow.gui.ex with the name of your application (we use Example as the name). This class simply contains the main() method for your project - it is likely that you can use the boilerplate from the Example class verbatim.