Class TransGraph

  • All Implemented Interfaces:
    EventListener, org.eclipse.swt.events.KeyListener, org.eclipse.swt.events.MouseListener, org.eclipse.swt.events.MouseMoveListener, org.eclipse.swt.events.MouseTrackListener, org.eclipse.swt.events.MouseWheelListener, org.eclipse.swt.graphics.Drawable, org.eclipse.swt.internal.SWTEventListener, org.pentaho.di.core.gui.Redrawable, org.pentaho.di.core.logging.LogParentProvidedInterface, TabItemInterface, org.pentaho.ui.xul.impl.XulEventHandler

    public class TransGraph
    extends AbstractGraph
    implements org.pentaho.ui.xul.impl.XulEventHandler, org.pentaho.di.core.gui.Redrawable, TabItemInterface, org.pentaho.di.core.logging.LogParentProvidedInterface, org.eclipse.swt.events.MouseListener, org.eclipse.swt.events.MouseMoveListener, org.eclipse.swt.events.MouseTrackListener, org.eclipse.swt.events.MouseWheelListener, org.eclipse.swt.events.KeyListener
    This class handles the display of the transformations in a graphical way using icons, arrows, etc. One transformation is handled per TransGraph
    Since:
    17-mei-2003
    Author:
    Matt
    • Field Detail

      • START_TEXT

        public static final String START_TEXT
      • PAUSE_TEXT

        public static final String PAUSE_TEXT
      • RESUME_TEXT

        public static final String RESUME_TEXT
      • STOP_TEXT

        public static final String STOP_TEXT
      • trans

        public org.pentaho.di.trans.Trans trans
      • currentMouseX

        protected int currentMouseX
      • currentMouseY

        protected int currentMouseY
      • ni

        protected org.pentaho.di.core.NotePadMeta ni
      • currentHop

        protected org.pentaho.di.trans.TransHopMeta currentHop
      • currentStep

        protected org.pentaho.di.trans.step.StepMeta currentStep
      • extraViewComposite

        public org.eclipse.swt.widgets.Composite extraViewComposite
      • extraViewTabFolder

        public org.eclipse.swt.custom.CTabFolder extraViewTabFolder
    • Constructor Detail

      • TransGraph

        public TransGraph​(org.eclipse.swt.widgets.Composite parent,
                          Spoon spoon,
                          org.pentaho.di.trans.TransMeta transMeta)
    • Method Detail

      • setCurrentNote

        public void setCurrentNote​(org.pentaho.di.core.NotePadMeta ni)
      • getCurrentNote

        public org.pentaho.di.core.NotePadMeta getCurrentNote()
      • getCurrentHop

        public org.pentaho.di.trans.TransHopMeta getCurrentHop()
      • setCurrentHop

        public void setCurrentHop​(org.pentaho.di.trans.TransHopMeta currentHop)
      • getCurrentStep

        public org.pentaho.di.trans.step.StepMeta getCurrentStep()
      • setCurrentStep

        public void setCurrentStep​(org.pentaho.di.trans.step.StepMeta currentStep)
      • addSelectedStepListener

        public void addSelectedStepListener​(SelectedStepListener selectedStepListener)
      • addCurrentStepListener

        public void addCurrentStepListener​(StepSelectionListener stepSelectionListener)
      • mouseDoubleClick

        public void mouseDoubleClick​(org.eclipse.swt.events.MouseEvent e)
        Specified by:
        mouseDoubleClick in interface org.eclipse.swt.events.MouseListener
      • mouseDown

        public void mouseDown​(org.eclipse.swt.events.MouseEvent e)
        Specified by:
        mouseDown in interface org.eclipse.swt.events.MouseListener
      • mouseUp

        public void mouseUp​(org.eclipse.swt.events.MouseEvent e)
        Specified by:
        mouseUp in interface org.eclipse.swt.events.MouseListener
      • mouseMove

        public void mouseMove​(org.eclipse.swt.events.MouseEvent e)
        Specified by:
        mouseMove in interface org.eclipse.swt.events.MouseMoveListener
      • mouseHover

        public void mouseHover​(org.eclipse.swt.events.MouseEvent e)
        Specified by:
        mouseHover in interface org.eclipse.swt.events.MouseTrackListener
      • mouseScrolled

        public void mouseScrolled​(org.eclipse.swt.events.MouseEvent e)
        Specified by:
        mouseScrolled in interface org.eclipse.swt.events.MouseWheelListener
      • addHop

        protected void addHop​(org.pentaho.di.trans.step.errorhandling.StreamInterface stream)
      • mouseEnter

        public void mouseEnter​(org.eclipse.swt.events.MouseEvent arg0)
        Specified by:
        mouseEnter in interface org.eclipse.swt.events.MouseTrackListener
      • mouseExit

        public void mouseExit​(org.eclipse.swt.events.MouseEvent arg0)
        Specified by:
        mouseExit in interface org.eclipse.swt.events.MouseTrackListener
      • asyncRedraw

        protected void asyncRedraw()
      • hideToolTips

        protected void hideToolTips()
      • selectInRect

        public void selectInRect​(org.pentaho.di.trans.TransMeta transMeta,
                                 org.pentaho.di.core.gui.Rectangle rect)
        Select all the steps in a certain (screen) rectangle
        Parameters:
        rect - The selection area as a rectangle
      • keyPressed

        public void keyPressed​(org.eclipse.swt.events.KeyEvent e)
        Specified by:
        keyPressed in interface org.eclipse.swt.events.KeyListener
      • keyReleased

        public void keyReleased​(org.eclipse.swt.events.KeyEvent e)
        Specified by:
        keyReleased in interface org.eclipse.swt.events.KeyListener
      • renameStep

        public void renameStep​(org.pentaho.di.trans.step.StepMeta stepMeta,
                               String stepname)
      • clearSettings

        public void clearSettings()
      • getRealPosition

        public org.pentaho.di.core.gui.Point getRealPosition​(org.eclipse.swt.widgets.Composite canvas,
                                                             int x,
                                                             int y)
      • findHop

        protected org.pentaho.di.trans.TransHopMeta findHop​(int x,
                                                            int y)
        See if location (x,y) is on a line between two steps: the hop!
        Parameters:
        x -
        y -
        Returns:
        the transformation hop on the specified location, otherwise: null
      • hideStep

        public void hideStep()
      • checkSelectedSteps

        public void checkSelectedSteps()
      • detachStep

        public void detachStep()
      • generateMappingToThisStep

        public void generateMappingToThisStep()
      • partitioning

        public void partitioning()
      • clustering

        public void clustering()
      • errorHandling

        public void errorHandling()
      • newHopChoice

        public void newHopChoice()
      • editStep

        public void editStep()
      • editDescription

        public void editDescription()
      • setDistributes

        public void setDistributes()
      • setCustomRowDistribution

        public void setCustomRowDistribution()
      • askUserForCustomDistributionMethod

        public org.pentaho.di.trans.step.RowDistributionInterface askUserForCustomDistributionMethod()
      • setCopies

        public void setCopies()
      • copies

        public void copies()
      • copies

        public void copies​(org.pentaho.di.trans.step.StepMeta stepMeta)
      • dupeStep

        public void dupeStep()
      • copyStep

        public void copyStep()
      • delSelected

        public void delSelected()
      • fieldsBefore

        public void fieldsBefore()
      • fieldsAfter

        public void fieldsAfter()
      • fieldsLineage

        public void fieldsLineage()
      • editHop

        public void editHop()
      • flipHopDirection

        public void flipHopDirection()
      • enableHop

        public void enableHop()
      • deleteHop

        public void deleteHop()
      • enableHopsBetweenSelectedSteps

        public void enableHopsBetweenSelectedSteps()
      • disableHopsBetweenSelectedSteps

        public void disableHopsBetweenSelectedSteps()
      • enableHopsBetweenSelectedSteps

        public void enableHopsBetweenSelectedSteps​(boolean enabled)
        This method enables or disables all the hops between the selected steps.
      • enableHopsDownstream

        public void enableHopsDownstream()
      • disableHopsDownstream

        public void disableHopsDownstream()
      • enableDisableHopsDownstream

        public void enableDisableHopsDownstream​(boolean enabled)
      • editNote

        public void editNote()
      • deleteNote

        public void deleteNote()
      • raiseNote

        public void raiseNote()
      • lowerNote

        public void lowerNote()
      • newNote

        public void newNote()
      • paste

        public void paste()
      • settings

        public void settings()
      • newStep

        public void newStep​(String description)
      • selectAll

        public void selectAll()
      • clearSelection

        public void clearSelection()
      • initializeXulMenu

        protected void initializeXulMenu​(org.pentaho.ui.xul.dom.Document doc,
                                         List<org.pentaho.di.trans.step.StepMeta> selection,
                                         org.pentaho.di.trans.step.StepMeta stepMeta)
                                  throws org.pentaho.di.core.exception.KettleException
        Throws:
        org.pentaho.di.core.exception.KettleException
      • showTooltip

        public void showTooltip​(String label,
                                org.eclipse.swt.graphics.Image image,
                                int screenX,
                                int screenY)
      • getVisibleAreaOwner

        public org.pentaho.di.core.gui.AreaOwner getVisibleAreaOwner​(int x,
                                                                     int y)
      • delSelected

        public void delSelected​(org.pentaho.di.trans.step.StepMeta stMeta)
      • editDescription

        public void editDescription​(org.pentaho.di.trans.step.StepMeta stepMeta)
      • paintControl

        public void paintControl​(org.eclipse.swt.events.PaintEvent e)
      • getTransformationImage

        public org.eclipse.swt.graphics.Image getTransformationImage​(org.eclipse.swt.graphics.Device device,
                                                                     int x,
                                                                     int y,
                                                                     float magnificationFactor)
      • getOffset

        protected org.pentaho.di.core.gui.Point getOffset()
        Specified by:
        getOffset in class AbstractGraph
      • snaptogrid

        public void snaptogrid()
      • allignleft

        public void allignleft()
      • allignright

        public void allignright()
      • alligntop

        public void alligntop()
      • allignbottom

        public void allignbottom()
      • distributehorizontal

        public void distributehorizontal()
      • distributevertical

        public void distributevertical()
      • preview

        public void preview()
      • newProps

        public void newProps()
      • getMeta

        public org.pentaho.di.core.EngineMetaInterface getMeta()
        Specified by:
        getMeta in interface TabItemInterface
      • setTransMeta

        public void setTransMeta​(org.pentaho.di.trans.TransMeta transMeta)
        Parameters:
        transMeta - the transMeta to set
      • addUndoPosition

        public void addUndoPosition​(Object[] obj,
                                    int[] pos,
                                    org.pentaho.di.core.gui.Point[] prev,
                                    org.pentaho.di.core.gui.Point[] curr)
      • addUndoPosition

        public void addUndoPosition​(Object[] obj,
                                    int[] pos,
                                    org.pentaho.di.core.gui.Point[] prev,
                                    org.pentaho.di.core.gui.Point[] curr,
                                    boolean nextAlso)
      • applyChanges

        public boolean applyChanges()
                             throws org.pentaho.di.core.exception.KettleException
        Specified by:
        applyChanges in interface TabItemInterface
        Throws:
        org.pentaho.di.core.exception.KettleException
      • canBeClosed

        public boolean canBeClosed()
        Description copied from interface: TabItemInterface
        Closes the content behind the tab, de-allocates resources.
        Specified by:
        canBeClosed in interface TabItemInterface
        Returns:
        true if the tab was closed, false if it was prevented by the user. (are you sure dialog)
      • getRemarks

        public List<org.pentaho.di.core.CheckResultInterface> getRemarks()
      • setRemarks

        public void setRemarks​(List<org.pentaho.di.core.CheckResultInterface> remarks)
      • getImpact

        public List<org.pentaho.di.trans.DatabaseImpact> getImpact()
      • setImpact

        public void setImpact​(List<org.pentaho.di.trans.DatabaseImpact> impact)
      • isImpactFinished

        public boolean isImpactFinished()
      • setImpactFinished

        public void setImpactFinished​(boolean impactHasRun)
      • getLastMove

        public org.pentaho.di.core.gui.Point getLastMove()
        Returns:
        the lastMove
      • editProperties

        public static boolean editProperties​(org.pentaho.di.trans.TransMeta transMeta,
                                             Spoon spoon,
                                             org.pentaho.di.repository.Repository rep,
                                             boolean allowDirectoryChange)
      • editProperties

        public static boolean editProperties​(org.pentaho.di.trans.TransMeta transMeta,
                                             Spoon spoon,
                                             org.pentaho.di.repository.Repository rep,
                                             boolean allowDirectoryChange,
                                             TransDialog.Tabs currentTab)
      • openFile

        public void openFile()
      • saveFile

        public void saveFile()
                      throws org.pentaho.di.core.exception.KettleException
        Throws:
        org.pentaho.di.core.exception.KettleException
      • saveFileAs

        public void saveFileAs()
                        throws org.pentaho.di.core.exception.KettleException
        Throws:
        org.pentaho.di.core.exception.KettleException
      • saveXMLFileToVfs

        public void saveXMLFileToVfs()
      • printFile

        public void printFile()
      • runTransformation

        public void runTransformation()
      • runOptionsTransformation

        public void runOptionsTransformation()
      • pauseTransformation

        public void pauseTransformation()
      • stopTransformation

        public void stopTransformation()
      • previewFile

        public void previewFile()
      • debugFile

        public void debugFile()
      • transReplay

        public void transReplay()
      • checkTrans

        public void checkTrans()
      • analyseImpact

        public void analyseImpact()
      • getSQL

        public void getSQL()
      • exploreDatabase

        public void exploreDatabase()
      • isExecutionResultsPaneVisible

        public boolean isExecutionResultsPaneVisible()
      • showExecutionResults

        public void showExecutionResults()
      • browseVersionHistory

        public void browseVersionHistory()
      • checkEmptyExtraView

        public void checkEmptyExtraView()
        If the extra tab view at the bottom is empty, we close it.
      • getToolbar

        public org.pentaho.ui.xul.containers.XulToolbar getToolbar()
        Returns:
        the toolbar
      • setToolbar

        public void setToolbar​(org.pentaho.ui.xul.containers.XulToolbar toolbar)
        Parameters:
        toolbar - the toolbar to set
      • addExtraView

        public void addExtraView()
        Add an extra view to the main composite SashForm
      • checkErrors

        @Deprecated
        public void checkErrors()
        Deprecated.
        Deprecated as of 8.0. Seems unused; will be to remove in 8.1 (ccaspanello)
      • start

        public void start​(org.pentaho.di.trans.TransExecutionConfiguration executionConfiguration)
                   throws org.pentaho.di.core.exception.KettleException
        Throws:
        org.pentaho.di.core.exception.KettleException
      • showSaveFileMessage

        public void showSaveFileMessage()
      • addAllTabs

        public void addAllTabs()
      • debug

        public void debug​(org.pentaho.di.trans.TransExecutionConfiguration executionConfiguration,
                          org.pentaho.di.trans.debug.TransDebugMeta transDebugMeta)
      • showPreview

        public void showPreview​(org.pentaho.di.trans.debug.TransDebugMeta transDebugMeta,
                                org.pentaho.di.trans.debug.StepDebugMeta stepDebugMeta,
                                org.pentaho.di.core.row.RowMetaInterface rowBufferMeta,
                                List<Object[]> rowBuffer)
      • stop

        public void stop()
      • safeStop

        public void safeStop()
      • pauseResume

        public void pauseResume()
      • stopRedrawTimer

        protected void stopRedrawTimer()
      • showLastPreviewResults

        public void showLastPreviewResults()
      • openMapping

        public void openMapping()
        XUL dummy menu entry
      • openMapping

        public void openMapping​(org.pentaho.di.trans.step.StepMeta stepMeta,
                                int index)
        Open the transformation mentioned in the mapping...
      • isRunning

        public boolean isRunning()
        Returns:
        the running
      • setRunning

        public void setRunning​(boolean running)
        Parameters:
        running - the running to set
      • getLastTransDebugMeta

        public org.pentaho.di.trans.debug.TransDebugMeta getLastTransDebugMeta()
        Returns:
        the lastTransDebugMeta
      • isHalting

        public boolean isHalting()
        Returns:
        the halting
      • setHalting

        public void setHalting​(boolean halting)
        Parameters:
        halting - the halting to set
      • getStepLogMap

        public Map<org.pentaho.di.trans.step.StepMeta,​String> getStepLogMap()
        Returns:
        the stepLogMap
      • setStepLogMap

        public void setStepLogMap​(Map<org.pentaho.di.trans.step.StepMeta,​String> stepLogMap)
        Parameters:
        stepLogMap - the stepLogMap to set
      • dumpLoggingRegistry

        public void dumpLoggingRegistry()
      • getLogChannelProvider

        public org.pentaho.di.core.logging.HasLogChannelInterface getLogChannelProvider()
        Specified by:
        getLogChannelProvider in interface org.pentaho.di.core.logging.LogParentProvidedInterface
      • setTrans

        public void setTrans​(org.pentaho.di.trans.Trans trans)
      • sniffInput

        public void sniffInput()
      • sniffOutput

        public void sniffOutput()
      • sniffError

        public void sniffError()
      • sniff

        public void sniff​(boolean input,
                          boolean output,
                          boolean error)
      • getName

        public String getName()
        Specified by:
        getName in interface org.pentaho.ui.xul.impl.XulEventHandler
      • getXulDomContainer

        public org.pentaho.ui.xul.XulDomContainer getXulDomContainer()
        Specified by:
        getXulDomContainer in interface org.pentaho.ui.xul.impl.XulEventHandler
      • setName

        public void setName​(String arg0)
        Specified by:
        setName in interface org.pentaho.ui.xul.impl.XulEventHandler
      • setXulDomContainer

        public void setXulDomContainer​(org.pentaho.ui.xul.XulDomContainer xulDomContainer)
        Specified by:
        setXulDomContainer in interface org.pentaho.ui.xul.impl.XulEventHandler
      • autoLayout

        public void autoLayout()
        Perform an automatic layout of a transformation based on "Force-based algorithms". Source: http://en.wikipedia.org/wiki/Force-based_algorithms_(graph_drawing)

        set up initial node velocities to (0,0) set up initial node positions randomly // make sure no 2 nodes are in exactly the same position loop total_kinetic_energy := 0 // running sum of total kinetic energy over all particles for each node net-force := (0, 0) // running sum of total force on this particular node

        for each other node net-force := net-force + Coulomb_repulsion( this_node, other_node ) next node

        for each spring connected to this node net-force := net-force + Hooke_attraction( this_node, spring ) next spring

        // without damping, it moves forever this_node.velocity := (this_node.velocity + timestep * net-force) * damping this_node.position := this_node.position + timestep * this_node.velocity total_kinetic_energy := total_kinetic_energy + this_node.mass * (this_node.velocity)^2 next node until total_kinetic_energy is less than some small number // the simulation has stopped moving

      • handleTransMetaChanges

        public void handleTransMetaChanges​(org.pentaho.di.trans.TransMeta transMeta)
                                    throws org.pentaho.di.core.exception.KettleException
        Throws:
        org.pentaho.di.core.exception.KettleException
      • addStepToChain

        public void addStepToChain​(org.pentaho.di.core.plugins.PluginInterface stepPlugin,
                                   boolean shift)
      • getSpoon

        public Spoon getSpoon()
      • setSpoon

        public void setSpoon​(Spoon spoon)
      • getTransMeta

        public org.pentaho.di.trans.TransMeta getTransMeta()
      • getTrans

        public org.pentaho.di.trans.Trans getTrans()