Package prefuse.data.util

Examples of prefuse.data.util.CascadedRowManager


            ColumnProjection colFilter, Class tupleType)
    {
        super(0, 0, tupleType);
        m_parent = parent;
        m_pnames = new ArrayList();
        m_rows = new CascadedRowManager(this);
        m_listener = new Listener();
       
        setColumnProjection(colFilter);
        setRowFilter(rowFilter);
        m_parent.addTableListener(m_listener);
View Full Code Here


     * @see prefuse.data.util.ValidEdgePredicate
     */
    public void filterRows() {
        if ( m_parent == null ) return;
       
        CascadedRowManager rowman = (CascadedRowManager)m_rows;
        IntIterator crows = m_rows.rows();
        while ( crows.hasNext() ) {
            int crow = crows.nextInt();
            if ( !m_rowFilter.getBoolean(
                    m_parent.getTuple(rowman.getParentRow(crow))) )
            {
                removeCascadedRow(crow);
            }
        }
       
        Iterator ptuples = m_parent.tuples(m_rowFilter);
        while ( ptuples.hasNext() ) {
            Tuple pt = (Tuple)ptuples.next();
            int prow = pt.getRow();
            if ( rowman.getChildRow(prow) == -1 )
                addCascadedRow(prow);
        }
    }
View Full Code Here

        public void tableChanged(Table t, int start, int end, int col, int type) {
            // must come from parent
            if ( t != m_parent )
                return;
           
            CascadedRowManager rowman = (CascadedRowManager)m_rows;
           
            // switch on the event type
            switch ( type ) {
            case EventConstants.UPDATE:
            {
                // do nothing if update on all columns, as this is only
                // used to indicate a non-measurable update.
                if ( col == EventConstants.ALL_COLUMNS ) {
                    break;
                }
               
                // process each update, check if filtered state changes
                for ( int r=start, cr=-1; r<=end; ++r ) {
                    if ( (cr=rowman.getChildRow(r)) != -1 ) {
                        // the parent row has a corresponding row in this table
                        if ( m_rowFilter.getBoolean(m_parent.getTuple(r)) ) {
                            // row still passes the filter, check the column
                            int idx = getColumnNumber(m_parent.getColumnName(col));
                            if ( idx >= getLocalColumnCount() )
                                fireTableEvent(cr, cr, idx, EventConstants.UPDATE);
                        } else {
                            // row no longer passes the filter, remove it
                            removeCascadedRow(cr);
                        }
                    } else {
                        // does it now pass the filter due to the update?
                        if ( m_rowFilter.getBoolean(m_parent.getTuple(r)) ) {
                            if ( (cr=rowman.getChildRow(r)) < 0 )
                                addCascadedRow(r);
                        }
                    }
                }
                break;
            }
            case EventConstants.DELETE:
            {
                if ( col == EventConstants.ALL_COLUMNS ) {
                    // entire rows deleted
                    for ( int r=start, cr=-1; r<=end; ++r ) {
                        if ( (cr=rowman.getChildRow(r)) != -1 )
                            removeCascadedRow(cr);
                    }
                } else {
                    // column deleted
                    filterColumns();
                }
                break;
            }
            case EventConstants.INSERT:
                if ( col == EventConstants.ALL_COLUMNS ) {
                    // entire rows added
                    for ( int r=start; r<=end; ++r ) {
                        if ( m_rowFilter.getBoolean(m_parent.getTuple(r)) ) {
                            if ( rowman.getChildRow(r) < 0 )
                                addCascadedRow(r);
                        }
                    }
                } else {
                    // column added
View Full Code Here

            ColumnProjection colFilter, Class tupleType)
    {
        super(0, 0, tupleType);
        m_parent = parent;
        m_pnames = new ArrayList();
        m_rows = new CascadedRowManager(this);
        m_listener = new Listener();
       
        setColumnProjection(colFilter);
        setRowFilter(rowFilter);
        m_parent.addTableListener(m_listener);
View Full Code Here

     * @see prefuse.data.util.ValidEdgePredicate
     */
    public void filterRows() {
        if ( m_parent == null ) return;
       
        CascadedRowManager rowman = (CascadedRowManager)m_rows;
        IntIterator crows = m_rows.rows();
        while ( crows.hasNext() ) {
            int crow = crows.nextInt();
            if ( !m_rowFilter.getBoolean(
                    m_parent.getTuple(rowman.getParentRow(crow))) )
            {
                removeCascadedRow(crow);
            }
        }
       
        Iterator ptuples = m_parent.tuples(m_rowFilter);
        while ( ptuples.hasNext() ) {
            Tuple pt = (Tuple)ptuples.next();
            int prow = pt.getRow();
            if ( rowman.getChildRow(prow) == -1 )
                addCascadedRow(prow);
        }
    }
View Full Code Here

        public void tableChanged(Table t, int start, int end, int col, int type) {
            // must come from parent
            if ( t != m_parent )
                return;
           
            CascadedRowManager rowman = (CascadedRowManager)m_rows;
           
            // switch on the event type
            switch ( type ) {
            case EventConstants.UPDATE:
            {
                // do nothing if update on all columns, as this is only
                // used to indicate a non-measurable update.
                if ( col == EventConstants.ALL_COLUMNS ) {
                    break;
                }
               
                // process each update, check if filtered state changes
                for ( int r=start, cr=-1; r<=end; ++r ) {
                    if ( (cr=rowman.getChildRow(r)) != -1 ) {
                        // the parent row has a corresponding row in this table
                        if ( m_rowFilter.getBoolean(m_parent.getTuple(r)) ) {
                            // row still passes the filter, check the column
                            int idx = getColumnNumber(m_parent.getColumnName(col));
                            if ( idx >= getLocalColumnCount() )
                                fireTableEvent(cr, cr, idx, EventConstants.UPDATE);
                        } else {
                            // row no longer passes the filter, remove it
                            removeCascadedRow(cr);
                        }
                    } else {
                        // does it now pass the filter due to the update?
                        if ( m_rowFilter.getBoolean(m_parent.getTuple(r)) ) {
                            if ( (cr=rowman.getChildRow(r)) < 0 )
                                addCascadedRow(r);
                        }
                    }
                }
                break;
            }
            case EventConstants.DELETE:
            {
                if ( col == EventConstants.ALL_COLUMNS ) {
                    // entire rows deleted
                    for ( int r=start, cr=-1; r<=end; ++r ) {
                        if ( (cr=rowman.getChildRow(r)) != -1 )
                            removeCascadedRow(cr);
                    }
                } else {
                    // column deleted
                    filterColumns();
                }
                break;
            }
            case EventConstants.INSERT:
                if ( col == EventConstants.ALL_COLUMNS ) {
                    // entire rows added
                    for ( int r=start; r<=end; ++r ) {
                        if ( m_rowFilter.getBoolean(m_parent.getTuple(r)) ) {
                            if ( rowman.getChildRow(r) < 0 )
                                addCascadedRow(r);
                        }
                    }
                } else {
                    // column added
View Full Code Here

TOP

Related Classes of prefuse.data.util.CascadedRowManager

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.