Package vg.core.request

Examples of vg.core.request.UIRequestOpenSubGraph


   
    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);
      this.param.userInterface.addRequest(request);     
    }
View Full Code Here


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

        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

      } 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

            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

        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 {
            UIRequestReplaceCurrentTab req = new UIRequestReplaceCurrentTab(igv, null);
            this.parameter.userInterface.addRequest(req);         
          }       
View Full Code Here

        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);
        } else {
          UIRequestReplaceCurrentTab req = new UIRequestReplaceCurrentTab(igv, null);
          this.parameter.userInterface.addRequest(req);
        }
View Full Code Here

            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

Related Classes of vg.core.request.UIRequestOpenSubGraph

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.