Package prefuse.data.column

Examples of prefuse.data.column.Column


    protected void filterColumns() {
        if ( m_parent == null ) return;
       
        for ( int i=0; i<m_pnames.size(); ++i ) {
            String name = (String)m_pnames.get(i);
            Column col = m_parent.getColumn(i);
            boolean contained = m_names.contains(name);
            if ( !m_colFilter.include(col, name) || contained ) {
                m_pnames.remove(i--);
                if ( !contained ) {
                    ((ColumnEntry)m_entries.get(name)).dispose();
                    m_entries.remove(name);
                }
               
                // fire notification
                fireTableEvent(m_rows.getMinimumRow(),
                               m_rows.getMaximumRow(),
                               i, EventConstants.DELETE);
            }
        }
       
        m_pnames.clear();

        Iterator pcols = m_parent.getColumnNames();
        for ( int i=0, j=m_columns.size(); pcols.hasNext(); ++i ) {
            String name = (String)pcols.next();
            Column col  = m_parent.getColumn(i);
           
            if ( m_colFilter.include(col, name) && !m_names.contains(name) ) {
                m_pnames.add(name);
                ColumnEntry entry = (ColumnEntry)m_entries.get(name);
                if ( entry == null ) {
View Full Code Here


     * Get the data type of the column with the given data field name.
     * @param field the column / data field name
     * @return the data type (as a Java Class) of the column
     */
    public Class getColumnType(String field) {
        Column c = getColumn(field);
        return (c==null ? null : c.getColumnType());
    }
View Full Code Here

        int maxrow = m_rows.getMaximumRow() + 1;
       
        // update columns
        Iterator cols = getColumns();
        while ( cols.hasNext() ) {
            Column c = (Column)cols.next();
            c.setMaximumRow(maxrow);
        }
    }
View Full Code Here

            // do this before clearing column values, so that any
            // listeners can determine that the row is invalid
            m_rows.releaseRow(row);
            // now clear column values
            for ( Iterator cols = getColumns(); cols.hasNext(); ) {
                Column c = (Column)cols.next();
                c.revertToDefault(row);
            }
            return true;
        }
        return false;
    }
View Full Code Here

     * @param type the data type, as a Java Class, for the column
     * @param defaultValue the default value for column data values
     * @see prefuse.data.tuple.TupleSet#addColumn(java.lang.String, java.lang.Class, java.lang.Object)
     */
    public void addColumn(String name, Class type, Object defaultValue) {
        Column col = ColumnFactory.getColumn(type,
                        m_rows.getMaximumRow()+1, defaultValue);
        addColumn(name, col);
    }
View Full Code Here

            throw new IllegalArgumentException("Column index is not legal.");
        }
       
        String name = (String)m_names.get(idx);
        ((ColumnEntry)m_entries.get(name)).dispose();
        Column col = (Column)m_columns.remove(idx);
        m_entries.remove(name);
        m_names.remove(idx);
        renumberColumns();
       
        m_lastCol = -1;
        invalidateSchema();
       
        // ignore what the old column has to say
        col.removeColumnListener(this);
       
        // fire notification
        fireTableEvent(m_rows.getMinimumRow(), m_rows.getMaximumRow(),
                       idx, TableModelEvent.DELETE);
       
View Full Code Here

            throw new IllegalArgumentException("Unknown column name: "+field);
        } else if ( e.index != null ) {
            return e.index; // already indexed
        }
       
        Column col = e.column;
        try {
            e.index = new TreeIndex(this, m_rows, col, null);
        } catch ( IncompatibleComparatorException ice ) { /* can't happen */ }
       
        return e.index;
View Full Code Here

     * false otherwise. If the value is true, objects returned by
     * the {@link #get(int, String)} can be cast to the given type.
     * @see #get(int, String)
     */
    public boolean canGet(String field, Class type) {
        Column c = getColumn(field);
        return ( c==null ? false : c.canGet(type) );
    }
View Full Code Here

     * can be used as parameters of the {@link #set(int, String, Object)}
     * method.
     * @see #set(int, String, Object)
     */
    public boolean canSet(String field, Class type) {
        Column c = getColumn(field);
        return ( c==null ? false : c.canSet(type) );
    }
View Full Code Here

     * @return true if the data field can return primitive <code>int</code>
     * values, false otherwise. If true, the {@link #getInt(int, String)}
     * method can be used safely.
     */
    public final boolean canGetInt(String field) {
        Column col = getColumn(field);
        return ( col==null ? false : col.canGetInt() );
    }
View Full Code Here

TOP

Related Classes of prefuse.data.column.Column

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.