Package prefuse.data

Examples of prefuse.data.Schema


    Integer[].class,
    String[].class,
  };

  public static Table copyTable(Table oldTable) {
    Schema oldSchema = oldTable.getSchema();
    Table newTable = oldSchema.instantiate();
   
    for (Iterator rowIt = oldTable.tuples(); rowIt.hasNext();) {
      Tuple row = (Tuple) rowIt.next();     
      newTable.addTuple(row);
    }   
View Full Code Here


  public static Table copyNRowsFromTableUsingIntIterator(
      Table originalTable, IntIterator iterator, int topN, boolean isDescending)
  {
    // TODO: Add a couple comments in this method
   
    Schema tableSchema = originalTable.getSchema();
    final int numTableRows = originalTable.getRowCount();
    Table newTable = createTableUsingSchema(tableSchema);
    final int numRowsToCopy = Math.min(numTableRows, topN);
    int[] originalTableRowsToCopy = new int [numTableRows];
   
View Full Code Here

      throw new IllegalArgumentException();
   
    Table returnTable = new Table();
   
    // grabs info about inputData
    Schema oldSchema = inputTable.getSchema();   
    final int numTableColumns = oldSchema.getColumnCount();
    final int numTableRows = inputTable.getRowCount();
   
    Map<String, String> headerMap = readHeaderProperties(propertiesFilePath);
   
    // add columns to return table, correcting them as iteration proceeds
    for (int i = 0; i < numTableColumns; i++) {
      String colHead = oldSchema.getColumnName(i);
     
      // check for columns that need updating here
      String newHeader = headerMap.get(colHead);
      if (newHeader != null)
        colHead = newHeader;
     
      returnTable.addColumn(colHead, oldSchema.getColumnType(i));
    }
   
    // add existing rows to return table
    returnTable.addRows(numTableRows);
    for (int i = 0; i < numTableRows; i++) {
View Full Code Here

 
 
  private static void runBasicTests(GraphComparer comparer,
      boolean idsPreserved) {
//    setup
    Schema edgeTableSchema = new Schema();
    edgeTableSchema.addColumn(Graph.DEFAULT_SOURCE_KEY, Integer.class);
    edgeTableSchema.addColumn(Graph.DEFAULT_TARGET_KEY, Integer.class);
   
    //test1
    Graph emptyGraph1 = new Graph();
    Graph emptyGraph2 = new Graph();
   
View Full Code Here

        graph.addColumns(schema);
        return graph;
    }

    private Schema getSchema() {
        Schema schema = new Schema();
        schema.addColumn("type", Class.class, null);
        return schema;
    }
View Full Code Here

    public String writeManualXML(Graph g)
    {
        //==== Get the tables and schemas from the graph
        Table nodes = g.getNodeTable();
        Table edges = g.getEdgeTable();
        Schema nodeSchema = nodes.getSchema();
        Schema edgeSchema = edges.getSchema();
       
        //==== Generate the XML header, and data schema for visualization
        String header = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n" +
                        "<!--  A paper and all its citations and references  -->\n" +
                        "<graphml xmlns=\"http://graphml.graphdrawing.org/xmlns\">\n" +
View Full Code Here

   
//###################################################################################################   
    public void createSchema()
    {
        //==== Create the node table schema
        this.nodeSchema = new Schema();
        nodeSchema.addColumn("DEFAULT_NODE_KEY", int.class);
        nodeSchema.addColumn("bibcode", String.class);
        nodeSchema.addColumn("title", String.class);
        nodeSchema.addColumn("authorList", String.class);
        nodeSchema.addColumn("date", String.class);
        nodeSchema.addColumn("journal", String.class);
        nodeSchema.addColumn("citCount", String.class);
        nodeSchema.addColumn("abstractURL", String.class);
        nodeSchema.addColumn("refType", String.class);
        nodeSchema.addColumn("nodeLabel", String.class);
        nodeSchema.addColumn("hoverLabel", String.class);
        nodeSchema.addColumn("visible", String.class);
        nodeSchema.addColumn("comment", String.class);
        nodeSchema.addColumn("commentStatus", String.class);
        nodeSchema.addColumn("xCoordinate", double.class);
        nodeSchema.addColumn("yCoordinate", double.class);
        nodeSchema.addColumn("refHidden", String.class);
        nodeSchema.addColumn("citHidden", String.class);
        nodeSchema.addColumn("refExpanded", String.class);
        nodeSchema.addColumn("citExpanded", String.class);
       
        //==== Create the edge table schema
        this.edgeSchema = new Schema();
        edgeSchema.addColumn("source", int.class);
        edgeSchema.addColumn("target", int.class);
        //edgeSchema.addColumn("edgeType", String.class);
    }   
View Full Code Here

     * 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;
View Full Code Here

     * and validated, visibility, interactive, fixed, highlight, and mouse
     * hover fields.
     * @return the VisualItem data Schema
     */
    public static Schema getVisualItemSchema() {
        Schema s = new Schema();
       
        // booleans
        s.addColumn(VisualItem.VALIDATED, boolean.class, Boolean.FALSE);
        s.addColumn(VisualItem.VISIBLE, boolean.class, Boolean.TRUE);
        s.addColumn(VisualItem.STARTVISIBLE, boolean.class, Boolean.FALSE);
        s.addColumn(VisualItem.ENDVISIBLE, boolean.class, Boolean.TRUE);
        s.addColumn(VisualItem.INTERACTIVE, boolean.class, Boolean.TRUE);
        s.addColumn(VisualItem.EXPANDED, boolean.class, Boolean.TRUE);
        s.addColumn(VisualItem.FIXED, boolean.class, Boolean.FALSE);
        s.addColumn(VisualItem.HIGHLIGHT, boolean.class, Boolean.FALSE);
        s.addColumn(VisualItem.HOVER, boolean.class, Boolean.FALSE);
       
        s.addInterpolatedColumn(VisualItem.X, double.class);
        s.addInterpolatedColumn(VisualItem.Y, double.class);
       
        // bounding box
        s.addColumn(VisualItem.BOUNDS, Rectangle2D.class, new Rectangle2D.Double());
       
        // color
        Integer defStroke = new Integer(ColorLib.rgba(0,0,0,0));
        s.addInterpolatedColumn(VisualItem.STROKECOLOR, int.class, defStroke);

        Integer defFill = new Integer(ColorLib.rgba(0,0,0,0));
        s.addInterpolatedColumn(VisualItem.FILLCOLOR, int.class, defFill);

        Integer defTextColor = new Integer(ColorLib.rgba(0,0,0,0));
        s.addInterpolatedColumn(VisualItem.TEXTCOLOR, int.class, defTextColor);

        // size
        s.addInterpolatedColumn(VisualItem.SIZE, double.class, new Double(1));
       
        // shape
        s.addColumn(VisualItem.SHAPE, int.class,
            new Integer(Constants.SHAPE_RECTANGLE));
       
        // stroke
        s.addColumn(VisualItem.STROKE, Stroke.class, new BasicStroke());
       
        // font
        Font defFont = FontLib.getFont("SansSerif",Font.PLAIN,10);
        s.addInterpolatedColumn(VisualItem.FONT, Font.class, defFont);
       
        // degree-of-interest
        s.addColumn(VisualItem.DOI, double.class, new Double(Double.MIN_VALUE));

        return s;
    }
View Full Code Here

     * for derived groups that inherit other visual properties from a
     * another visual data group.
     * @return the minimal VisualItem data Schema
     */
    public static Schema getMinimalVisualSchema() {
        Schema s = new Schema();
       
        // booleans
        s.addColumn(VisualItem.VALIDATED, boolean.class, Boolean.FALSE);
        s.addColumn(VisualItem.VISIBLE, boolean.class, Boolean.TRUE);
        s.addColumn(VisualItem.STARTVISIBLE, boolean.class, Boolean.FALSE);
        s.addColumn(VisualItem.ENDVISIBLE, boolean.class, Boolean.TRUE);
        s.addColumn(VisualItem.INTERACTIVE, boolean.class, Boolean.TRUE);
       
        // bounding box
        s.addColumn(VisualItem.BOUNDS, Rectangle2D.class, new Rectangle2D.Double());
       
        return s;
    }
View Full Code Here

TOP

Related Classes of prefuse.data.Schema

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.