Package vg.core.storableGraph

Examples of vg.core.storableGraph.StorableVertex


      ResultSet resultVertex = vertexStatement.executeQuery(request);
      while(resultVertex.next()) {
        int db_id_vertex = resultVertex.getInt(1);
        String id_vertex = resultVertex.getString(2);
        Integer db_id_innder_graph = (Integer)resultVertex.getObject(3);
        StorableVertex v = new StorableVertex(db_id_vertex, id_vertex);
        v.setInnerGraph(db_id_innder_graph);
        listVertex.add(v);
        //attributes-----------------
        Statement attrStatement = null;
        try {
          attrStatement = this.currConnection.createStatement();
          request = "select s2.db_id, s2.name, s2.value " +
                    "from com_vertex_attribute s1, attribute s2 " +
                    "where s1.db_id_vertex = " + (new Integer(db_id_vertex)).toString() + " and s2.db_id = s1.db_id_attribute;";
          ResultSet resultAttribute = attrStatement.executeQuery(request);
          while(resultAttribute.next()) {
            int db_id_attr = resultAttribute.getInt(1);
            String db_name = resultAttribute.getString(2);
            String db_value = resultAttribute.getString(3);
            v.addStorableAttribute(new StorableAttribute(db_id_attr, db_name, db_value));
          }
        } catch(SQLException ex) {
          VisualGraph.log.printException(ex);
        } finally {
          if(attrStatement != null) {
              try {
                attrStatement.close();
              } catch(SQLException ex) {
                VisualGraph.log.printException(ex);
              }
          }
        }
      }
    } catch (SQLException ex) {
       VisualGraph.log.printException(ex);
    } finally {
      if(vertexStatement != null) {
          try {
            vertexStatement.close();
          } catch(SQLException ex) {
            VisualGraph.log.printException(ex);
          }
      }
    }
    //edges--------------------------
    ArrayList<StorableEdge>listEdge = new ArrayList<StorableEdge>();
    Statement edgeStatement = null;
    try {
      edgeStatement = this.currConnection.createStatement();
      request = "select s2.db_id, s2.id, s2.db_id_source, db_id_target " +
                "from com_subgraph_edge s1, edge s2 " +
                "where s1.db_id_subgraph = " + (new Integer(id_subgraph)).toString() + " and s2.db_id = s1.db_id_edge;";
      ResultSet resultEdge = edgeStatement.executeQuery(request);
      while(resultEdge.next()) {
        int db_id_edge = resultEdge.getInt(1);
        String id_edge = resultEdge.getString(2);
        Integer db_id_source = (Integer)resultEdge.getObject(3);
        Integer db_id_target = (Integer)resultEdge.getObject(4);
        if(db_id_source != null && db_id_target != null) {
          StorableVertex source = null, target = null;
          for(StorableVertex bufVertex : listVertex) {
            if(bufVertex.getStorableId() == db_id_source) {
              source = bufVertex;
            }
            if(bufVertex.getStorableId() == db_id_target) {
View Full Code Here


                nestedVertex = new ArrayList<StorableVertex>();
                nestedEdge = new ArrayList<PseudoEdge>();
            }

            void addVertex(String id) {
                lastVertex.push(new StorableVertex(id));
                m_nodeMap.put(id, lastVertex.lastElement());
                nestedVertex.add(lastVertex.lastElement());
            }
View Full Code Here

   * This method adds new tab in navigator.
   */
  private void addTabInNavigator(StorableSubGraph ssg, int tabId, String tabName) {
    List<StorableVertex>asv = ssg.getVertices();
    if(asv != null && asv.size() > 0) {
      StorableVertex sv = asv.get(0);
      StringBuffer request = new StringBuffer(256);
      request.append("select s1.db_id from subgraph s1, com_subgraph_vertex s2 where s1.db_id = s2.db_id_subgraph and s2.db_id_vertex = ");
      request.append(sv.getStorableId());
      request.append(";");
      List<List<Object>> resultSubGraph = this.parameter.model
          .executeSQLRequest(request.toString());
      request.setLength(0);
      if (resultSubGraph != null &&  !resultSubGraph.isEmpty()) {
View Full Code Here

          str = input.readLine().trim();
          i0 = 0;
        } while (true);
       
       
        StorableVertex s = null;
        StorableVertex t = null;
       
        for (i = 0; i < vertexes.size(); i++) {
          if (vertexes.get(i).getId().compareTo(source) == 0)
            s = vertexes.get(i);
          if (vertexes.get(i).getId().compareTo(target) == 0)
View Full Code Here

            break;
          s = input.readLine().trim();
          i0 = 0;
        } while (true);
       
      return new StorableVertex(id);
    }
View Full Code Here

TOP

Related Classes of vg.core.storableGraph.StorableVertex

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.