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


Java EventConstants.DELETE属性代码示例

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


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

示例1: fireTableEvent

/**
 * Clear all aggregate mappings for a row when it is deleted.
 */
protected void fireTableEvent(int row0, int row1, int col, int type) {
    if ( col==EventConstants.ALL_COLUMNS && type==EventConstants.DELETE ) {
        for ( int r=row0; r<=row1; ++r )
            clearAggregateMappings(r, false);
    }
    super.fireTableEvent(row0, row1, col, type);
}
 
开发者ID:dritanlatifi,项目名称:AndroidPrefuse,代码行数:10,代码来源:AggregateTable.java

示例2: fireTableEvent

/**
 * Relay table events. Ensures that updated visual items are invalidated
 * and that damage reports are issued for deleted items.
 */
protected void fireTableEvent(int row0, int row1, int col, int type) {
    // table attributes changed, so we invalidate the bounds
    if ( type==EventConstants.UPDATE )
    {
        if ( col != VisualItem.IDX_VALIDATED ) {
            for ( int r=row0; r<=row1; ++r )
                setValidated(r,false);
        } else {
            // change in validated status
            for ( int r=row0; r<=row1; ++r ) {
                if ( !isValidated(r) ) {
                    // retrieve the old bounds to report damage
                    m_vis.damageReport(getItem(r), getBounds(r));
                }
            }
        }
    }
    else if ( type==EventConstants.DELETE && col==EventConstants.ALL_COLUMNS)
    {
        for ( int r=row0; r<=row1; ++r ) {
            if ( isVisible(r) && isValidated(r) ) {
                VisualItem item = (VisualItem)getTuple(r);
                m_vis.damageReport(item, getBounds(r));
            }
        }
    }
    // now propagate the change event
    super.fireTableEvent(row0, row1, col, type);
}
 
开发者ID:dritanlatifi,项目名称:AndroidPrefuse,代码行数:33,代码来源:VisualTable.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.DELETE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。