Search in sources :

Example 1 with AreaType

use of org.pentaho.di.core.gui.AreaOwner.AreaType in project pentaho-kettle by pentaho.

the class TransGraph method addStepMouseOverDelayTimer.

private synchronized void addStepMouseOverDelayTimer(final StepMeta stepMeta) {
    // 
    if (mouseOverSteps.contains(stepMeta)) {
        return;
    }
    mouseOverSteps.add(stepMeta);
    DelayTimer delayTimer = new DelayTimer(500, new DelayListener() {

        @Override
        public void expired() {
            mouseOverSteps.remove(stepMeta);
            delayTimers.remove(stepMeta);
            showTargetStreamsStep = null;
            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) {
                    AreaType areaType = areaOwner.getAreaType();
                    if (areaType == AreaType.STEP_ICON) {
                        StepMeta selectedStepMeta = (StepMeta) areaOwner.getOwner();
                        return selectedStepMeta == stepMeta;
                    } else if (areaType != null && areaType.belongsToTransContextMenu()) {
                        StepMeta selectedStepMeta = (StepMeta) areaOwner.getParent();
                        return selectedStepMeta == stepMeta;
                    } else if (areaOwner.getExtensionAreaType() != null) {
                        return true;
                    }
                }
            }
            return false;
        }
    });
    new Thread(delayTimer).start();
    delayTimers.put(stepMeta, delayTimer);
}
Also used : AreaOwner(org.pentaho.di.core.gui.AreaOwner) Point(org.pentaho.di.core.gui.Point) KettleExtensionPoint(org.pentaho.di.core.extension.KettleExtensionPoint) AreaType(org.pentaho.di.core.gui.AreaOwner.AreaType) StepMeta(org.pentaho.di.trans.step.StepMeta) XulException(org.pentaho.ui.xul.XulException) InvocationTargetException(java.lang.reflect.InvocationTargetException) KettleValueException(org.pentaho.di.core.exception.KettleValueException) KettleStepException(org.pentaho.di.core.exception.KettleStepException) KettleRepositoryLostException(org.pentaho.di.repository.KettleRepositoryLostException) KettleException(org.pentaho.di.core.exception.KettleException)

Example 2 with AreaType

use of org.pentaho.di.core.gui.AreaOwner.AreaType 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)2 KettleExtensionPoint (org.pentaho.di.core.extension.KettleExtensionPoint)2 AreaOwner (org.pentaho.di.core.gui.AreaOwner)2 AreaType (org.pentaho.di.core.gui.AreaOwner.AreaType)2 Point (org.pentaho.di.core.gui.Point)2 KettleRepositoryLostException (org.pentaho.di.repository.KettleRepositoryLostException)2 XulException (org.pentaho.ui.xul.XulException)2 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 KettleStepException (org.pentaho.di.core.exception.KettleStepException)1 KettleValueException (org.pentaho.di.core.exception.KettleValueException)1 JobEntryCopy (org.pentaho.di.job.entry.JobEntryCopy)1 StepMeta (org.pentaho.di.trans.step.StepMeta)1 DelayListener (org.pentaho.di.ui.spoon.trans.DelayListener)1 DelayTimer (org.pentaho.di.ui.spoon.trans.DelayTimer)1