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


Java SequenceCommand类代码示例

本文整理汇总了Java中org.openstreetmap.josm.command.SequenceCommand的典型用法代码示例。如果您正苦于以下问题:Java SequenceCommand类的具体用法?Java SequenceCommand怎么用?Java SequenceCommand使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: performCustomizing

import org.openstreetmap.josm.command.SequenceCommand; //导入依赖的package包/类
/**
 * Construct and executing command list for customizing of stop area relation and its members
 * @param stopArea Stop area object
 * @return Stop area object
 */
@Override
public StopArea performCustomizing(StopArea stopArea) 
{
	List<Command> commands = customize(stopArea);
	if(commands != null && !commands.isEmpty())
		try
		{
			Main.main.undoRedo.add(new SequenceCommand(tr(TAG_ASSIGN_COMMAND_NAME), commands));
			return stopArea;
		}
		catch(Exception ex)
		{
		}
	return stopArea;
}
 
开发者ID:bwr57,项目名称:CustomizePublicTransportStop,代码行数:21,代码来源:CustomizeStopAreaOperation.java

示例2: actionPerformed

import org.openstreetmap.josm.command.SequenceCommand; //导入依赖的package包/类
@Override
public void actionPerformed(ActionEvent e) {
    if (!isEnabled())
        return;
    final Collection<Command> commands = new LinkedList<>();
    final Collection<OsmPrimitive> sel = getLayerManager().getEditDataSet().getSelected();
    try {
        for (OsmPrimitive p : sel) {
            if (!(p instanceof Node)) throw new InvalidUserInputException("selected object is not a node");
            Node n = (Node) p;
            if (rememberMovements.containsKey(n)) {
                EastNorth tmp = rememberMovements.get(n);
                commands.add(new MoveCommand(n, -tmp.east(), -tmp.north()));
                rememberMovements.remove(n);
            }
        }
        if (!commands.isEmpty()) {
            Main.main.undoRedo.add(new SequenceCommand(tr("Orthogonalize / Undo"), commands));
        } else {
            throw new InvalidUserInputException("Commands are empty");
        }
    } catch (InvalidUserInputException ex) {
        Main.debug(ex);
        new Notification(
                tr("Orthogonalize Shape / Undo<br>"+
                "Please select nodes that were moved by the previous Orthogonalize Shape action!"))
                .setIcon(JOptionPane.INFORMATION_MESSAGE)
                .show();
    }
}
 
开发者ID:stefanocudini,项目名称:orthogonalize-js,代码行数:31,代码来源:OrthogonalizeAction.josm.java

示例3: createTerracingCommand

import org.openstreetmap.josm.command.SequenceCommand; //导入依赖的package包/类
private Command createTerracingCommand(final Way outline) {
    return new SequenceCommand(tr("Terrace"), commands) {
        @Override
        public boolean executeCommand() {
            boolean result = super.executeCommand();
            if (result && tagsInConflict != null) {
                try {
                    // Build conflicts commands only after all primitives have been added to dataset to fix #8942
                    List<Command> conflictCommands = CombinePrimitiveResolverDialog.launchIfNecessary(
                            tagsInConflict, primitives, Collections.singleton(outline));
                    if (!conflictCommands.isEmpty()) {
                        List<Command> newCommands = new ArrayList<>(commands);
                        newCommands.addAll(conflictCommands);
                        setSequence(newCommands.toArray(new Command[0]));
                        // Run conflicts commands
                        for (int i = 0; i < conflictCommands.size(); i++) {
                            result = conflictCommands.get(i).executeCommand();
                            if (!result && !continueOnError) {
                                setSequenceComplete(false);
                                undoCommands(commands.size()+i-1);
                                return false;
                            }
                        }
                    }
                } catch (UserCancelException e) {
                    // Ignore
                }
            }
            return result;
        }
    };
}
 
开发者ID:derickr,项目名称:josm-plugin-uberterrace,代码行数:33,代码来源:TerracerAction.java

示例4: commitCommands

import org.openstreetmap.josm.command.SequenceCommand; //导入依赖的package包/类
private static void commitCommands(String sequenceName, Collection<Command> commands) {
    if (!commands.isEmpty()) {
        Main.main.undoRedo.add(new SequenceCommand(sequenceName, commands));
        MainApplication.getMap().repaint(); // FIXME avoid complete repaint
    }
}
 
开发者ID:JOSM,项目名称:ShapeTools,代码行数:7,代码来源:ShapeMath.java


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