![]() |
ViewsOpenFlow GUI Extension - ControlFrom OpenFlow WikiThe are two approaches for adding controls to your GUI are described below.
Adding controlsTo put the controls in a separate window you can simply create and use your own
Adding controls in the topology windowTo embed the controls in the same window as your topology, you need to reserve some space on the window for your controls. You can either reserve the right or bottom side of a window. The example code shows how to reserve space on the bottom of the main window: /** Overrides parent to reserve space for custom controls in the new window. */
public void attachWindow(final PZWindow w) {
super.attachWindow(w);
if(getWindowIndex(w) == 0) {
w.getContentPane().add(pnlCustom);
w.setReservedHeightBottom(RESERVED_HEIGHT_BOTTOM);
w.setMySize(w.getWidth(), w.getHeight(), w.getZoom());
}
}
/**
* Extends the parent implementation to relayout the custom controls section
* to fit in the new area.
*/
public void setLayoutSize(int w, int h) {
super.setLayoutSize(w, h);
int margin = 20;
pnlCustom.setBounds(0, h + margin, w, RESERVED_HEIGHT_BOTTOM - 2 * margin);
}
GraphsYou can also add graphs to your custom reserved space. This is described in the display section. |
Quick NavigationOpenFlow White PaperOpenFlow Demo Video![]() Watch the Demo that received the best demo award at SIGCOMM 2008. About OpenFlow OpenFlow is supported bythe Stanford Clean Slate Program. Wiki ToolsPersonal toolsProjects |