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


Java EventConstants.UPDATE属性代码示例

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


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

示例1: fireGraphEvent

/**
 * Fire a graph event. Makes sure to invalidate all edges connected
 * to a node that has been updated.
 * @see prefuse.data.Graph#fireGraphEvent(prefuse.data.Table, int, int, int, int)
 */
protected void fireGraphEvent(Table t, 
        int first, int last, int col, int type)
{
    // if a node is invalidated, invalidate the edges, too
    if ( type==EventConstants.UPDATE && 
         col==VisualItem.IDX_VALIDATED && t==getNodeTable() )
    {
        VisualTable nodes = (VisualTable)t;
        VisualTable edges = (VisualTable)getEdgeTable();
        
        for ( int i=first; i<=last; ++i ) {
            if ( nodes.isValidated(i) )
                continue; // look only for invalidations
            
            IntIterator erows = edgeRows(i);
            while ( erows.hasNext() ) {
                int erow = erows.nextInt();
                edges.setValidated(erow, false);
            }
        }
    }
    // fire the event off to listeners
    super.fireGraphEvent(t, first, last, col, type);
}
 
开发者ID:dritanlatifi,项目名称:AndroidPrefuse,代码行数:29,代码来源:VisualTree.java

示例2: fireGraphEvent

/**
 * Fire a graph change event
 * @param t the backing table where the change occurred (either a
 * node table or an edge table)
 * @param first the first modified table row
 * @param last the last (inclusive) modified table row
 * @param col the number of the column modified, or
 * {@link prefuse.data.event.EventConstants#ALL_COLUMNS} for operations
 * affecting all columns
 * @param type the type of modification, one of
 * {@link prefuse.data.event.EventConstants#INSERT},
 * {@link prefuse.data.event.EventConstants#DELETE}, or
 * {@link prefuse.data.event.EventConstants#UPDATE}.
 */
protected void fireGraphEvent(Table t, 
        int first, int last, int col, int type)
{
    String table = (t==getNodeTable() ? NODES : EDGES);
    
    if ( type != EventConstants.UPDATE ) {
        // fire event to all tuple set listeners
        fireTupleEvent(t, first, last, type);
    }
    
    if ( !m_listeners.isEmpty() ) {            
        // fire event to all listeners
        Object[] lstnrs = m_listeners.getArray();
        for ( int i=0; i<lstnrs.length; ++i ) {
            ((GraphListener)lstnrs[i]).graphChanged(
                    this, table, first, last, col, type);
        }
    }
}
 
开发者ID:dritanlatifi,项目名称:AndroidPrefuse,代码行数:33,代码来源:Graph.java

示例3: fireTableEvent

/**
 * Fire a table event to notify listeners.
 * @param row0 the starting row of the modified range
 * @param row1 the ending row (inclusive) of the modified range
 * @param col the number of the column modified, or
 * {@link prefuse.data.event.EventConstants#ALL_COLUMNS} for operations
 * effecting all columns.
 * @param type the table modification type, one of
 * {@link prefuse.data.event.EventConstants#INSERT},
 * {@link prefuse.data.event.EventConstants#DELETE}, or
 * {@link prefuse.data.event.EventConstants#UPDATE}.
 */
protected void fireTableEvent(int row0, int row1, int col, int type) {
    // increment the modification count
    ++m_modCount;
    
    if ( type != EventConstants.UPDATE && 
         col == EventConstants.ALL_COLUMNS )
    {
        // fire event to all tuple set listeners
        fireTupleEvent(this, row0, row1, type);
    }
    
    if ( !m_listeners.isEmpty() ) {
        // fire event to all table listeners
        for (TableListener lstnr : m_listeners)
        	lstnr.tableChanged(this, row0, row1, col, type);
    }
}
 
开发者ID:dritanlatifi,项目名称:AndroidPrefuse,代码行数:29,代码来源:Table.java

示例4: tableChanged

@Override
public void tableChanged(Table t, int start, int end, int col, int type) {
	if(type == EventConstants.UPDATE && start == end) {
		TemporalObject to = (TemporalObject)t.getTuple(start);
		int treeLevel = to.getTreeLevel();
		int[] dataColumnIndices = getDataColumnIndices();
		for(int i=0; i<dataColumnIndices.length; i++) {
			if(col == dataColumnIndices[i]) {
				if (t.canGetDouble(col)) {
					double d = t.getDouble(start, col);
					if (!Double.isNaN(d)) {
						minValues[i][treeLevel] = Math.min(minValues[i][treeLevel], d);
						maxValues[i][treeLevel] = Math.max(maxValues[i][treeLevel], d);
					}
				}
			}
			break;
		}
	}
}
 
开发者ID:ieg-vienna,项目名称:TimeBench,代码行数:20,代码来源:GranularityAggregationTree.java

示例5: 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

示例6: fireGraphEvent

/**
     * Fire a graph event. Makes sure to invalidate all edges connected
     * to a node that has been updated.
     * @see prefuse.data.Graph#fireGraphEvent(prefuse.data.Table, int, int, int, int)
     */
    protected void fireGraphEvent(Table t, 
            int first, int last, int col, int type)
    {
        // if a node is invalidated, invalidate the edges, too
        if ( type==EventConstants.UPDATE && 
             col==VisualItem.IDX_VALIDATED && t==getNodeTable() )
        {
            VisualTable nodes = (VisualTable)t;
            VisualTable edges = (VisualTable)getEdgeTable();
            
            for ( int i=first; i<=last; ++i ) {
                if ( nodes.isValidated(i) )
                    continue; // look only for invalidations
                
                if ( i < 0 ) {
                    System.err.println("catch me - VisualGraph fireGraphEvent");
                }
//                try {
                IntIterator erows = edgeRows(i);
                while ( erows.hasNext() ) {
                    int erow = erows.nextInt();
                    edges.setValidated(erow, false);
                }
//                } catch ( Exception ex ) {
//                  ex.printStackTrace();
//                }
            }
        }
        // fire the event off to listeners
        super.fireGraphEvent(t, first, last, col, type);
    }
 
开发者ID:dritanlatifi,项目名称:AndroidPrefuse,代码行数:36,代码来源:VisualGraph.java

示例7: 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

示例8: 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 ( activeItem == null || type != EventConstants.UPDATE 
            || col != t.getColumnNumber(VisualItem.FIXED) )
        return;
    int row = activeItem.getRow();
    if ( row >= start && row <= end )
        resetItem = false;
}
 
开发者ID:dritanlatifi,项目名称:AndroidPrefuse,代码行数:11,代码来源:DragControl.java

示例9: 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

示例10: 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

示例11: 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

示例12: fireGraphEvent

/**
 * Fire a graph change event
 * 
 * @param t
 *            the backing table where the change occurred (either a node
 *            table or an edge table)
 * @param first
 *            the first modified table row
 * @param last
 *            the last (inclusive) modified table row
 * @param col
 *            the number of the column modified, or
 *            {@link prefuse.data.event.EventConstants#ALL_COLUMNS} for
 *            operations affecting all columns
 * @param type
 *            the type of modification, one of
 *            {@link prefuse.data.event.EventConstants#INSERT},
 *            {@link prefuse.data.event.EventConstants#DELETE}, or
 *            {@link prefuse.data.event.EventConstants#UPDATE}.
 */
protected void fireGraphEvent(Table t, int first, int last, int col,
		int type) {
	String table = (t == getNode1Table() ? NODES_1
			: t == getNode1Table() ? NODES_2 : EDGES);

	if (type != EventConstants.UPDATE) {
		// fire event to all tuple set listeners
		fireTupleEvent(t, first, last, type);
	}

	if (!m_listeners.isEmpty()) {
		// fire event to all listeners
		Object[] lstnrs = m_listeners.getArray();
		for (int i = 0; i < lstnrs.length; ++i) {
			 ((BipartiteGraphListener)lstnrs[i]).graphChanged(
			 this, table, first, last, col, type);
		}
	}
}
 
开发者ID:ieg-vienna,项目名称:ieg-prefuse,代码行数:39,代码来源:BipartiteGraph.java


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