SwingUtilities.invokeLater(new Runnable() {
public void run() {
switch(event.getType()) {
case DEF_OPEN_NEW_GRAPH:
{
UIEventOpenNewGraph bufEvent = (UIEventOpenNewGraph)event;
SimpleNavigator.this.addGraph(bufEvent.getGraphId());
break;
}
case DEF_OPEN_NEW_TAB:
{
UIEventOpenNewTab bufEvent = (UIEventOpenNewTab)event;
IGraphView view = bufEvent.getView();
int tabId = bufEvent.getTabId();
StorableSubGraph ssg = view.getStorableSubGraph();
SimpleNavigator.this.addTabInNavigator(ssg, bufEvent.getTabId(), bufEvent.getTitle());
SimpleNavigator.this.selectTabInNavigator(tabId);
break;
}
case DEF_CLOSE_TAB:
{
UIEventCloseTab bufEvent = (UIEventCloseTab)event;
int tabId = bufEvent.getTabId();
SimpleNavigator.this.closeTab(tabId);
break;
}
case DEF_CHANGE_VIEW:
{
UIEventChangeView bufEvent = (UIEventChangeView)event;
int tabId = bufEvent.getTabId();
SimpleNavigator.this.selectTabInNavigator(tabId);
break;
}
case DEF_RENAME_TAB:
{
UIEventRenameTab bufEvent = (UIEventRenameTab)event;
GraphNode tabNode = SimpleNavigator.this.rootNode.getNode(bufEvent.getTabId(), ENodeType.DEF_TAB);
if(tabNode != null) {
tabNode.setName(bufEvent.getNewName());
} else {
VisualGraph.log.printError("[" + this.getClass().getName()+".update] [BAD] Renaming of tab.");
}
break;
}