本文整理汇总了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);
}
示例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);
}
}
}
示例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);
}
}
示例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;
}
}
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例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
}
示例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;
}
}
示例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
}
示例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);
}
}
}