/** * Create a new, empty Tree. */ public Tree() { super(new Table(), false); }
/** * Creates a new, empty Graph. * @param directed true for directed edges, false for undirected */ public Graph(boolean directed) { this(new Table(), directed); }
/** * Instantiate this schema as a new Table instance. * @param nrows the number of starting rows in the table * @return a new Table with this schema */ public Table instantiate(int nrows) { Table t = new Table(nrows, m_size); for ( int i=0; i<m_size; ++i ) { t.addColumn(m_names[i], m_types[i], m_dflts[i]); } return t; }
@Override public Table getNodeTable() { if (network == null) { return new Table(); } return new WrapToPrefTable(network.getNodeTable()); }
@Override public Table getEdgeTable() { if (network == null) { return new Table(); } return new WrapToPrefTable(network.getEdgeTable()); }
/** * Create a new Graph using the provided table of node data and * an empty set of edges. * @param nodes the backing table to use for node data. * Node instances of this graph will get their data from this table. * @param directed true for directed edges, false for undirected * @param nodeKey data field used to uniquely identify a node. If this * field is null, the node table row numbers will be used * @param sourceKey data field used to denote the source node in an edge * table * @param targetKey data field used to denote the target node in an edge * table */ public Graph(Table nodes, boolean directed, String nodeKey, String sourceKey, String targetKey) { Table edges = new Table(); edges.addColumn(sourceKey, int.class, new Integer(-1)); edges.addColumn(targetKey, int.class, new Integer(-1)); init(nodes, edges, directed, nodeKey, sourceKey, targetKey); }
@Override public TupleSet getNodes() { TupleSet nodes = new Table(); for (obvious.data.Node node : network.getNodes()) { nodes.addTuple(new WrapToPrefNode(network, (TupleImpl) node, node.getRow())); } return nodes; }
Table agg_tab = new Table(); agg_tab.addColumn("stat", long.class); min = Long.MAX_VALUE;
/** * Constructor that used Obvious Schema to wrap Prefuse Tables. * @param schema original obvious schema for the table */ public PrefuseObviousTable(Schema schema) { this.table = new prefuse.data.Table(0, schema.getColumnCount()); this.listener = new ArrayList<TableListener>(); for (int i = 0; i < schema.getColumnCount(); i++) { this.table.addColumn(schema.getColumnName(i), schema.getColumnType(i), schema.getColumnDefault(i)); } }
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); this.plot_tab.addColumn(END_FIELD_NAME,double.class); this.plot_tab.addColumn(PolygonRenderer.POLYGON,float[].class); this.reducepart_hash = new HashMap<String, ArrayList<Tuple> >(); }
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)); } }
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)); }
final Table table = new Table(nrows, ncols);
protected void addLegend() { SwimlanesStatePalette ssp = new SwimlanesStatePalette(); Table shapes_table = new Table(); shapes_table.addColumn(VisualItem.X,float.class); shapes_table.addColumn(VisualItem.Y,float.class); Table legend_labels_table = new Table(); legend_labels_table.addColumn("label",String.class);
protected void addAddlInfo(HeatmapData hd) { Table legend_labels_table = new Table(); legend_labels_table.addColumn("label",String.class); legend_labels_table.addRows(3);
/** * Constructor from a prefuse schema instance. * @param prefuseSchema A prefuse schema to wrap around Obvious schema. */ public PrefuseObviousSchema(prefuse.data.Schema prefuseSchema) { this.schema = prefuseSchema; prefuse.data.Table prefuseSchemaTable = new prefuse.data.Table(this.schema.getColumnCount(), SCHEMA_COL_NUMBER); prefuseSchemaTable.addColumn("Name", String.class); prefuseSchemaTable.addColumn("Type", Class.class); prefuseSchemaTable.addColumn("Default Value", Object.class); for (int i = 0; i < this.schema.getColumnCount(); i++) { prefuseSchemaTable.set(i, "Name", this.schema.getColumnName(i)); prefuseSchemaTable.set(i, "Type", this.schema.getColumnType(i)); prefuseSchemaTable.set(i, "Default Value", this.schema.getDefault(i)); } this.schemaTable = new PrefuseObviousTable(prefuseSchemaTable); }