Package vg.core.event

Examples of vg.core.event.UIEventOpenNewGraph


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


            case DEF_CLOSE_PROGRAM: {
              SearchPlugin.this.searchPanel.dispose();
              break;
            }
            case DEF_OPEN_NEW_GRAPH: {
              UIEventOpenNewGraph buf = (UIEventOpenNewGraph)event;
              SearchPlugin.this.searchPanel.addGraph(buf.getGraphId(), buf.getGraphName());
              break;
            }
            case DEF_CHANGE_UI_STYLE: {
              SearchPlugin.this.searchPanel.updateUITheme();
              break;
            }
            case DEF_CHANGE_VIEW: {
              UIEventChangeView buf = (UIEventChangeView)event;
              SearchPlugin.this.searchPanel.changeView(buf.getView());
              break;
            }
            case DEF_RESET: {
              SearchPlugin.this.searchPanel.reset();
              break;
View Full Code Here

              try {
                final String fileName = fileChooser.getSelectedFile().getPath();
                int newGraphId = CommandOpener.openFile(fileName, parameter.model);
                VisualGraph.log.printDebug("[" + this.getClass().getName() + ".openGraph] [OK] Open file = "
                    + fileChooser.getSelectedFile().getPath());
                UIEventOpenNewGraph ong = new UIEventOpenNewGraph(newGraphId, parameter.model.getGraphName(newGraphId));
                parameter.userInterface.addEvent(ong);
              } catch (Throwable e) {
                VisualGraph.log.printException(e);
                VisualGraph.windowMessage.showExceptionMessage(new CoreException("Cannot open file.\nException : "
                    + e.getMessage(), EnumCriticalityException.WARNING));
View Full Code Here

      if(arg instanceof AUIEvent) {
        AUIEvent event = (AUIEvent)arg;
        switch(event.getType()) {
          case DEF_OPEN_NEW_GRAPH:
          {
            UIEventOpenNewGraph bufEvent = (UIEventOpenNewGraph)event;
            Integer graphId = bufEvent.getGraphId();
            Date d = new Date();
            StorableSubGraph ssg = this.parameter.model.getRootStorableSubGraph(graphId);
            VisualGraph.log.printInfo("[" + this.getClass().getName() + ".update] Root subGraph select time: " + (new Date().getTime() - d.getTime()) / 1000.0 + "sec");
            if(ssg != null) {
              IGraphView graphView =  GraphView.newGraphView(ssg, DesktopPanel.this.parameter.userInterface);
                  addTab(graphView.getTitle(), graphView);                           
            } else {
              VisualGraph.log.printError("[" + this.getClass().getName() + ".update] Desktop. Openning of root subgraph(DEF_OPEN_NEW_GRAPH). GraphId = " + graphId.toString());
            }
            break;
          }
          case DEF_CREATE_NEW_CONNECT:
          {
            UIEventCreateNewConnection bufEvent = (UIEventCreateNewConnection)event;
            addNewConnect(bufEvent.getConnectionId(), bufEvent.getConnectionName(), bufEvent.getGraphId(), bufEvent.getAnchor());
            break;
          }
          case DEF_DELETE_CONNECT:
          {
            UIEventDeleteConnection bufEvent = (UIEventDeleteConnection)event;
            removeConnect(bufEvent.getConnectId());
            break;
          }
          case DEF_CHANGE_UI_STYLE:
          {
            updateUITheme();
View Full Code Here

TOP

Related Classes of vg.core.event.UIEventOpenNewGraph

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.