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


Java TransAction.setPosition方法代码示例

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


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

示例1: addUndo

import org.pentaho.di.core.undo.TransAction; //导入方法依赖的package包/类
public void addUndo(Object from[], Object to[], int pos[], Point prev[], Point curr[], int type_of_change, boolean nextAlso) {
	// First clean up after the current position.
	// Example: position at 3, size=5
	// 012345
	// ^
	// remove 34
	// Add 4
	// 01234

	while (undo.size() > undo_position + 1 && undo.size() > 0) {
		int last = undo.size() - 1;
		undo.remove(last);
	}

	TransAction ta = new TransAction();
	switch (type_of_change) {
	case TYPE_UNDO_CHANGE:
		ta.setChanged(from, to, pos);
		break;
	case TYPE_UNDO_DELETE:
		ta.setDelete(from, pos);
		break;
	case TYPE_UNDO_NEW:
		ta.setNew(from, pos);
		break;
	case TYPE_UNDO_POSITION:
		ta.setPosition(from, pos, prev, curr);
		break;
	}
	undo.add(ta);
	undo_position++;

	if (undo.size() > max_undo) {
		undo.remove(0);
		undo_position--;
	}
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:38,代码来源:JobMeta.java

示例2: addUndo

import org.pentaho.di.core.undo.TransAction; //导入方法依赖的package包/类
/**
 * Add an undo operation to the undo list
 *
 * @param from array of objects representing the old state
 * @param to array of objectes representing the new state
 * @param pos An array of object locations
 * @param prev An array of points representing the old positions
 * @param curr An array of points representing the new positions
 * @param type_of_change The type of change that's being done to the transformation.
 * @param nextAlso indicates that the next undo operation needs to follow this one.
 */
public void addUndo(Object from[], Object to[], int pos[], Point prev[], Point curr[], int type_of_change, boolean nextAlso)
{
    // First clean up after the current position.
    // Example: position at 3, size=5
    // 012345
    // ^
    // remove 34
    // Add 4
    // 01234

    while (undo.size() > undo_position + 1 && undo.size() > 0)
    {
        int last = undo.size() - 1;
        undo.remove(last);
    }

    TransAction ta = new TransAction();
    switch (type_of_change)
    {
    case TYPE_UNDO_CHANGE:
        ta.setChanged(from, to, pos);
        break;
    case TYPE_UNDO_DELETE:
        ta.setDelete(from, pos);
        break;
    case TYPE_UNDO_NEW:
        ta.setNew(from, pos);
        break;
    case TYPE_UNDO_POSITION:
        ta.setPosition(from, pos, prev, curr);
        break;
    }
    ta.setNextAlso(nextAlso);
    undo.add(ta);
    undo_position++;

    if (undo.size() > max_undo)
    {
        undo.remove(0);
        undo_position--;
    }
}
 
开发者ID:icholy,项目名称:geokettle-2.0,代码行数:54,代码来源:TransMeta.java

示例3: addUndo

import org.pentaho.di.core.undo.TransAction; //导入方法依赖的package包/类
/**
 * Adds an undo operation to the undo list.
 *
 * @param from array of objects representing the old state
 * @param to array of objectes representing the new state
 * @param pos An array of object locations
 * @param prev An array of points representing the old positions
 * @param curr An array of points representing the new positions
 * @param type_of_change The type of change that's being done to the transformation.
 * @param nextAlso indicates that the next undo operation needs to follow this one.
 */
public void addUndo(Object from[], Object to[], int pos[], Point prev[], Point curr[], int type_of_change, boolean nextAlso)
{
    // First clean up after the current position.
    // Example: position at 3, size=5
    // 012345
    // ^
    // remove 34
    // Add 4
    // 01234

    while (undo.size() > undo_position + 1 && undo.size() > 0)
    {
        int last = undo.size() - 1;
        undo.remove(last);
    }

    TransAction ta = new TransAction();
    switch (type_of_change)
    {
    case TYPE_UNDO_CHANGE:
        ta.setChanged(from, to, pos);
        break;
    case TYPE_UNDO_DELETE:
        ta.setDelete(from, pos);
        break;
    case TYPE_UNDO_NEW:
        ta.setNew(from, pos);
        break;
    case TYPE_UNDO_POSITION:
        ta.setPosition(from, pos, prev, curr);
        break;
    }
    ta.setNextAlso(nextAlso);
    undo.add(ta);
    undo_position++;

    if (undo.size() > max_undo)
    {
        undo.remove(0);
        undo_position--;
    }
}
 
开发者ID:bsspirit,项目名称:kettle-4.4.0-stable,代码行数:54,代码来源:TransMeta.java

示例4: addUndo

import org.pentaho.di.core.undo.TransAction; //导入方法依赖的package包/类
@Override
public void addUndo( Object[] from, Object[] to, int[] pos, Point[] prev, Point[] curr, int type_of_change,
                     boolean nextAlso ) {
  // First clean up after the current position.
  // Example: position at 3, size=5
  // 012345
  // ^
  // remove 34
  // Add 4
  // 01234

  while ( undo.size() > undo_position + 1 && undo.size() > 0 ) {
    int last = undo.size() - 1;
    undo.remove( last );
  }

  TransAction ta = new TransAction();
  switch ( type_of_change ) {
    case TYPE_UNDO_CHANGE:
      ta.setChanged( from, to, pos );
      break;
    case TYPE_UNDO_DELETE:
      ta.setDelete( from, pos );
      break;
    case TYPE_UNDO_NEW:
      ta.setNew( from, pos );
      break;
    case TYPE_UNDO_POSITION:
      ta.setPosition( from, pos, prev, curr );
      break;
    default:
      break;
  }
  undo.add( ta );
  undo_position++;

  if ( undo.size() > max_undo ) {
    undo.remove( 0 );
    undo_position--;
  }
}
 
开发者ID:pentaho,项目名称:pentaho-kettle,代码行数:42,代码来源:AbstractMeta.java


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