org.pentaho.di.ui.spoon.trans
Class TransGraph

java.lang.Object
  extended by Composite
      extended by org.pentaho.di.ui.spoon.AbstractGraph
          extended by org.pentaho.di.ui.spoon.trans.TransGraph
All Implemented Interfaces:
Redrawable, LogParentProvidedInterface, TabItemInterface, org.pentaho.ui.xul.impl.XulEventHandler

public class TransGraph
extends AbstractGraph
implements org.pentaho.ui.xul.impl.XulEventHandler, Redrawable, TabItemInterface, LogParentProvidedInterface

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 Summary
 Composite extraViewComposite
           
 CTabFolder extraViewTabFolder
           
static String PAUSE_TEXT
           
static String RESUME_TEXT
           
static String START_TEXT
           
static String STOP_TEXT
           
 Trans trans
           
 TransGridDelegate transGridDelegate
           
 TransHistoryDelegate transHistoryDelegate
           
 TransLogDelegate transLogDelegate
           
 TransPerfDelegate transPerfDelegate
           
 
Constructor Summary
TransGraph(Composite parent, Spoon spoon, TransMeta transMeta)
           
 
Method Summary
 void addAllTabs()
           
 void addExtraView()
          Add an extra view to the main composite SashForm
 void addUndoPosition(Object[] obj, int[] pos, Point[] prev, Point[] curr)
           
 void addUndoPosition(Object[] obj, int[] pos, Point[] prev, Point[] curr, boolean nextAlso)
           
 void allignbottom()
           
 void allignleft()
           
 void allignright()
           
 void alligntop()
           
 void analyseImpact()
           
 boolean applyChanges()
           
 void autoLayout()
          Perform an automatic layout of a transformation based on "Force-based algorithms".
 void browseVersionHistory()
           
 boolean canBeClosed()
          Closes the content behind the tab, de-allocates resources.
 boolean canHandleSave()
           
 void checkEmptyExtraView()
          If the extra tab view at the bottom is empty, we close it.
 void checkErrors()
           
 void checkSelectedSteps()
           
 void checkTrans()
           
 void clearSelection()
           
 void clearSettings()
           
 void clustering()
           
 void copies()
           
 void copyStep()
           
 void debug(TransExecutionConfiguration executionConfiguration, TransDebugMeta transDebugMeta)
           
 void debugFile()
           
 void deleteHop()
           
 void deleteNote()
           
 void delSelected()
           
 void delSelected(StepMeta stMeta)
           
 void detachStep()
           
 void disableHopsBetweenSelectedSteps()
           
 void disableHopsDownstream()
           
 void distributehorizontal()
           
 void distributevertical()
           
 void dumpLoggingRegistry()
           
 void dupeStep()
           
 void editDescription()
           
 void editDescription(StepMeta stepMeta)
           
 void editHop()
           
 void editNote()
           
static boolean editProperties(TransMeta transMeta, Spoon spoon, Repository rep, boolean allowDirectoryChange)
           
static boolean editProperties(TransMeta transMeta, Spoon spoon, Repository rep, boolean allowDirectoryChange, TransDialog.Tabs currentTab)
           
 void editStep()
           
 void enableDisableHopsDownstream(boolean enabled)
           
 void enableHop()
           
 void enableHopsBetweenSelectedSteps()
           
 void enableHopsBetweenSelectedSteps(boolean enabled)
          This method enables or disables all the hops between the selected steps.
 void enableHopsDownstream()
           
 void errorHandling()
           
 void exploreDatabase()
           
 void fieldsAfter()
           
 void fieldsBefore()
           
 void fieldsLineage()
           
 void flipHopDirection()
           
 void generateMappingToThisStep()
           
 TransHopMeta getCurrentHop()
           
 NotePadMeta getCurrentNote()
           
 StepMeta getCurrentStep()
           
 String[] getDropStrings(String str, String sep)
           
 List<DatabaseImpact> getImpact()
           
 Point getLastMove()
           
 TransDebugMeta getLastTransDebugMeta()
           
 HasLogChannelInterface getLogChannelProvider()
           
 TransMeta getManagedObject()
           
 EngineMetaInterface getMeta()
           
 String getName()
           
 Point getRealPosition(Composite canvas, int x, int y)
           
 List<CheckResultInterface> getRemarks()
           
 void getSQL()
           
 Map<StepMeta,String> getStepLogMap()
           
 org.pentaho.ui.xul.containers.XulToolbar getToolbar()
           
 Image getTransformationImage(Device device, int x, int y, float magnificationFactor)
           
 AreaOwner getVisibleAreaOwner(int x, int y)
           
 org.pentaho.ui.xul.XulDomContainer getXulDomContainer()
           
 void handleTransMetaChanges(TransMeta transMeta)
           
 boolean hasContentChanged()
           
 void hideStep()
           
 boolean isExecutionResultsPaneVisible()
           
 boolean isHalting()
           
 boolean isImpactFinished()
           
 boolean isRunning()
           
 void keyPressed(KeyEvent e)
           
 void keyReleased(KeyEvent e)
           
 void lowerNote()
           
 void mouseDoubleClick(MouseEvent e)
           
 void mouseDown(MouseEvent e)
           
 void mouseEnter(MouseEvent arg0)
           
 void mouseExit(MouseEvent arg0)
           
 void mouseHover(MouseEvent e)
           
 void mouseMove(MouseEvent e)
           
 void mouseScrolled(MouseEvent e)
           
 void mouseUp(MouseEvent e)
           
 void newHopChoice()
           
 void newNote()
           
 void newProps()
           
 void newStep(String description)
           
 void openFile()
           
 void openMapping()
          Open the transformation mentioned in the mapping...
 void paintControl(PaintEvent e)
           
 void partitioning()
           
 void paste()
           
 void pauseResume()
           
 void pauseTransformation()
           
 void preview()
           
 void previewFile()
           
 void printFile()
           
 void raiseNote()
           
 void renameStep(StepMeta stepMeta, String stepname)
           
 void runTransformation()
           
 void saveFile()
           
 void saveFileAs()
           
 void saveXMLFileToVfs()
           
 void selectAll()
           
 void selectInRect(TransMeta transMeta, Rectangle rect)
          Select all the steps in a certain (screen) rectangle
 void setControlStates()
           
 void setCopies()
           
 void setCurrentHop(TransHopMeta currentHop)
           
 void setCurrentNote(NotePadMeta ni)
           
 void setCurrentStep(StepMeta currentStep)
           
 void setDistributes()
           
 boolean setFocus()
           
 void setHalting(boolean halting)
           
 void setImpact(List<DatabaseImpact> impact)
           
 void setImpactFinished(boolean impactHasRun)
           
 void setName(String arg0)
           
 void setRemarks(List<CheckResultInterface> remarks)
           
 void setRunning(boolean running)
           
 void setStepLogMap(Map<StepMeta,String> stepLogMap)
           
 void settings()
           
 void setToolbar(org.pentaho.ui.xul.containers.XulToolbar toolbar)
           
 void setTrans(Trans trans)
           
 void setTransMeta(TransMeta transMeta)
           
 void setXulDomContainer(org.pentaho.ui.xul.XulDomContainer xulDomContainer)
           
 int showChangedWarning()
           
 void showExecutionResults()
           
 void showLastPreviewResults()
           
 void showPreview(TransDebugMeta transDebugMeta, StepDebugMeta stepDebugMeta, RowMetaInterface rowBufferMeta, List<Object[]> rowBuffer)
           
 void snaptogrid()
           
 void sniff(boolean input, boolean output, boolean error)
           
 void sniffError()
           
 void sniffInput()
           
 void sniffOutput()
           
 void start(TransExecutionConfiguration executionConfiguration)
           
 void stop()
           
 void stopTransformation()
           
 void transReplay()
           
 
Methods inherited from class org.pentaho.di.ui.spoon.AbstractGraph
dispose, forceFocus, getChangedWarning, real2screen, redraw, screen2real, showChangedWarning, sign, zoom100Percent, zoomIn, zoomOut
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.pentaho.ui.xul.impl.XulEventHandler
getData, setData
 
Methods inherited from interface org.pentaho.di.core.gui.Redrawable
redraw
 
Methods inherited from interface org.pentaho.di.ui.spoon.TabItemInterface
getChangedWarning
 

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 Trans trans

extraViewComposite

public Composite extraViewComposite

extraViewTabFolder

public CTabFolder extraViewTabFolder

transLogDelegate

public TransLogDelegate transLogDelegate

transGridDelegate

public TransGridDelegate transGridDelegate

transHistoryDelegate

public TransHistoryDelegate transHistoryDelegate

transPerfDelegate

public TransPerfDelegate transPerfDelegate
Constructor Detail

TransGraph

public TransGraph(Composite parent,
                  Spoon spoon,
                  TransMeta transMeta)
Method Detail

setCurrentNote

public void setCurrentNote(NotePadMeta ni)

getCurrentNote

public NotePadMeta getCurrentNote()

getCurrentHop

public TransHopMeta getCurrentHop()

setCurrentHop

public void setCurrentHop(TransHopMeta currentHop)

getCurrentStep

public StepMeta getCurrentStep()

setCurrentStep

public void setCurrentStep(StepMeta currentStep)

mouseDoubleClick

public void mouseDoubleClick(MouseEvent e)

mouseDown

public void mouseDown(MouseEvent e)

mouseUp

public void mouseUp(MouseEvent e)

mouseMove

public void mouseMove(MouseEvent e)

mouseHover

public void mouseHover(MouseEvent e)

mouseScrolled

public void mouseScrolled(MouseEvent e)

mouseEnter

public void mouseEnter(MouseEvent arg0)

mouseExit

public void mouseExit(MouseEvent arg0)

selectInRect

public void selectInRect(TransMeta transMeta,
                         Rectangle rect)
Select all the steps in a certain (screen) rectangle

Parameters:
rect - The selection area as a rectangle

keyPressed

public void keyPressed(KeyEvent e)

keyReleased

public void keyReleased(KeyEvent e)

setFocus

public boolean setFocus()
Specified by:
setFocus in interface TabItemInterface

renameStep

public void renameStep(StepMeta stepMeta,
                       String stepname)

clearSettings

public void clearSettings()

getDropStrings

public String[] getDropStrings(String str,
                               String sep)

getRealPosition

public Point getRealPosition(Composite canvas,
                             int x,
                             int y)

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()

setCopies

public void setCopies()

copies

public void copies()

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()

getVisibleAreaOwner

public AreaOwner getVisibleAreaOwner(int x,
                                     int y)

delSelected

public void delSelected(StepMeta stMeta)

editDescription

public void editDescription(StepMeta stepMeta)

paintControl

public void paintControl(PaintEvent e)

getTransformationImage

public Image getTransformationImage(Device device,
                                    int x,
                                    int y,
                                    float magnificationFactor)

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 EngineMetaInterface getMeta()
Specified by:
getMeta in interface TabItemInterface

setTransMeta

public void setTransMeta(TransMeta transMeta)
Parameters:
transMeta - the transMeta to set

addUndoPosition

public void addUndoPosition(Object[] obj,
                            int[] pos,
                            Point[] prev,
                            Point[] curr)

addUndoPosition

public void addUndoPosition(Object[] obj,
                            int[] pos,
                            Point[] prev,
                            Point[] curr,
                            boolean nextAlso)

applyChanges

public boolean applyChanges()
                     throws KettleException
Specified by:
applyChanges in interface TabItemInterface
Throws:
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)

getManagedObject

public TransMeta getManagedObject()
Specified by:
getManagedObject in interface TabItemInterface

hasContentChanged

public boolean hasContentChanged()
Specified by:
hasContentChanged in interface TabItemInterface

getRemarks

public List<CheckResultInterface> getRemarks()

setRemarks

public void setRemarks(List<CheckResultInterface> remarks)

getImpact

public List<DatabaseImpact> getImpact()

setImpact

public void setImpact(List<DatabaseImpact> impact)

isImpactFinished

public boolean isImpactFinished()

setImpactFinished

public void setImpactFinished(boolean impactHasRun)

getLastMove

public Point getLastMove()
Returns:
the lastMove

editProperties

public static boolean editProperties(TransMeta transMeta,
                                     Spoon spoon,
                                     Repository rep,
                                     boolean allowDirectoryChange)

editProperties

public static boolean editProperties(TransMeta transMeta,
                                     Spoon spoon,
                                     Repository rep,
                                     boolean allowDirectoryChange,
                                     TransDialog.Tabs currentTab)

openFile

public void openFile()

saveFile

public void saveFile()
              throws KettleException
Throws:
KettleException

saveFileAs

public void saveFileAs()
                throws KettleException
Throws:
KettleException

saveXMLFileToVfs

public void saveXMLFileToVfs()

printFile

public void printFile()

runTransformation

public void runTransformation()

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

public void checkErrors()

start

public void start(TransExecutionConfiguration executionConfiguration)
           throws KettleException
Throws:
KettleException

addAllTabs

public void addAllTabs()

debug

public void debug(TransExecutionConfiguration executionConfiguration,
                  TransDebugMeta transDebugMeta)

showPreview

public void showPreview(TransDebugMeta transDebugMeta,
                        StepDebugMeta stepDebugMeta,
                        RowMetaInterface rowBufferMeta,
                        List<Object[]> rowBuffer)

stop

public void stop()

pauseResume

public void pauseResume()

setControlStates

public void setControlStates()
Specified by:
setControlStates in interface TabItemInterface

showLastPreviewResults

public void showLastPreviewResults()

openMapping

public void openMapping()
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 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<StepMeta,String> getStepLogMap()
Returns:
the stepLogMap

setStepLogMap

public void setStepLogMap(Map<StepMeta,String> stepLogMap)
Parameters:
stepLogMap - the stepLogMap to set

dumpLoggingRegistry

public void dumpLoggingRegistry()

getLogChannelProvider

public HasLogChannelInterface getLogChannelProvider()
Specified by:
getLogChannelProvider in interface LogParentProvidedInterface

setTrans

public void setTrans(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

canHandleSave

public boolean canHandleSave()
Specified by:
canHandleSave in interface TabItemInterface

showChangedWarning

public int showChangedWarning()
                       throws KettleException
Specified by:
showChangedWarning in interface TabItemInterface
Overrides:
showChangedWarning in class AbstractGraph
Throws:
KettleException

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(TransMeta transMeta)
                            throws KettleException
Throws:
KettleException