prefuse.Visualization.addTable()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(6.4k)|赞(0)|评价(0)|浏览(135)

本文整理了Java中prefuse.Visualization.addTable()方法的一些代码示例,展示了Visualization.addTable()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Visualization.addTable()方法的具体详情如下:
包路径:prefuse.Visualization
类名称:Visualization
方法名:addTable

Visualization.addTable介绍

[英]Add an empty VisualTable to this visualization, using the given data group name. This adds a group of VisualItems that do not have a backing data set, useful for creating interactive visual objects that do not represent data. An exception will be thrown if the group name is already in use.
[中]使用给定的数据组名称将空的VisualTable添加到此可视化中。这将添加一组没有支持数据集的Visualitem,用于创建不表示数据的交互式可视对象。如果组名已在使用中,将引发异常。

代码示例

代码示例来源:origin: de.sciss/prefuse-core

/**
 * Adds a data table to this visualization, using the given data group
 * name. A visual abstraction of the data will be created and registered
 * with the visualization. An exception will be thrown if the group name
 * is already in use.
 * @param group the data group name for the visualized data
 * @param table the data table to visualize
 */
public synchronized VisualTable addTable(String group, Table table) {
  return addTable(group, table, (Predicate)null);
}

代码示例来源:origin: apache/chukwa

public VisualTable addToVisualization(Visualization viz, String groupname) {
  return viz.addTable(groupname, this.plot_tab);
 }
}

代码示例来源:origin: de.sciss/prefuse-core

/**
 * Adds a data table to this visualization, using the given data group
 * name. A visual abstraction of the data will be created and registered
 * with the visualization. An exception will be thrown if the group name
 * is already in use.
 * @param group the data group name for the visualized data
 * @param table the data table to visualize
 * @param schema the data schema to use for the created VisualTable
 */
public synchronized VisualTable addTable(
    String group, Table table, Schema schema)
{
  return addTable(group, table, null, schema);
}

代码示例来源:origin: de.sciss/prefuse-core

/**
 * Add a data set to this visualization, using the given data group name.
 * A visual abstraction of the data will be created and registered with
 * the visualization. An exception will be thrown if the group name is
 * already in use.
 * @param group the data group name for the visualized data
 * @param data the data to visualize
 * @param filter a filter Predicate determining which data Tuples in the
 * input data set are visualized
 * @return a visual abstraction of the input data, a VisualTupleSet
 * instance
 */
public synchronized VisualTupleSet add(
    String group, TupleSet data, Predicate filter)
{
  if ( data instanceof Table ) {
    return addTable(group, (Table)data, filter);
  } else if ( data instanceof Tree ) {
    return addTree(group, (Tree)data, filter);
  } else if ( data instanceof Graph ) {
    return addGraph(group, (Graph)data, filter);
  } else {
    throw new IllegalArgumentException("Unsupported TupleSet type.");
  }
}

代码示例来源:origin: de.sciss/prefuse-core

/**
 * Create a new table for representing axis labels.
 */
protected VisualTable getTable() {
  TupleSet ts = m_vis.getGroup(m_group);
  if ( ts == null ) {
    Schema s = PrefuseLib.getAxisLabelSchema();
    VisualTable vt = m_vis.addTable(m_group, s);
    vt.index(VALUE);
    return vt;
  } else if ( ts instanceof VisualTable ) {
    return (VisualTable)ts;
  } else {
    throw new IllegalStateException(
      "Group already exists, not being used for labels");
  }
}

代码示例来源:origin: com.googlecode.obvious/obvious-prefuse

/**
 * Loads data into the visualization.
 * @param data data to load.
 */
public void setVisualizationData(Data data) {
 if (data instanceof Table) {
  vis.addTable(groupName, getPrefuseTable());
 } else if (data instanceof Network) {
  vis.addGraph(groupName, ((prefuse.data.Graph) ((Network) data)
    .getUnderlyingImpl(prefuse.data.Graph.class)));
 }
}

代码示例来源:origin: com.googlecode.obvious/obvious-prefuse

/**
 * Inits a standard prefuse visualization.
 * @param param param of the visualization.
 */
protected void initVisualization(Map<String, Object> param) {
 groupName = "tupleset";
 if (param != null) {
  if (param.containsKey(GROUP_NAME)) {
   groupName = (String) param.get(GROUP_NAME);
  }
  if (param.containsKey(DIRECTED)) {
   directed = (Boolean) param.get(DIRECTED);
  }
  if (param.containsKey(NODE_KEY)) {
   nodeKey = (String) param.get(NODE_KEY);
  }
 }
 vis = new prefuse.Visualization();
 if (this.getData() instanceof Table) {
  vis.addTable(groupName, getPrefuseTable());
 } else if (this.getData() instanceof Network) {
  vis.addGraph(groupName, getPrefuseNetwork());
 }
}

代码示例来源:origin: apache/chukwa

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);
 for (int i = 0; i < hd.hostnames.length; i++) {
  legend_labels_table_viz.setFloat(i, VisualItem.X, start_x + LEGEND_TEXT_OFFSET);
  legend_labels_table_viz.setFloat(i, VisualItem.Y, start_y + (i * incr));
  legend_labels_table_viz.setTextColor(i,ColorLib.color(java.awt.Color.BLACK));
  legend_labels_table_viz.setFont(i,new Font(Font.SANS_SERIF,Font.PLAIN,LEGEND_FONT_SIZE));
 } 
}

代码示例来源:origin: apache/chukwa

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","Time/s");
 textlabels_table.setString(0,"type","xaxisname");
 
 VisualTable textlabelsviz = this.viz.addTable(labelgroup, textlabels_table);
 textlabelsviz.setX(0,SIZE_X/2d);
 textlabelsviz.setY(0,SIZE_Y - BORDER[2] + (BORDER[2]*0.1));
 textlabelsviz.setTextColor(0,ColorLib.color(java.awt.Color.GRAY));
 textlabelsviz.setFont(0,new Font(Font.SANS_SERIF,Font.PLAIN,AXIS_NAME_FONT_SIZE));
}

代码示例来源:origin: apache/chukwa

VisualTable shapes_table_viz = viz.addTable(legendshapegroup, shapes_table);
float start_x = BORDER[0] + LEGEND_X_OFFSET;
float start_y = BORDER[1] + LEGEND_Y_OFFSET;
VisualTable legend_labels_table_viz = this.viz.addTable(legendgroup, legend_labels_table);
for (int i = 0; i < num_states; i++) {
 legend_labels_table_viz.setFloat(i, VisualItem.X, start_x + LEGEND_TEXT_OFFSET);

代码示例来源:origin: de.sciss/prefuse-core

nt = addTable(nGroup, tree.getNodeTable(), filter, nodeSchema);
et = addTable(eGroup, tree.getEdgeTable(), filter, edgeSchema);

代码示例来源:origin: apache/chukwa

legend_labels_table.setString(2,"label","Dest. Hosts");
VisualTable legend_labels_table_viz = this.viz.addTable(addinfogroup, legend_labels_table);

代码示例来源:origin: de.sciss/prefuse-core

nt = addTable(nGroup, graph.getNodeTable(), filter, nodeSchema);
et = addTable(eGroup, graph.getEdgeTable(), filter, edgeSchema);

代码示例来源:origin: apache/chukwa

VisualTable data_tab_viz = viz.addTable(maingroup, hd.agg_tab);
setupHeatmap(data_tab_viz, hd);

相关文章