Package prefuse.data

Examples of prefuse.data.Table$ColumnEntry


       
        //=== Counter for loop
        int nodeCount = Array.getLength(paperList);
       
        //=== Instatiate the table for the nodes
        Table node_table = nodeSchema.instantiate();
       
        for (int i=0; i<nodeCount; i++)
        {                                  
           //==== Generate the table row
            node_table.addRow();
            node_table.setInt(i, "DEFAULT_NODE_KEY", paperList[i].getDefaultNodeKey());
            node_table.setString(i, "bibcode", paperList[i].getBibcode());
            node_table.setString(i, "title", paperList[i].getTitle());
            node_table.setString(i, "authorList", paperList[i].getAuthorList());
            node_table.setString(i, "date", paperList[i].getDate());
            node_table.setString(i, "journal", paperList[i].getJournal());
            node_table.setString(i, "citCount", paperList[i].getCitCount());
            node_table.setString(i, "abstractURL", paperList[i].getAbstractURL());
            node_table.setString(i, "refType", paperList[i].getRefType());
            node_table.setString(i, "nodeLabel", paperList[i].getNodeLabel());
            node_table.setString(i, "hoverLabel", paperList[i].getHoverLabel());
            node_table.setString(i, "visible", "true");
            node_table.setString(i, "comment", "");
            node_table.setString(i, "commentStatus", "f");
            node_table.setDouble(i, "xCoordinate", 0);
            node_table.setDouble(i, "yCoordinate", 0);
          
        }
       
        return node_table;
       
View Full Code Here


    //=== Generate a table of edges
    public Table generateSecondEdgesTable(int newFocus, Paper[] dupeNodes)
    {
        int rowCount = 0;
       
        Table edge_table = edgeSchema.instantiate();
        //==== Loop through the duplicate nodes, creating edges to the new index
        for (int i=0; i<Array.getLength(dupeNodes); i++)
        {
            //=== Add a row for the 'ref' type links
            if(dupeNodes[i].getRefType().equals("REFERENCES"))
            {
             edge_table.addRow();
             edge_table.setInt(rowCount, "source", newFocus);
             edge_table.setInt(rowCount, "target", dupeNodes[i].getDefaultNodeKey());
             //edge_table.setString(rowCount, "edgeType", "ref");
             rowCount++;
            }
            //=== Add a row for the 'cit' type links
            else if (dupeNodes[i].getRefType().equals("CITATIONS"))
            {
             edge_table.addRow();
             edge_table.setInt(rowCount, "source", dupeNodes[i].getDefaultNodeKey());
             edge_table.setInt(rowCount, "target", newFocus);
             //edge_table.setString(rowCount, "edgeType", "cit");
             rowCount++;               
            }
        }
       
        //==== Loop through all the new papers, adding an edge from each to the new index
        for (int j=0; j<Array.getLength(paperList); j++)
        {
            
             //=== Add a row for the 'ref' type links
             if(paperList[j].getRefType().equals("REFERENCES"))
             {
                edge_table.addRow();
                edge_table.setInt(rowCount, "source", newFocus);
                edge_table.setInt(rowCount, "target", this.paperList[j].getDefaultNodeKey());
                //edge_table.setString(rowCount, "edgeType", "ref");
                rowCount++;
             }            
             //=== Add a row for the 'cit' type links
             else if(paperList[j].getRefType().equals("CITATIONS"))
             {
                edge_table.addRow();
                edge_table.setInt(rowCount, "source", this.paperList[j].getDefaultNodeKey());
                edge_table.setInt(rowCount, "target", newFocus);
                //edge_table.setString(rowCount, "edgeType", "cit");
                rowCount++;
             }            
        }
       
View Full Code Here

    /* package */ GraphBuilder()
    {
        graph = new Graph( true );

        Table nodeTable = graph.getNodeTable();
        nodeTable.addColumn( GraphDisplay.NAME_LABEL, String.class );
        nodeTable.addColumn( GraphDisplay.USER_OBJECT, Object.class );

        Table edgeTable = graph.getEdgeTable();
        edgeTable.addColumn( GraphDisplay.USES_EDGES, boolean.class, false );

        childList = new ArrayList();
    }
View Full Code Here

    protected Table plot_tab;
    protected HashMap<String, ArrayList<Tuple> > reducepart_hash;
    protected boolean collate_reduces = false;
   
    public MapReduceSwimlanes() {
      this.plot_tab = new Table();
      this.plot_tab.addColumn("ycoord",float.class);
      this.plot_tab.addColumn("state_name",String.class);
      this.plot_tab.addColumn("hostname",String.class);
      this.plot_tab.addColumn("friendly_id",String.class);
      this.plot_tab.addColumn(START_FIELD_NAME,double.class);
View Full Code Here

    this.viz.putAction("gridlayout",gl_list);
    this.viz.run("gridlayout");
  }
 
  protected void addHostLabels(HeatmapData hd) {
    Table legend_labels_table = new Table();
    legend_labels_table.addColumn("label",String.class);
    legend_labels_table.addRows(hd.hostnames.length);
    for (int i = 0; i < hd.hostnames.length; i++) {
      legend_labels_table.setString(i,"label",hd.hostnames[i]);
    }
    float start_x = LEGEND_X_OFFSET;
    float start_y = LEGEND_Y_OFFSET + BORDER[1] + (BOXWIDTH/2);   
    float incr = this.BOXWIDTH;
    VisualTable legend_labels_table_viz = this.viz.addTable(legendgroup, legend_labels_table);
View Full Code Here

      legend_labels_table_viz.setFont(i,new Font(Font.SANS_SERIF,Font.PLAIN,LEGEND_FONT_SIZE));
    }
  }
 
  protected void addAddlInfo(HeatmapData hd) {
    Table legend_labels_table = new Table();
    legend_labels_table.addColumn("label",String.class);
    legend_labels_table.addRows(3);
   
    String hostnumstring = "Number of hosts: " + hd.num_hosts;
    if (sort_nodes) {
      hostnumstring += " (nodes sorted)";
    } else {
      hostnumstring += " (nodes not sorted)";
    }
    if (add_info_extra != null) hostnumstring += add_info_extra;
    legend_labels_table.setString(0,"label",hostnumstring);
    legend_labels_table.setString(1,"label","Src. Hosts");
    legend_labels_table.setString(2,"label","Dest. Hosts");
   
    float start_x = LEGEND_X_OFFSET;
    float start_y = LEGEND_Y_OFFSET + BORDER[1] + (BOXWIDTH/2);   
    float incr = this.BOXWIDTH;
    VisualTable legend_labels_table_viz = this.viz.addTable(addinfogroup, legend_labels_table);
View Full Code Here

    if (sort_nodes) {
      permute = hClust(stats);
      stats = doPermute(stats,permute);
    }
   
    Table agg_tab = new Table();
    agg_tab.addColumn("stat", long.class);
    min = Long.MAX_VALUE;
    max = Long.MIN_VALUE;
    agg_tab.addRows(num_hosts*num_hosts);
   
    // row-wise placement (row1, followed by row2, etc.)
    for (int i = 0; i < num_hosts; i++) {
      for (int j = 0; j < num_hosts; j++) {
        agg_tab.setLong((i*num_hosts)+j,"stat",stats[i][j]);
        if (stats[i][j] > max) max = stats[i][j];
        if (stats[i][j] > 0 && stats[i][j] < min) min = stats[i][j];
      }
    }
    if (min == Long.MAX_VALUE) min = 0;
View Full Code Here

  protected Table addTimeOffsetCol
    (Table origTable, String srcFieldName,
     String srcMillisecondFieldName, String dstFieldName,
     long timeOffset)
  {
    Table newtable = addTimeCol(origTable, srcFieldName,
      srcMillisecondFieldName, dstFieldName + "_fulltime");
     
    ColumnMetadata dstcol = newtable.getMetadata(dstFieldName + "_fulltime");
    long mintime = newtable.getLong(dstcol.getMinimumRow(), dstFieldName + "_fulltime");
   
    if (timeOffset == 0) {
      newtable.addColumn(dstFieldName, "ROUND((["+dstFieldName+"_fulltime] - " + mintime +"L) / 1000L)");
    } else {
      newtable.addColumn(dstFieldName, "ROUND((["+dstFieldName+"_fulltime] - " + timeOffset +"L) / 1000L)");     
    }
   
    return newtable;
  }
View Full Code Here

    });
  }
 
  // setup columns: add additional time fields
  protected Table setupDataTable() {
    Table res_tab = this.getData();   
    if (res_tab == null) {
        return res_tab;
    }
   
    res_tab.addColumn("seqno","ROW()");
    res_tab = addTimeOffsetCol(res_tab, "start_time", "start_time_millis", START_FIELD_NAME, 0);   
    ColumnMetadata dstcol = res_tab.getMetadata(START_FIELD_NAME);
    long mintime = ((Timestamp)res_tab.get(dstcol.getMinimumRow(), "start_time")).getTime();
    res_tab = addTimeOffsetCol(res_tab, "finish_time", "finish_time_millis", END_FIELD_NAME, mintime);   
    res_tab.addColumn(PolygonRenderer.POLYGON,float[].class);
   
    log.debug("After adding seqno: #cols: " + res_tab.getColumnCount() + "; #rows: " + res_tab.getRowCount());
   
    return res_tab;
  }
View Full Code Here

   
    return res_tab;
  }
 
  protected void addAxisNames() {
    Table textlabels_table = new Table();
    textlabels_table.addColumn("label",String.class);
    textlabels_table.addColumn("type",String.class);
    textlabels_table.addRow();
    textlabels_table.setString(0,"label",new String("Time/s"));
    textlabels_table.setString(0,"type",new String("xaxisname"));
   
    VisualTable textlabelsviz = this.viz.addTable(labelgroup, textlabels_table);
    textlabelsviz.setX(0,SIZE_X/2);
    textlabelsviz.setY(0,SIZE_Y - BORDER[2] + (BORDER[2]*0.1));
    textlabelsviz.setTextColor(0,ColorLib.color(java.awt.Color.GRAY));
View Full Code Here

TOP

Related Classes of prefuse.data.Table$ColumnEntry

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.