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


Java MiniMapToggleViewAction类代码示例

本文整理汇总了Java中net.sf.freecol.client.gui.action.MiniMapToggleViewAction的典型用法代码示例。如果您正苦于以下问题:Java MiniMapToggleViewAction类的具体用法?Java MiniMapToggleViewAction怎么用?Java MiniMapToggleViewAction使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: MapControls

import net.sf.freecol.client.gui.action.MiniMapToggleViewAction; //导入依赖的package包/类
/**
 * The basic constructor.
 *
 * @param freeColClient The {@code FreeColClient} for the game.
 * @param useSkin Use a skin or not in the info panel.
 */
protected MapControls(final FreeColClient freeColClient, boolean useSkin) {
    super(freeColClient);

    infoPanel = new InfoPanel(getFreeColClient(), useSkin);
    miniMap = new MiniMap(getFreeColClient());
    final ActionManager am = getFreeColClient().getActionManager();
    unitButtons = new ArrayList<>();

    final Game game = getGame();
    if (game != null) {
        unitButtons.add(new UnitButton(am, WaitAction.id));
        unitButtons.add(new UnitButton(am, SkipUnitAction.id));
        unitButtons.add(new UnitButton(am, SentryAction.id));
        unitButtons.add(new UnitButton(am, FortifyAction.id));
        
        final Specification spec = game.getSpecification();
        if (spec != null) {
            for (TileImprovementType type : spec.getTileImprovementTypeList()) {
                FreeColAction action = am.getFreeColAction(type.getSuffix()
                                                           + "Action");
                if (!type.isNatural() && action != null
                    && action.hasOrderButtons()) {
                    unitButtons.add(new UnitButton(am, type.getSuffix() + "Action"));
                }
            }
        }
        unitButtons.add(new UnitButton(am, BuildColonyAction.id));
        unitButtons.add(new UnitButton(am, DisbandUnitAction.id));
    }
    miniMapToggleBorders = new UnitButton(am, MiniMapToggleViewAction.id);
    miniMapToggleFogOfWarButton = new UnitButton(am, MiniMapToggleFogOfWarAction.id);
    miniMapZoomOutButton = new UnitButton(am, MiniMapZoomOutAction.id);
    miniMapZoomInButton = new UnitButton(am, MiniMapZoomInAction.id);

    miniMapToggleBorders.setFocusable(false);
    miniMapToggleFogOfWarButton.setFocusable(false);
    miniMapZoomOutButton.setFocusable(false);
    miniMapZoomInButton.setFocusable(false);

    //
    // Don't allow them to gain focus
    //
    infoPanel.setFocusable(false);

    for (UnitButton button : unitButtons) {
        button.setFocusable(false);
    }
}
 
开发者ID:FreeCol,项目名称:freecol,代码行数:55,代码来源:MapControls.java


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