use of org.pentaho.di.ui.spoon.trans.DelayTimer in project pentaho-kettle by pentaho.
the class JobGraph method addEntryMouseOverDelayTimer.
private synchronized void addEntryMouseOverDelayTimer(final JobEntryCopy jobEntryCopy) {
//
if (mouseOverEntries.contains(jobEntryCopy)) {
return;
}
mouseOverEntries.add(jobEntryCopy);
DelayTimer delayTimer = new DelayTimer(500, new DelayListener() {
public void expired() {
mouseOverEntries.remove(jobEntryCopy);
delayTimers.remove(jobEntryCopy);
asyncRedraw();
}
}, new Callable<Boolean>() {
@Override
public Boolean call() throws Exception {
Point cursor = getLastMove();
if (cursor != null) {
AreaOwner areaOwner = getVisibleAreaOwner(cursor.x, cursor.y);
if (areaOwner != null && areaOwner.getAreaType() != null) {
AreaType areaType = areaOwner.getAreaType();
if (areaType == AreaType.JOB_ENTRY_ICON || areaType.belongsToJobContextMenu()) {
JobEntryCopy selectedJobEntryCopy = (JobEntryCopy) areaOwner.getOwner();
return selectedJobEntryCopy == jobEntryCopy;
}
}
}
return false;
}
});
new Thread(delayTimer).start();
delayTimers.put(jobEntryCopy, delayTimer);
}
Aggregations