• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java SequenceCommand类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ImageMetadata类代码示例发布时间:2022-05-22
下一篇:
Java DefaultRequestDirector类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap