本文整理汇总了Java中org.pentaho.di.core.undo.TransAction.setNextAlso方法的典型用法代码示例。如果您正苦于以下问题:Java TransAction.setNextAlso方法的具体用法?Java TransAction.setNextAlso怎么用?Java TransAction.setNextAlso使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.pentaho.di.core.undo.TransAction
的用法示例。
在下文中一共展示了TransAction.setNextAlso方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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--;
}
}
示例2: 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--;
}
}