Class JobGraph

  • 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 JobGraph
    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
    Handles the display of Jobs in Spoon, in a graphical form.
    Author:
    Matt Created on 17-may-2003
    • Field Detail

      • START_TEXT

        public static final String START_TEXT
      • STOP_TEXT

        public static final String STOP_TEXT
      • shell

        protected org.eclipse.swt.widgets.Shell shell
      • log

        protected org.pentaho.di.core.logging.LogChannelInterface log
      • jobMeta

        protected org.pentaho.di.job.JobMeta jobMeta
      • job

        public org.pentaho.di.job.Job job
      • iconsize

        protected int iconsize
      • linewidth

        protected int linewidth
      • lastclick

        protected org.pentaho.di.core.gui.Point lastclick
      • selectedEntries

        protected List<org.pentaho.di.job.entry.JobEntryCopy> selectedEntries
      • selectedEntry

        protected org.pentaho.di.job.entry.JobEntryCopy selectedEntry
      • previousLocations

        protected org.pentaho.di.core.gui.Point[] previousLocations
      • selectedNote

        protected org.pentaho.di.core.NotePadMeta selectedNote
      • previous_note_location

        protected org.pentaho.di.core.gui.Point previous_note_location
      • lastMove

        protected org.pentaho.di.core.gui.Point lastMove
      • hop_candidate

        protected org.pentaho.di.job.JobHopMeta hop_candidate
      • drop_candidate

        protected org.pentaho.di.core.gui.Point drop_candidate
      • spoon

        protected Spoon spoon
      • split_hop

        protected boolean split_hop
      • lastButton

        protected int lastButton
      • last_hop_split

        protected org.pentaho.di.job.JobHopMeta last_hop_split
      • selectionRegion

        protected org.pentaho.di.core.gui.Rectangle selectionRegion
      • theta

        protected static final double theta
      • shadowsize

        protected int shadowsize
      • menuMap

        protected Map<String,​org.pentaho.ui.xul.containers.XulMenupopup> menuMap
      • currentMouseX

        protected int currentMouseX
      • currentMouseY

        protected int currentMouseY
      • jobEntry

        protected org.pentaho.di.job.entry.JobEntryCopy jobEntry
      • ni

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

        protected org.pentaho.di.job.JobHopMeta currentHop
      • extraViewComposite

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

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

      • JobGraph

        public JobGraph​(org.eclipse.swt.widgets.Composite par,
                        Spoon spoon,
                        org.pentaho.di.job.JobMeta jobMeta)
    • Method Detail

      • hideToolTips

        protected void hideToolTips()
      • 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
      • mouseEnter

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

        public void mouseExit​(org.eclipse.swt.events.MouseEvent event)
        Specified by:
        mouseExit 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
      • checkIfHopAlreadyExists

        public boolean checkIfHopAlreadyExists​(org.pentaho.di.job.JobMeta jobMeta,
                                               org.pentaho.di.job.JobHopMeta newHop)
      • getVisibleAreaOwner

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

        protected void asyncRedraw()
      • 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
      • selectInRect

        public void selectInRect​(org.pentaho.di.job.JobMeta jobMeta,
                                 org.pentaho.di.core.gui.Rectangle rect)
      • renameJobEntry

        public void renameJobEntry​(org.pentaho.di.job.entry.JobEntryCopy jobEntry,
                                   String newName)
        Method gets called, when the user wants to change a job entries name and he indeed entered a different name then the old one. Make sure that no other job entry matches this name and rename in case of uniqueness.
        Parameters:
        jobEntry -
        newName -
      • showOnlyStartOnceMessage

        public static void showOnlyStartOnceMessage​(org.eclipse.swt.widgets.Shell shell)
      • delSelected

        public void delSelected()
      • delSelected

        public void delSelected​(org.pentaho.di.job.entry.JobEntryCopy clickedEntry)
      • clearSettings

        public void clearSettings()
      • getRealPosition

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

        protected int[] getLine​(org.pentaho.di.job.entry.JobEntryCopy fs,
                                org.pentaho.di.job.entry.JobEntryCopy ts)
      • setJobEntry

        public void setJobEntry​(org.pentaho.di.job.entry.JobEntryCopy jobEntry)
      • getJobEntry

        public org.pentaho.di.job.entry.JobEntryCopy getJobEntry()
      • openTransformation

        public void openTransformation()
      • openJob

        public void openJob()
      • newHopClick

        public void newHopClick()
      • editEntryClick

        public void editEntryClick()
      • editEntryDescription

        public void editEntryDescription()
      • editEntryParallel

        public void editEntryParallel()
        Go from serial to parallel to serial execution
      • duplicateEntry

        public void duplicateEntry()
                            throws org.pentaho.di.core.exception.KettleException
        Throws:
        org.pentaho.di.core.exception.KettleException
      • copyEntry

        public void copyEntry()
      • detachEntry

        public void detachEntry()
      • hideEntry

        public void hideEntry()
      • deleteEntry

        public void deleteEntry()
      • setMenu

        protected void setMenu​(int x,
                               int y)
      • selectAll

        public void selectAll()
      • clearSelection

        public void clearSelection()
      • editJobProperties

        public void editJobProperties()
      • pasteNote

        public void pasteNote()
      • newNote

        public void newNote()
      • setCurrentNote

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

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

        public void editNote()
      • deleteNote

        public void deleteNote()
      • raiseNote

        public void raiseNote()
      • lowerNote

        public void lowerNote()
      • flipHop

        public void flipHop()
      • disableHop

        public void disableHop()
      • deleteHop

        public void deleteHop()
      • setHopUnconditional

        public void setHopUnconditional()
      • setHopEvaluationTrue

        public void setHopEvaluationTrue()
      • setHopEvaluationFalse

        public void setHopEvaluationFalse()
      • setCurrentHop

        protected void setCurrentHop​(org.pentaho.di.job.JobHopMeta hop)
      • getCurrentHop

        protected org.pentaho.di.job.JobHopMeta getCurrentHop()
      • enableHopsBetweenSelectedEntries

        public void enableHopsBetweenSelectedEntries()
      • disableHopsBetweenSelectedEntries

        public void disableHopsBetweenSelectedEntries()
      • enableHopsBetweenSelectedEntries

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

        public void enableHopsDownstream()
      • disableHopsDownstream

        public void disableHopsDownstream()
      • enableDisableHopsDownstream

        public void enableDisableHopsDownstream​(boolean enabled)
      • setToolTip

        protected void setToolTip​(int x,
                                  int y,
                                  int screenX,
                                  int screenY)
      • launchStuff

        public void launchStuff​(org.pentaho.di.job.entry.JobEntryCopy jobEntryCopy)
      • launchStuff

        public void launchStuff()
      • loadReferencedObject

        protected void loadReferencedObject​(org.pentaho.di.job.entry.JobEntryCopy jobEntryCopy,
                                            int index)
      • openTransformation

        protected void openTransformation​(org.pentaho.di.job.entries.trans.JobEntryTrans entry,
                                          org.pentaho.di.job.entry.JobEntryCopy jobEntryCopy)
      • openJob

        public void openJob​(org.pentaho.di.job.entries.job.JobEntryJob entry,
                            org.pentaho.di.job.entry.JobEntryCopy jobEntryCopy)
      • setJob

        public void setJob​(org.pentaho.di.job.Job job)
      • copyInternalJobVariables

        public static void copyInternalJobVariables​(org.pentaho.di.job.JobMeta sourceJobMeta,
                                                    org.pentaho.di.trans.TransMeta targetTransMeta)
      • paintControl

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

        public org.eclipse.swt.graphics.Image getJobImage​(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
      • newHop

        protected void newHop()
      • editEntry

        protected void editEntry​(org.pentaho.di.job.entry.JobEntryCopy je)
      • editNote

        protected void editNote​(org.pentaho.di.core.NotePadMeta ni)
      • drawArrow

        protected void drawArrow​(org.eclipse.swt.graphics.GC gc,
                                 int[] line)
      • pointOnLine

        protected boolean pointOnLine​(int x,
                                      int y,
                                      int[] line)
      • pointOnThinLine

        protected boolean pointOnThinLine​(int x,
                                          int y,
                                          int[] line)
      • createSnapAllignDistribute

        protected org.pentaho.di.core.gui.SnapAllignDistribute createSnapAllignDistribute()
      • snaptogrid

        public void snaptogrid()
      • snaptogrid

        protected void snaptogrid​(int size)
      • allignleft

        public void allignleft()
      • allignright

        public void allignright()
      • alligntop

        public void alligntop()
      • allignbottom

        public void allignbottom()
      • distributehorizontal

        public void distributehorizontal()
      • distributevertical

        public void distributevertical()
      • drawRect

        protected void drawRect​(org.eclipse.swt.graphics.GC gc,
                                org.eclipse.swt.graphics.Rectangle rect)
      • detach

        protected void detach​(org.pentaho.di.job.entry.JobEntryCopy je)
      • newProps

        public void newProps()
      • toString

        public String toString()
        Overrides:
        toString in class org.eclipse.swt.widgets.Widget
      • getMeta

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

        public void setJobMeta​(org.pentaho.di.job.JobMeta jobMeta)
        Parameters:
        jobMeta - the jobMeta to set
      • 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)
      • showChangedWarning

        public static int showChangedWarning​(org.eclipse.swt.widgets.Shell shell,
                                             String name)
      • editProperties

        public static boolean editProperties​(org.pentaho.di.job.JobMeta jobMeta,
                                             Spoon spoon,
                                             org.pentaho.di.repository.Repository rep,
                                             boolean allowDirectoryChange)
      • getLastMove

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

        public void setLastMove​(org.pentaho.di.core.gui.Point lastMove)
        Parameters:
        lastMove - the lastMove to set
      • addExtraView

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

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

        public boolean isExecutionResultsPaneVisible()
      • showExecutionResults

        public void showExecutionResults()
      • addAllTabs

        public void addAllTabs()
      • 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()
      • runJob

        public void runJob()
      • runOptionsJob

        public void runOptionsJob()
      • getSQL

        public void getSQL()
      • getToolbar

        public org.pentaho.ui.xul.containers.XulToolbar getToolbar()
      • exploreDatabase

        public void exploreDatabase()
      • browseVersionHistory

        public void browseVersionHistory()
      • startJob

        public void startJob​(org.pentaho.di.job.JobExecutionConfiguration executionConfiguration)
                      throws org.pentaho.di.core.exception.KettleException
        Throws:
        org.pentaho.di.core.exception.KettleException
      • showSaveFileMessage

        public void showSaveFileMessage()
      • jobFinished

        protected void jobFinished()
        This gets called at the very end, when everything is done.
      • stopJob

        public void stopJob()
      • getRefreshListeners

        public List<RefreshListener> getRefreshListeners()
        Returns:
        the refresh listeners
      • setRefreshListeners

        public void setRefreshListeners​(List<RefreshListener> refreshListeners)
        Parameters:
        refreshListeners - the refresh listeners to set
      • addRefreshListener

        public void addRefreshListener​(RefreshListener refreshListener)
        Parameters:
        refreshListener - the job refresh listener to add
      • 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 name)
        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
      • getLogChannelProvider

        public org.pentaho.di.core.logging.HasLogChannelInterface getLogChannelProvider()
        Specified by:
        getLogChannelProvider in interface org.pentaho.di.core.logging.LogParentProvidedInterface
      • 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)
      • replayJob

        public void replayJob()
      • handleJobMetaChanges

        public void handleJobMetaChanges​(org.pentaho.di.job.JobMeta jobMeta)
                                  throws org.pentaho.di.core.exception.KettleException
        Throws:
        org.pentaho.di.core.exception.KettleException
      • addJobEntryToChain

        public void addJobEntryToChain​(String typeDesc,
                                       boolean shift)
      • getSpoon

        public Spoon getSpoon()
      • setSpoon

        public void setSpoon​(Spoon spoon)
      • getJobMeta

        public org.pentaho.di.job.JobMeta getJobMeta()
      • getJob

        public org.pentaho.di.job.Job getJob()