Search in sources :

Example 26 with TransGraph

use of org.pentaho.di.ui.spoon.trans.TransGraph in project pentaho-kettle by pentaho.

the class Spoon method copyTransformationImage.

public void copyTransformationImage(TransMeta transMeta) {
    TransGraph transGraph = delegates.trans.findTransGraphOfTransformation(transMeta);
    if (transGraph == null) {
        return;
    }
    Clipboard clipboard = GUIResource.getInstance().getNewClipboard();
    Point area = transMeta.getMaximum();
    Image image = transGraph.getTransformationImage(Display.getCurrent(), area.x, area.y, 1.0f);
    clipboard.setContents(new Object[] { image.getImageData() }, new Transfer[] { ImageTransfer.getInstance() });
}
Also used : TransGraph(org.pentaho.di.ui.spoon.trans.TransGraph) Clipboard(org.eclipse.swt.dnd.Clipboard) Point(org.pentaho.di.core.gui.Point) KettleExtensionPoint(org.pentaho.di.core.extension.KettleExtensionPoint) Image(org.eclipse.swt.graphics.Image)

Example 27 with TransGraph

use of org.pentaho.di.ui.spoon.trans.TransGraph in project pentaho-kettle by pentaho.

the class Spoon method addTransLog.

public void addTransLog() {
    TransGraph activeTransGraph = getActiveTransGraph();
    if (activeTransGraph != null) {
        activeTransGraph.transLogDelegate.addTransLog();
        activeTransGraph.transGridDelegate.addTransGrid();
    }
}
Also used : TransGraph(org.pentaho.di.ui.spoon.trans.TransGraph)

Example 28 with TransGraph

use of org.pentaho.di.ui.spoon.trans.TransGraph in project pentaho-kettle by pentaho.

the class Spoon method undoAction.

public void undoAction(UndoInterface undoInterface) {
    if (undoInterface == null) {
        return;
    }
    TransAction ta = undoInterface.previousUndo();
    if (ta == null) {
        return;
    }
    // something changed: change the menu
    setUndoMenu(undoInterface);
    if (undoInterface instanceof TransMeta) {
        delegates.trans.undoTransformationAction((TransMeta) undoInterface, ta);
        if (ta.getType() == TransAction.TYPE_ACTION_DELETE_STEP) {
            // something changed: change the menu
            setUndoMenu(undoInterface);
            handleSelectedStepOnUndo((TransMeta) undoInterface);
            ta = undoInterface.viewPreviousUndo();
            if (ta != null && ta.getType() == TransAction.TYPE_ACTION_DELETE_HOP) {
                ta = undoInterface.previousUndo();
                delegates.trans.undoTransformationAction((TransMeta) undoInterface, ta);
            }
        }
    }
    if (undoInterface instanceof JobMeta) {
        delegates.jobs.undoJobAction((JobMeta) undoInterface, ta);
        if (ta.getType() == TransAction.TYPE_ACTION_DELETE_JOB_ENTRY) {
            // something changed: change the menu
            setUndoMenu(undoInterface);
            ta = undoInterface.viewPreviousUndo();
            if (ta != null && ta.getType() == TransAction.TYPE_ACTION_DELETE_JOB_HOP) {
                ta = undoInterface.previousUndo();
                delegates.jobs.undoJobAction((JobMeta) undoInterface, ta);
            }
        }
    }
    // Put what we undo in focus
    if (undoInterface instanceof TransMeta) {
        TransGraph transGraph = delegates.trans.findTransGraphOfTransformation((TransMeta) undoInterface);
        transGraph.forceFocus();
    }
    if (undoInterface instanceof JobMeta) {
        JobGraph jobGraph = delegates.jobs.findJobGraphOfJob((JobMeta) undoInterface);
        jobGraph.forceFocus();
    }
}
Also used : TransAction(org.pentaho.di.core.undo.TransAction) JobMeta(org.pentaho.di.job.JobMeta) JobGraph(org.pentaho.di.ui.spoon.job.JobGraph) TransMeta(org.pentaho.di.trans.TransMeta) TransGraph(org.pentaho.di.ui.spoon.trans.TransGraph)

Example 29 with TransGraph

use of org.pentaho.di.ui.spoon.trans.TransGraph in project pentaho-kettle by pentaho.

the class Spoon method checkTrans.

/**
 * Check the steps in a transformation
 *
 * @param only_selected
 *          True: Check only the selected steps...
 */
public void checkTrans(TransMeta transMeta, boolean only_selected) {
    if (transMeta == null) {
        return;
    }
    TransGraph transGraph = delegates.trans.findTransGraphOfTransformation(transMeta);
    if (transGraph == null) {
        return;
    }
    CheckTransProgressDialog ctpd = new CheckTransProgressDialog(shell, transMeta, transGraph.getRemarks(), only_selected);
    // manages the remarks arraylist...
    ctpd.open();
    showLastTransCheck();
}
Also used : CheckTransProgressDialog(org.pentaho.di.ui.spoon.dialog.CheckTransProgressDialog) TransGraph(org.pentaho.di.ui.spoon.trans.TransGraph)

Example 30 with TransGraph

use of org.pentaho.di.ui.spoon.trans.TransGraph in project pentaho-kettle by pentaho.

the class Spoon method zoomOut.

public void zoomOut() {
    TransGraph transGraph = getActiveTransGraph();
    if (transGraph != null) {
        transGraph.zoomOut();
    }
    JobGraph jobGraph = getActiveJobGraph();
    if (jobGraph != null) {
        jobGraph.zoomOut();
    }
}
Also used : JobGraph(org.pentaho.di.ui.spoon.job.JobGraph) TransGraph(org.pentaho.di.ui.spoon.trans.TransGraph)

Aggregations

TransGraph (org.pentaho.di.ui.spoon.trans.TransGraph)37 JobGraph (org.pentaho.di.ui.spoon.job.JobGraph)15 TransMeta (org.pentaho.di.trans.TransMeta)10 Test (org.junit.Test)8 KettleExtensionPoint (org.pentaho.di.core.extension.KettleExtensionPoint)7 ArrayList (java.util.ArrayList)6 Point (org.pentaho.di.core.gui.Point)6 JobMeta (org.pentaho.di.job.JobMeta)6 StepMeta (org.pentaho.di.trans.step.StepMeta)6 EngineMetaInterface (org.pentaho.di.core.EngineMetaInterface)5 KettleException (org.pentaho.di.core.exception.KettleException)5 TabMapEntry (org.pentaho.di.ui.spoon.TabMapEntry)5 Browser (org.eclipse.swt.browser.Browser)4 ValueMetaString (org.pentaho.di.core.row.value.ValueMetaString)4 FileObject (org.apache.commons.vfs2.FileObject)3 SashForm (org.eclipse.swt.custom.SashForm)3 Composite (org.eclipse.swt.widgets.Composite)3 MessageBox (org.eclipse.swt.widgets.MessageBox)3 RowMetaInterface (org.pentaho.di.core.row.RowMetaInterface)3 TabItem (org.pentaho.xul.swt.tab.TabItem)3