/** * Find the step that is located on a certain point on the canvas, taking into account the icon size. * * @param x * the x-coordinate of the point queried * @param y * the y-coordinate of the point queried * @param iconsize * the iconsize * @return The step information if a step is located at the point. Otherwise, if no step was found: null. */ public StepMeta getStep( int x, int y, int iconsize ) { int i, s; s = steps.size(); for ( i = s - 1; i >= 0; i-- ) { // Back to front because drawing goes from start to end StepMeta stepMeta = steps.get( i ); if ( partOfTransHop( stepMeta ) || stepMeta.isDrawn() ) { // Only consider steps from active or inactive hops! Point p = stepMeta.getLocation(); if ( p != null ) { if ( x >= p.x && x <= p.x + iconsize && y >= p.y && y <= p.y + iconsize + 20 ) { return stepMeta; } } } } return null; }
if ( stepMeta.isDrawn() && !isStepUsedInTransHops( stepMeta ) ) { st.add( stepMeta );
public void hideStep() { for ( int i = 0; i < transMeta.nrSteps(); i++ ) { StepMeta sti = transMeta.getStep( i ); if ( sti.isDrawn() && sti.isSelected() ) { sti.hideStep(); spoon.refreshTree(); } } getCurrentStep().hideStep(); spoon.refreshTree(); redraw(); }
@Override public void refresh( AbstractMeta meta, TreeNode treeNode, String filter ) { TransMeta transMeta = (TransMeta) meta; for ( int i = 0; i < transMeta.nrSteps(); i++ ) { StepMeta stepMeta = transMeta.getStep( i ); if ( stepMeta.isMissing() ) { continue; } PluginInterface stepPlugin = PluginRegistry.getInstance().findPluginWithId( StepPluginType.class, stepMeta.getStepID() ); if ( !filterMatch( stepMeta.getName(), filter ) ) { continue; } Image stepIcon = GUIResource.getInstance().getImagesStepsSmall().get( stepPlugin.getIds()[ 0 ] ); if ( stepIcon == null ) { stepIcon = GUIResource.getInstance().getImageFolder(); } TreeNode childTreeNode = createTreeNode( treeNode, stepMeta.getName(), stepIcon ); childTreeNode.setData( "StepId", stepMeta.getStepID() ); if ( stepMeta.isShared() ) { childTreeNode.setFont( GUIResource.getInstance().getFontBold() ); } if ( !stepMeta.isDrawn() ) { childTreeNode.setForeground( GUIResource.getInstance().getColorDarkGray() ); } } }
if ( stepMeta.isDrawn() ) { drawStep( stepMeta ); if ( stepMeta.isDrawn() ) { checkDrawSlowStepIndicator( stepMeta ); if ( stepMeta.isDrawn() ) { drawStepStatusIndicator( stepMeta ); if ( stepMeta.isDrawn() ) { drawStepPerformanceTable( stepMeta ); for ( int i = transMeta.nrSteps() - 1; i >= 0; i-- ) { StepMeta stepMeta = transMeta.getStep( i ); if ( stepMeta.isSelected() && stepMeta.isDrawn() && selectedStepsCount == 1 ) { extension = new TransPainterFlyoutExtension( gc, areaOwners, transMeta, stepMeta, translationX, translationY, magnification, area, offset );
item.setDisabled( !( stepMeta.isDrawn() && !transMeta.isAnySelectedStepUsedInTransHops() ) );
.isDistributes(), stepMeta.getCopies(), stepMeta.getLocation() == null ? -1 : stepMeta.getLocation().x, stepMeta.getLocation() == null ? -1 : stepMeta.getLocation().y, stepMeta.isDrawn(), stepMeta.getCopiesString() ) );
writerStep.setLocation( originalStep.getLocation().x, originalStep.getLocation().y + ( s * FANOUT * 2 ) - ( nrSlavesNodes * FANOUT / 2 ) ); writerStep.setDraw( originalStep.isDrawn() ); readerStep.setLocation( originalStep.getLocation().x - ( SPLIT / 2 ), originalStep .getLocation().y ); readerStep.setDraw( originalStep.isDrawn() ); slave.addStep( readerStep );
check.setDraw( stepMeta.isDrawn() ); // Just keep the drawn flag and location check.setLocation( stepMeta.getLocation() );
if ( stepMeta.isDrawn() || transMeta.isStepUsedInTransHops( stepMeta ) ) { modalMessageDialog( getString( "TransGraph.Dialog.StepIsAlreadyOnCanvas.Title" ), getString( "TransGraph.Dialog.StepIsAlreadyOnCanvas.Message" ), SWT.OK );
stepNode.setProperty( PROP_STEP_GUI_LOCATION_X, step.getLocation().x ); stepNode.setProperty( PROP_STEP_GUI_LOCATION_Y, step.getLocation().y ); stepNode.setProperty( PROP_STEP_GUI_DRAW, step.isDrawn() );