Search in sources :

Example 1 with DelayTimer

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);
}
Also used : JobEntryCopy(org.pentaho.di.job.entry.JobEntryCopy) AreaOwner(org.pentaho.di.core.gui.AreaOwner) DelayListener(org.pentaho.di.ui.spoon.trans.DelayListener) DelayTimer(org.pentaho.di.ui.spoon.trans.DelayTimer) Point(org.pentaho.di.core.gui.Point) KettleExtensionPoint(org.pentaho.di.core.extension.KettleExtensionPoint) AreaType(org.pentaho.di.core.gui.AreaOwner.AreaType) XulException(org.pentaho.ui.xul.XulException) KettleRepositoryLostException(org.pentaho.di.repository.KettleRepositoryLostException) KettleException(org.pentaho.di.core.exception.KettleException)

Aggregations

KettleException (org.pentaho.di.core.exception.KettleException)1 KettleExtensionPoint (org.pentaho.di.core.extension.KettleExtensionPoint)1 AreaOwner (org.pentaho.di.core.gui.AreaOwner)1 AreaType (org.pentaho.di.core.gui.AreaOwner.AreaType)1 Point (org.pentaho.di.core.gui.Point)1 JobEntryCopy (org.pentaho.di.job.entry.JobEntryCopy)1 KettleRepositoryLostException (org.pentaho.di.repository.KettleRepositoryLostException)1 DelayListener (org.pentaho.di.ui.spoon.trans.DelayListener)1 DelayTimer (org.pentaho.di.ui.spoon.trans.DelayTimer)1 XulException (org.pentaho.ui.xul.XulException)1