Examples of IGraphView


Examples of vg.core.IGraphView

          invibleEdges.add(bufEdge.getStorableId());
        }
      }
    }
   
    IGraphView newView = GraphView.newGraphView(ssg, this.param.userInterface);
    newView.setInvisibleVertices(invibleVertices);
    newView.setInvisibleEdges(invibleEdges);
    if(this.actionMode == DEF_ACTION_MODE_1) {
      UIRequestOpenSubGraph request = new UIRequestOpenSubGraph("[" + ssg.getId() + "]", "", newView, this.owner);
      this.param.userInterface.addRequest(request);
    } else {
      UIRequestReplaceCurrentTab request = new UIRequestReplaceCurrentTab("[" + ssg.getId() + "]", "", newView, this.owner);
View Full Code Here

Examples of vg.core.IGraphView

    this.popup = new JPopupMenu();
    final JMenuItem openSubGraphMenuItem = new JMenuItem("Open subgraph in new tab");
    openSubGraphMenuItem.addActionListener(new ActionListener() {

      public void actionPerformed(ActionEvent arg0) {
        IGraphView view = JGraphView.this;
        IGraphView subgraph = new JGraphView(JGraphView.this, view.getSelectionSubGraph());
        if (!isSelected())
          return;

        UIRequestOpenSubGraph r = new UIRequestOpenSubGraph(subgraph, JGraphView.this.requestOwner);
        JGraphView.this.userInterface.addRequest(r);
      }
    });
    this.popup.add(openSubGraphMenuItem);
    this.connectorPopup = new JMenu("go to notepad");
    this.popup.add(connectorPopup);
    graphComponent.getGraphControl().addMouseListener(new MouseAdapter() {
      private void popupTriger(MouseEvent e) {
        if (e.isPopupTrigger()) {
          openSubGraphMenuItem.setEnabled(JGraphView.this.isSelected());

          mxCell cell = (mxCell) graphComponent.getCellAt(e.getX(), e.getY());
          if (cell != null) {
            connectorPopup.removeAll();

            for (final Connection con : connections.values()) {
              Set<StorableAttribute> attributes = null;
              if (cell.isVertex())
                attributes = vertexAttributes.get(cell).keySet();
              else if (cell.isEdge()) {
                attributes = edgeAttributes.get(cell).keySet();
              } else
                break;

              for (final StorableAttribute attr : attributes) {
                if (attr.getName().equals(con.attributeName)) {
                  JMenuItem item = new JMenuItem(con.connectName);
                  item.addActionListener(new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                      UIRequestGoToInAIF r = new UIRequestGoToInAIF(con.connectId, attr.getValue(),
                          JGraphView.this.requestOwner);
                      JGraphView.this.userInterface.addRequest(r);
                    }
                  });
                  connectorPopup.add(item);
                }
              }

            }
            connectorPopup.setEnabled(connectorPopup.getItemCount() > 0);
          } else {
            connectorPopup.setEnabled(false);
          }

          JGraphView.this.popup.show(e.getComponent(), e.getX(), e.getY());
        }
        SwingUtilities.updateComponentTreeUI(popup);
      }

      @Override
      public void mouseReleased(MouseEvent e) {
        if (e.getClickCount() > 1) {
          mxCell cell = (mxCell) graphComponent.getCellAt(e.getX(), e.getY());
          if (cell != null && subgraphsid.containsKey(cell)) {
            if (JGraphView.this.model != null) {
              StorableSubGraph ssg = JGraphView.this.model.getStorableSubGraph(subgraphsid.get(cell).intValue());
              IGraphView view = new JGraphView(ssg, JGraphView.this.userInterface);
              UIRequestOpenSubGraph r = new UIRequestOpenSubGraph(view, JGraphView.this.requestOwner);
              JGraphView.this.userInterface.addRequest(r);
            } else {
              VisualGraph.log.printError("[" + this.getClass().getName()
                  + ".JGraphView.mouseReleased] [BAD] Can't get storable subgraph, because model = null.");
View Full Code Here

Examples of vg.core.IGraphView

        return;
      } else {
        GraphNode node = ((GraphNode)tm.getRoot()).getNode(p[0]);
        if(node.getInnerGraph() != null) {
          StorableSubGraph ssg = this.model.getStorableSubGraph(node.getInnerGraph());
          IGraphView igv = GraphView.newGraphView(ssg, this.userInterface);
          UIRequestOpenSubGraph req = new UIRequestOpenSubGraph(igv, null);
          this.userInterface.addRequest(req);
        } else {
          VisualGraph.windowMessage.warningMessage("Selection should be subgraph, if you want to open subgraph in new tab", "Opening of subgraph");       
        }
View Full Code Here

Examples of vg.core.IGraphView

            VisualGraph.windowMessage.warningMessage("Warning: Elements aren't vertex of graph(May be it is tab or tabs).", "Opening of vertexes");
            return;
          }
        }
        StorableSubGraph ssg = this.model.getStorableSubGraph(vertexes);
        IGraphView igv = GraphView.newGraphView(ssg, this.userInterface);
        UIRequestOpenSubGraph req = new UIRequestOpenSubGraph(igv, null);
        this.userInterface.addRequest(req);
      }
    } else {
      VisualGraph.log.printDebug("[" + this.getClass().getName()+".actionPerformed] [BAD] Openning of composition of vertexes in new tab(from navigator).");
View Full Code Here

Examples of vg.core.IGraphView

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

Examples of vg.core.IGraphView

            break;
          }
          case DEF_CHANGE_VIEW:
          {
            UIEventChangeView bufEvent = (UIEventChangeView)event;
            IGraphView igv = bufEvent.getView();
            this.zoomIn.changeView(igv);
            this.zoomOut.changeView(igv);
            this.zoomBox.changeView(igv);
            break;
          }
View Full Code Here

Examples of vg.core.IGraphView

        return;
      } else {
        GraphNode node = ((GraphNode)tm.getRoot()).getNode(p[0]);
        if(node.getInnerGraph() != null) {
          StorableSubGraph ssg = this.parameter.model.getStorableSubGraph(node.getInnerGraph());
          IGraphView igv = GraphView.newGraphView(ssg, this.parameter.userInterface);
          showAdditionalAttribute(igv);
          if(this.model.getActionMode() == SearchPanelModel.DEF_ACTION_MODE_1) {
            UIRequestOpenSubGraph req = new UIRequestOpenSubGraph(igv, null);
            this.parameter.userInterface.addRequest(req);
          } else {
View Full Code Here

Examples of vg.core.IGraphView

            VisualGraph.windowMessage.warningMessage("Warning: Elements aren't vertex of graph(May be it is tab or tabs).", "Opening of vertexes");
            return;
          }
        }
        StorableSubGraph ssg = this.parameter.model.getStorableSubGraph(vertexes);
        IGraphView igv = GraphView.newGraphView(ssg, this.parameter.userInterface);

        showAdditionalAttribute(igv);
        if(this.model.getActionMode() == SearchPanelModel.DEF_ACTION_MODE_1) {
          UIRequestOpenSubGraph req = new UIRequestOpenSubGraph(igv, null);
          this.parameter.userInterface.addRequest(req);
View Full Code Here

Examples of vg.core.IGraphView

      // ACTION
      /////////////////////////////////////
      switch(this.actionMode) {
        case DEF_ACTION_MODE_1:
        {
          IGraphView igv = GraphView.newGraphView(this.currentView.getStorableSubGraph(), this.parameter.userInterface);
          igv.setInvisibleVertices(lviids);
          igv.setInvisibleEdges(leiids);
          if(!this.vertexConditionCheckBox.isSelected()) lviids = null;
          if(!this.edgeConditionCheckBox.isSelected()) leiids = null;
          UIRequestOpenSubGraph requestOpenSubGraph = new UIRequestOpenSubGraph(igv, null);
          this.parameter.userInterface.addRequest(requestOpenSubGraph);
          break;
        }
        case DEF_ACTION_MODE_2:
        {
          IGraphView igv = GraphView.newGraphView(this.currentView.getStorableSubGraph(), this.parameter.userInterface);
          if(!this.vertexConditionCheckBox.isSelected()) lviids = null;
          if(!this.edgeConditionCheckBox.isSelected()) leiids = null;
          igv.setInvisibleVertices(lviids);
          igv.setInvisibleEdges(leiids);
          UIRequestReplaceCurrentTab requestOpenSubGraph = new UIRequestReplaceCurrentTab(igv, null);
          this.parameter.userInterface.addRequest(requestOpenSubGraph);
          break;
        }
        case DEF_ACTION_MODE_3: {
View Full Code Here

Examples of vg.core.IGraphView

            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();
            break;
          }
          case DEF_RESET:
          {
            this.connections.clear();
            this.comTabIdAndTabTitle.clear();
            this.comTabIdAndTab.clear();
            this.comTabIdAndGraphView.clear();
            this.tabTitleStatistic.clear();
            this.tabs.removeAll();
           
            break;
          }
        }
      } else if(arg instanceof AUIRequest) {
        AUIRequest request = (AUIRequest)arg;
        switch(request.getType()) {
          case DEF_CLOSE_CURRENT_TAB:
          {
            // call request owner method (PROCESS REQUEST)
            IUIRequestOwner bufOwner = request.getOwner();
            if(bufOwner != null) {
              bufOwner.callRequestOwner(new AUIRequest(EUIRequestType.PROCESS, null) {});
            }
            // execute query
            int index = this.tabs.getSelectedIndex();
            if(index >= 0) {
              for(Integer buf : this.comTabIdAndTab.keySet()) {
                Integer value = this.comTabIdAndTab.get(buf);
                if(value != null && value.equals(index)) {
                  closeTab(buf);
                  break;
                }
              }
            }
            // call request owner method (OK REQUEST)
            if(bufOwner != null) {
              bufOwner.callRequestOwner(new AUIRequest(EUIRequestType.OK, null) {});
            }
            break;
          }
          case DEF_CLOSE_TAB: {
            // call request owner method (PROCESS REQUEST)
            IUIRequestOwner bufOwner = request.getOwner();
            if(bufOwner != null) {
              bufOwner.callRequestOwner(new AUIRequest(EUIRequestType.PROCESS, null) {});
            }
            // execute query
            UIRequestCloseTab req = (UIRequestCloseTab)request;
            Set<Integer>tabSet = req.getTabSet();
            if(tabSet != null) {
              for(Integer buf : tabSet) {
                closeTab(buf);
              }
            }
            // call request owner method (OK REQUEST)
            if(bufOwner != null) {
              bufOwner.callRequestOwner(new AUIRequest(EUIRequestType.OK, null) {});
            }
            break;
          }
          case DEF_OPEN_SUB_GRAPH:
          {
            // call request owner method (PROCESS REQUEST)
            IUIRequestOwner bufOwner = request.getOwner();
            if(bufOwner != null) {
              bufOwner.callRequestOwner(new AUIRequest(EUIRequestType.PROCESS, null) {});
            }
            // execute query
            UIRequestOpenSubGraph req = (UIRequestOpenSubGraph)request;
            final IGraphView igv = req.getSubGraphView();
            SwingUtilities.invokeLater(new Runnable() {
              public void run() {
                if(igv != null) {
                  addTab(igv.getTitle(), igv);
                }         
              }
            });
            // call request owner method (OK REQUEST)
            if(bufOwner != null) {
              bufOwner.callRequestOwner(new AUIRequest(EUIRequestType.OK, null) {});
            }
            break;
          }
          case DEF_SELECT_TAB:
          {
            // call request owner method (PROCESS REQUEST)
            IUIRequestOwner bufOwner = request.getOwner();
            if(bufOwner != null) {
              bufOwner.callRequestOwner(new AUIRequest(EUIRequestType.PROCESS, null) {});
            }
            // execute query
            UIRequestSelectTab req = (UIRequestSelectTab)request;
            final Integer tabId = req.getTabId();
            // find tab
            SwingUtilities.invokeLater(new Runnable() {
              public void run() {
                tabs.setSelectedIndex(DesktopPanel.this.comTabIdAndTab.get(tabId));
              }
            });
            // call request owner method (OK REQUEST)
            if(bufOwner != null) {
              bufOwner.callRequestOwner(new AUIRequest(EUIRequestType.OK, null) {});
            }
            break;
          }
          case DEF_REPLACE_CURRENT_TAB:
          {
            // call request owner method (PROCESS REQUEST)
            IUIRequestOwner bufOwner = request.getOwner();
            if(bufOwner != null) {
              bufOwner.callRequestOwner(new AUIRequest(EUIRequestType.PROCESS, null) {});
            }
            // execute query
            UIRequestReplaceCurrentTab req = (UIRequestReplaceCurrentTab)request;
            int index = this.tabs.getSelectedIndex();
            if(index >= 0) {
              for(Integer buf : this.comTabIdAndTab.keySet()) {
                Integer value = this.comTabIdAndTab.get(buf);
                if(value != null && value.equals(index)) {
                  closeTab(buf);
                  IGraphView igv = req.getSubGraphView();
                  if(igv != null) {
                    addTab(igv.getTitle(), igv);
                  }
                  break;
                }
              }
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.