当前位置: 首页>>代码示例>>Java>>正文


Java EventConstants.INSERT属性代码示例

本文整理汇总了Java中prefuse.data.event.EventConstants.INSERT属性的典型用法代码示例。如果您正苦于以下问题:Java EventConstants.INSERT属性的具体用法?Java EventConstants.INSERT怎么用?Java EventConstants.INSERT使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在prefuse.data.event.EventConstants的用法示例。


在下文中一共展示了EventConstants.INSERT属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: fireTupleEvent

/**
 * Fire a Tuple event.
 * @param t the Table on which the event has occurred
 * @param start the first row changed
 * @param end the last row changed
 * @param type the type of event, one of
 * {@link prefuse.data.event.EventConstants#INSERT} or
 * {@link prefuse.data.event.EventConstants#DELETE}.
 */
protected void fireTupleEvent(Table t, int start, int end, int type) {
    if ( m_tupleListeners != null && m_tupleListeners.size() > 0 ) {
        Object[] lstnrs = m_tupleListeners.getArray();
        Tuple[] tuples = new Tuple[end-start+1];
        for ( int i=0, r=start; r <= end; ++r, ++i ) {
            tuples[i] = t.getTuple(r);
        }
        for ( int i=0; i<lstnrs.length; ++i ) {
            TupleSetListener tsl = (TupleSetListener)lstnrs[i];
            if ( type == EventConstants.INSERT ) {
                tsl.tupleSetChanged(this, tuples, EMPTY_ARRAY);
            } else {
                tsl.tupleSetChanged(this, EMPTY_ARRAY, tuples);
            }
        }
    }
}
 
开发者ID:dritanlatifi,项目名称:AndroidPrefuse,代码行数:26,代码来源:AbstractTupleSet.java

示例2: tableChanged

/**
 * @see prefuse.data.event.TableListener#tableChanged(prefuse.data.Table, int, int, int, int)
 */
public void tableChanged(Table t, int start, int end, int col, int type) {
    if ( type == EventConstants.UPDATE || t != m_table 
          || col != EventConstants.ALL_COLUMNS )
        return;
    
    boolean insert = (type==EventConstants.INSERT);
    for ( int r=start; r<=end; ++r )
        rowChanged(r, insert);
}
 
开发者ID:dritanlatifi,项目名称:AndroidPrefuse,代码行数:12,代码来源:TreeIndex.java

示例3: tableChanged

@Override
public void tableChanged(Table t, int start, int end, int col, int type) {
    // 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;
        } else {
            for (int r = start; r <= end; ++r) {
                if (r < GranuleCache.this.granules.getRowCount()) {
                    GranuleCache.this.granules.set(null, r);
                }
            }
        }
        break;
    }
    case EventConstants.DELETE:
        if (col == EventConstants.ALL_COLUMNS) {
            // entire rows deleted
            for (int r = start; r <= end; ++r) {
                if (r < GranuleCache.this.granules.getRowCount()) {
                    GranuleCache.this.granules.set(null, r);
                }
            }
        }
        break;
    case EventConstants.INSERT:
        // nothing to do here
    } // switch
}
 
开发者ID:ieg-vienna,项目名称:TimeBench,代码行数:32,代码来源:GranuleCache.java

示例4: tableChanged

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
            filterColumns();
        }
        break;
    }
}
 
开发者ID:dritanlatifi,项目名称:AndroidPrefuse,代码行数:70,代码来源:CascadedTable.java

示例5: tableChanged

@Override
public void tableChanged(Table t, int start, int end, int col, int type) {
    // must come from parent
    if (t != TemporalElementManager.this.m_table)
        return;

    // 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;
        }

        // if primitive has changed, invalidate primitives
        if (col == TemporalElementManager.this.m_table
                .getColumnNumber(TemporalElement.KIND)) {
            for (int r = start; r <= end; ++r) {
                TemporalElementManager.this.invalidate(r);
            }
        }
        break;
    }
    case EventConstants.DELETE:
        if (col == EventConstants.ALL_COLUMNS) {
            // entire rows deleted
            for (int r = start; r <= end; ++r) {
                TemporalElementManager.this.invalidate(r);
            }
        } else {
            // relevant column deleted
            if (col == t.getColumnNumber(TemporalElement.KIND)
                    || col == t.getColumnNumber(TemporalElement.INF)
                    || col == t.getColumnNumber(TemporalElement.SUP)
                    || col == t
                            .getColumnNumber(TemporalElement.GRANULARITY_ID))
                TemporalElementManager.this.invalidateAll();
        }
        break;
    case EventConstants.INSERT:
        // nothing to do here
    } // switch
}
 
开发者ID:ieg-vienna,项目名称:TimeBench,代码行数:44,代码来源:TemporalElementManager.java


注:本文中的prefuse.data.event.EventConstants.INSERT属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。