Package vg.core.storableGraph

Examples of vg.core.storableGraph.StorableSubGraph


      }
      boolean cycleCheck = false;
      boolean pathCheck = false;       

      if (this.view != null) {
        StorableSubGraph ssg = this.view.getSelectionSubGraph();
        if (ssg != null) {
          List<StorableVertex> lsv = ssg.getVertices();
          if (lsv != null) {
            cycleCheck = (lsv.size() == 1);
            pathCheck = (lsv.size() == 2);
          }
        }
View Full Code Here


      }
    });

    this.button.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        StorableSubGraph ssg = CriticalPathSearcher.this.view.getSelectionSubGraph();
        if (ssg != null) {
          List<StorableVertex> lsv = ssg.getVertices();
          if (lsv != null && lsv.size() == 2) {
            CriticalPathSearcher.this.from = lsv.get(0);
            CriticalPathSearcher.this.to = lsv.get(1);

            Object[] possibilities = { "from " + from.getId() + " to " + to.getId(),
View Full Code Here

    this.button = new JButton(new ImageIcon("./data/resources/textures/paths.png"));
    this.button.setToolTipText("Find all paths beetwen two vertices");
    this.button.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        StorableSubGraph ssg = PathsSearcher.this.view.getSelectionSubGraph();
        if (ssg != null) {
          List<StorableVertex> lsv = ssg.getVertices();
          if (lsv != null && lsv.size() == 2) {
            StorableVertex sv = lsv.get(0);
            StorableVertex sv2 = lsv.get(1);

            Object[] possibilities = { "from " + sv.getId() + " to " + sv2.getId(), "from " + sv2.getId() + " to " + sv.getId() };
View Full Code Here

    this.button.setToolTipText("Find all cycles, which have current vertex");
    this.button.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        if (CycleSearcher.this.view == null)
          return;
        StorableSubGraph ssg = CycleSearcher.this.view.getSelectionSubGraph();
        if (ssg != null) {
          List<StorableVertex> lsv = ssg.getVertices();
          if (lsv != null && lsv.size() == 1) {
            StorableVertex sv = lsv.get(0);
            CycleSearcher.this.view.showCycles(sv);
          }
        }
View Full Code Here

  private void createTab() {
    if(this.view == null) {
      VisualGraph.windowMessage.warningMessage("You can't create a tab, because you haven't view of subgraph.", "Warning");
      return;
    }
    StorableSubGraph ssg = this.view.getStorableSubGraph();
    if(ssg == null) {
      VisualGraph.windowMessage.warningMessage("You can't create a tab, because your your view is empty.", "Warning");
      return;
    }
   
    FilterTableRow[] result = this.tablePanel.getResult();
    List<StorableVertex>oldVertices = ssg.getVertices();
    List<StorableEdge>oldEdges = ssg.getEdges();
    Set<Integer>invibleVertices = new HashSet<Integer>();
    Set<Integer>invibleEdges = new HashSet<Integer>();
   
    if(this.optionMode == DEF_OPTION_MODE_1) {
      //check vertices
      for(StorableVertex bufVertex : oldVertices) {
        if(!checkVertexWithModeAnd(bufVertex, result)) {
          invibleVertices.add(bufVertex.getStorableId());
        }
      }
      //check edges
      for(StorableEdge bufEdge : oldEdges) {
        if(!checkEdgeWithModeAnd(bufEdge, result)) {
          invibleEdges.add(bufEdge.getStorableId());
        }
      }
    } else {
      //check vertices
      for(StorableVertex bufVertex : oldVertices) {
        if(!checkVertexWithModeOr(bufVertex, result)) {
          invibleVertices.add(bufVertex.getStorableId());
        }
      }
      //check edges
      for(StorableEdge bufEdge : oldEdges) {
        if(!checkEdgeWithModeOr(bufEdge, result)) {
          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);
      this.param.userInterface.addRequest(request);     
    }
  }
View Full Code Here

              }
            }
          }
          edgeStatement.dispose();
          //build subgraph-----------------
          StorableSubGraph ssg = new StorableSubGraph(id_subgraph, id, name, listVertex, listEdge, directed);
          subGraphs.add(ssg);
        }
        //getting of graph-------------------
        SQLiteStatement graphStatement = null;
       
View Full Code Here

            }
          }
        }
        edgeStatement.dispose();
        //build subgraph-----------------
        StorableSubGraph ssg = new StorableSubGraph(id_subgraph, id, name, listVertex, listEdge, directed);
        return(ssg);
      }
    });
    StorableSubGraph result = job.complete();
    Throwable ex = job.getError();
    if (ex != null)
    {
      VisualGraph.log.printException(ex);
      return null;
View Full Code Here

                    type_attr);
                e.addStorableAttribute(attr);
              }
            }
          }
          StorableSubGraph ssg = new StorableSubGraph(db_id_sg, id_sg, name_sg, vertexes, edges, direct_sg);
          return(ssg);
        }
      });
      StorableSubGraph ssg = job.complete();
      if (job.getError() != null) {
        VisualGraph.log.printError(job.getError().getMessage());
        VisualGraph.windowMessage.errorMessage("Can't execute SQL request. It is developer's bug.",
            "Search panel error");
      }
View Full Code Here

        this.vertexConditionalPanel.setNewDataAttributes(null);
        this.edgeConditionalPanel.setNewDataAttributes(null);
        return;
      }
      // find all attributes in current selection subgraph
      StorableSubGraph ssg = igv.getStorableSubGraph();
      if(ssg == null) {
        this.vertexConditionalPanel.setNewDataAttributes(null);
        this.edgeConditionalPanel.setNewDataAttributes(null);
        return;     
      }
      // VERTICES
      this.vertexIdsInCurrentView.clear();
      Map<String, Set<String>>dataAttributesForVertices = new HashMap<String, Set<String>>();
      for(StorableVertex bufVertex : ssg.getVertices()) {
        this.vertexIdsInCurrentView.add(bufVertex.getStorableId());
        List<StorableAttribute>sal = bufVertex.getAttributes();
        if(sal != null) {
          for(StorableAttribute bufAttr : sal) {
            if(bufAttr.getName() != null && bufAttr.getValue() != null) {
              Set<String>value = dataAttributesForVertices.get(bufAttr.getName());
              if(value == null) {
                value = new HashSet<String>();
                dataAttributesForVertices.put(bufAttr.getName(), value);
              }
              value.add(bufAttr.getValue());
            } else {
              VisualGraph.log.printError("[" + this.getClass().getName() + ".changeView]" + " [BAD] Error in filter panel. Attribute name or attribute value = null(Vertex)");
            }
          }
        }
      } // end of vertex cycle
      this.vertexConditionalPanel.setNewDataAttributes(dataAttributesForVertices);
      // EDGES
      this.edgeIdsInCurrentView.clear();
      Map<String, Set<String>>dataAttributesForEdges = new HashMap<String, Set<String>>();
      for(StorableEdge bufEdge : ssg.getEdges()) {
        this.edgeIdsInCurrentView.add(bufEdge.getStorableId());
        List<StorableAttribute>sal = bufEdge.getStorableAttributes();
        if(sal != null) {
          for(StorableAttribute bufAttr : sal) {
            if(bufAttr.getName() != null && bufAttr.getValue() != null) {
View Full Code Here

      List<Integer>lvsids = buildRequest(id, this.vertexConditionalPanel.getRequest("v.db_id_vertex", 0), this.vertexIdsInCurrentView, 0);
      List<Integer>lesids = buildRequest(id, this.edgeConditionalPanel.getRequest("e.db_id_edge", 1), this.edgeIdsInCurrentView, 1);
      Set<Integer>lviids = new HashSet<Integer>();
      Set<Integer>leiids = new HashSet<Integer>();
      if(this.actionMode == DEF_ACTION_MODE_1 || this.actionMode == DEF_ACTION_MODE_2) {
        StorableSubGraph ssg = this.currentView.getStorableSubGraph();
        if(ssg != null) {
          List<StorableVertex>lsv = ssg.getVertices();
          List<StorableEdge>lse = ssg.getEdges();
          if(lsv != null) {
            for(StorableVertex bufVertex : lsv) {
              if(!lvsids.contains(bufVertex.getStorableId())) {
                lviids.add(bufVertex.getStorableId());
              }
View Full Code Here

TOP

Related Classes of vg.core.storableGraph.StorableSubGraph

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.