本文整理汇总了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);
}
}