当前位置: 首页>>代码示例>>Java>>正文


Java TransHopMeta.getFromStep方法代码示例

本文整理汇总了Java中org.pentaho.di.trans.TransHopMeta.getFromStep方法的典型用法代码示例。如果您正苦于以下问题:Java TransHopMeta.getFromStep方法的具体用法?Java TransHopMeta.getFromStep怎么用?Java TransHopMeta.getFromStep使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.pentaho.di.trans.TransHopMeta的用法示例。


在下文中一共展示了TransHopMeta.getFromStep方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: findHop

import org.pentaho.di.trans.TransHopMeta; //导入方法依赖的package包/类
/**
 *  See if location (x,y) is on a line between two steps: the hop!
 *  @param x
 *  @param y
 *  @param exclude the step to exclude from the hops (from or to location). Specify null if no step is to be excluded.
 *  @return the transformation hop on the specified location, otherwise: null 
 */
private TransHopMeta findHop(int x, int y, StepMeta exclude) {
  int i;
  TransHopMeta online = null;
  for (i = 0; i < transMeta.nrTransHops(); i++) {
    TransHopMeta hi = transMeta.getTransHop(i);
    StepMeta fs = hi.getFromStep();
    StepMeta ts = hi.getToStep();

    if (fs == null || ts == null)
      return null;

    // If either the "from" or "to" step is excluded, skip this hop.
    //
    if (exclude != null && (exclude.equals(fs) || exclude.equals(ts)))
      continue;

    int line[] = getLine(fs, ts);

    if (pointOnLine(x, y, line))
      online = hi;
  }
  return online;
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:31,代码来源:TransGraph.java

示例2: saveTransHopMeta

import org.pentaho.di.trans.TransHopMeta; //导入方法依赖的package包/类
public void saveTransHopMeta(TransHopMeta transHopMeta, ObjectId id_transformation) throws KettleException
{
	try
	{
		// See if a transformation hop with the same fromstep and tostep is
		// already available...
		ObjectId id_step_from = transHopMeta.getFromStep() == null ? null : transHopMeta.getFromStep().getObjectId();
		ObjectId id_step_to = transHopMeta.getToStep() == null ? null : transHopMeta.getToStep().getObjectId();

		// Insert new transMeta hop in repository
		transHopMeta.setObjectId(insertTransHop(id_transformation, id_step_from, id_step_to, transHopMeta.isEnabled()));
	} catch (KettleDatabaseException dbe)
	{
		throw new KettleException(
				BaseMessages.getString(PKG, "TransHopMeta.Exception.UnableToSaveTransformationHopInfo") + id_transformation, dbe); //$NON-NLS-1$
	}
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:18,代码来源:KettleDatabaseRepositoryTransDelegate.java

示例3: saveTransHopMeta

import org.pentaho.di.trans.TransHopMeta; //导入方法依赖的package包/类
public void saveTransHopMeta( TransHopMeta transHopMeta, ObjectId id_transformation ) throws KettleException {
  try {
    // See if a transformation hop with the same fromstep and tostep is
    // already available...
    ObjectId id_step_from = transHopMeta.getFromStep() == null ? null : transHopMeta.getFromStep().getObjectId();
    ObjectId id_step_to = transHopMeta.getToStep() == null ? null : transHopMeta.getToStep().getObjectId();

    // Insert new transMeta hop in repository
    transHopMeta.setObjectId( insertTransHop( id_transformation, id_step_from, id_step_to, transHopMeta
      .isEnabled() ) );
  } catch ( KettleDatabaseException dbe ) {
    throw new KettleException( BaseMessages.getString(
      PKG, "TransHopMeta.Exception.UnableToSaveTransformationHopInfo" )
      + id_transformation, dbe );
  }
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:17,代码来源:KettleDatabaseRepositoryTransDelegate.java

示例4: createGraph

import org.pentaho.di.trans.TransHopMeta; //导入方法依赖的package包/类
public static Graph createGraph( EngineMetaInterface meta ) {
  if ( meta == null ) {
    return null;
  }
  Graph g = new TinkerGraph();
  if ( meta instanceof TransMeta ) {
    TransMeta transMeta = (TransMeta) meta;

    // Add nodes
    List<StepMeta> steps = transMeta.getSteps();
    if ( steps != null ) {
      for ( StepMeta step : steps ) {
        Vertex v = g.addVertex( step.getName() );
        v.setProperty( PROPERTY_NAME, step.getName() );
        v.setProperty( PROPERTY_PLUGINID, step.getStepID() );
        Point location = step.getLocation();
        v.setProperty( PROPERTY_X, location.x );
        v.setProperty( PROPERTY_Y, location.y );
        v.setProperty( PROPERTY_REF, step );
      }
    }
    int numHops = transMeta.nrTransHops();
    for ( int i = 0; i < numHops; i++ ) {
      TransHopMeta hop = transMeta.getTransHop( i );
      StepMeta fromStep = hop.getFromStep();
      StepMeta toStep = hop.getToStep();
      Vertex fromV = g.getVertex( fromStep.getName() );
      Vertex toV = g.getVertex( toStep.getName() );
      g.addEdge( null, fromV, toV, EDGE_HOPSTO );
    }
  }
  return g;
}
 
开发者ID:mattyb149,项目名称:pdi-layout,代码行数:34,代码来源:GraphUtils.java

示例5: detach

import org.pentaho.di.trans.TransHopMeta; //导入方法依赖的package包/类
private void detach(StepMeta stepMeta) {
  TransHopMeta hfrom = transMeta.findTransHopTo(stepMeta);
  TransHopMeta hto = transMeta.findTransHopFrom(stepMeta);

  if (hfrom != null && hto != null) {
    if (transMeta.findTransHop(hfrom.getFromStep(), hto.getToStep()) == null) {
      TransHopMeta hnew = new TransHopMeta(hfrom.getFromStep(), hto.getToStep());
      transMeta.addTransHop(hnew);
      spoon.addUndoNew(transMeta, new TransHopMeta[] { hnew }, new int[] { transMeta.indexOfTransHop(hnew) });
      spoon.refreshTree();
    }
  }
  if (hfrom != null) {
    int fromidx = transMeta.indexOfTransHop(hfrom);
    if (fromidx >= 0) {
      transMeta.removeTransHop(fromidx);
      spoon.refreshTree();
    }
  }
  if (hto != null) {
    int toidx = transMeta.indexOfTransHop(hto);
    if (toidx >= 0) {
      transMeta.removeTransHop(toidx);
      spoon.refreshTree();
    }
  }
  spoon.refreshTree();
  redraw();
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:30,代码来源:TransGraph.java

示例6: drawHop

import org.pentaho.di.trans.TransHopMeta; //导入方法依赖的package包/类
private void drawHop(GC gc, TransHopMeta hi, boolean is_candidate)
{
    StepMeta fs = hi.getFromStep();
    StepMeta ts = hi.getToStep();

    if (fs != null && ts != null)
    {
        drawLine(gc, fs, ts, hi, is_candidate);
    }
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:11,代码来源:TransPainter.java

示例7: delHop

import org.pentaho.di.trans.TransHopMeta; //导入方法依赖的package包/类
public void delHop(TransMeta transMeta, TransHopMeta transHopMeta) {
  int index = transMeta.indexOfTransHop(transHopMeta);
  addUndoDelete(transMeta, new Object[] { (TransHopMeta) transHopMeta.clone() }, new int[] { index });
  transMeta.removeTransHop(index);
  
  // If this is an error handling hop, disable it
  // 
  if (transHopMeta.getFromStep().isDoingErrorHandling()) {
    StepErrorMeta stepErrorMeta = transHopMeta.getFromStep().getStepErrorMeta();

    // We can only disable error handling if the target of the hop is the same as the target of the error handling.
    //
    if (stepErrorMeta.getTargetStep()!=null && stepErrorMeta.getTargetStep().equals(transHopMeta.getToStep())) {
      StepMeta stepMeta = transHopMeta.getFromStep();
      // Only if the target step is where the error handling is going to...
      //

      StepMeta before = (StepMeta)stepMeta.clone();
      stepErrorMeta.setEnabled(false);

      index = transMeta.indexOfStep(stepMeta);
      addUndoChange(transMeta, new Object[] { before }, new Object[]{ stepMeta}, new int[] { index });
    }
  }
  
  refreshTree();
  refreshGraph();
}
 
开发者ID:yintaoxue,项目名称:read-open-source-code,代码行数:29,代码来源:Spoon.java

示例8: delHop

import org.pentaho.di.trans.TransHopMeta; //导入方法依赖的package包/类
public void delHop( TransMeta transMeta, TransHopMeta transHopMeta ) {
  int index = transMeta.indexOfTransHop( transHopMeta );
  addUndoDelete( transMeta, new Object[] { (TransHopMeta) transHopMeta.clone() }, new int[] { index } );
  transMeta.removeTransHop( index );

  StepMeta fromStepMeta = transHopMeta.getFromStep();
  StepMeta before = (StepMeta) fromStepMeta.clone();
  index = transMeta.indexOfStep( fromStepMeta );

  boolean stepFromNeedAddUndoChange = fromStepMeta.getStepMetaInterface().cleanAfterHopFromRemove();
  // If this is an error handling hop, disable it
  //
  if ( transHopMeta.getFromStep().isDoingErrorHandling() ) {
    StepErrorMeta stepErrorMeta = fromStepMeta.getStepErrorMeta();

    // We can only disable error handling if the target of the hop is the same as the target of the error handling.
    //
    if ( stepErrorMeta.getTargetStep() != null
      && stepErrorMeta.getTargetStep().equals( transHopMeta.getToStep() ) ) {

      // Only if the target step is where the error handling is going to...
      //
      stepErrorMeta.setEnabled( false );
      stepFromNeedAddUndoChange = true;
    }
  }
  if ( stepFromNeedAddUndoChange ) {
    addUndoChange( transMeta, new Object[]{before}, new Object[]{fromStepMeta}, new int[]{index} );
  }

  refreshTree();
  refreshGraph();
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:34,代码来源:Spoon.java

示例9: findHop

import org.pentaho.di.trans.TransHopMeta; //导入方法依赖的package包/类
/**
 * See if location (x,y) is on a line between two steps: the hop!
 *
 * @param x
 * @param y
 * @param exclude the step to exclude from the hops (from or to location). Specify null if no step is to be excluded.
 * @return the transformation hop on the specified location, otherwise: null
 */
private TransHopMeta findHop( int x, int y, StepMeta exclude ) {
  int i;
  TransHopMeta online = null;
  for ( i = 0; i < transMeta.nrTransHops(); i++ ) {
    TransHopMeta hi = transMeta.getTransHop( i );
    StepMeta fs = hi.getFromStep();
    StepMeta ts = hi.getToStep();

    if ( fs == null || ts == null ) {
      return null;
    }

    // If either the "from" or "to" step is excluded, skip this hop.
    //
    if ( exclude != null && ( exclude.equals( fs ) || exclude.equals( ts ) ) ) {
      continue;
    }

    int[] line = getLine( fs, ts );

    if ( pointOnLine( x, y, line ) ) {
      online = hi;
    }
  }
  return online;
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:35,代码来源:TransGraph.java


注:本文中的org.pentaho.di.trans.TransHopMeta.getFromStep方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。