Package vg.core.event

Examples of vg.core.event.UIEventOpenNewTab


    int tabId = getNextId(); // get new id
    this.comTabIdAndGraphView.put(tabId, graphView);
    this.comTabIdAndTab.put(tabId, this.tabs.getTabCount());
    this.comTabIdAndTabTitle.put(tabId, title);
    // send event
    UIEventOpenNewTab event = new UIEventOpenNewTab(tabId, localTitle, graphView);
    this.parameter.userInterface.addEvent(event);
    // update ui and add new component
    if(SwingUtilities.isEventDispatchThread()) {
      localAddTab(renamingTitle, renamingId, localTitle, graphView.getGraphRepresentation());
    } else {
View Full Code Here


              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;
            }
View Full Code Here

  private void localUpdate(Observable o, Object arg) {
    if (arg instanceof AUIEvent) {
      AUIEvent event = (AUIEvent) arg;
      switch (event.getType()) {
        case DEF_OPEN_NEW_TAB: {
          UIEventOpenNewTab bufEvent = (UIEventOpenNewTab)event;
          synchronized (this.tabSet) {
            this.tabSet.add(bufEvent.getTabId());
          }
          break;
        }
        case DEF_CLOSE_TAB: {
          UIEventCloseTab bufEvent = (UIEventCloseTab)event;
          synchronized (this.tabSet) {
            this.tabSet.remove(bufEvent.getTabId());
          }
          break;         
        }
      }
    }
View Full Code Here

TOP

Related Classes of vg.core.event.UIEventOpenNewTab

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.