本文整理汇总了Java中VASSAL.tools.LaunchButton类的典型用法代码示例。如果您正苦于以下问题:Java LaunchButton类的具体用法?Java LaunchButton怎么用?Java LaunchButton使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
LaunchButton类属于VASSAL.tools包,在下文中一共展示了LaunchButton类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: GlobalMap
import VASSAL.tools.LaunchButton; //导入依赖的package包/类
public GlobalMap() {
view = new View();
view.addMouseListener(view);
scroll = new GlobalMapScrollPane(view);
scroll.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.RAISED));
scroll.setAlignmentX(0.0f);
scroll.setAlignmentY(0.0f);
ActionListener al = new ActionListener() {
public void actionPerformed(ActionEvent e) {
scroll.setVisible(!scroll.isVisible());
}
};
launch = new LaunchButton(null, TOOLTIP, BUTTON_TEXT,
HOTKEY, ICON_NAME, al);
launch.setAttribute(TOOLTIP, "Show/Hide overview window");
launch.setAttribute(HOTKEY,
NamedKeyStroke.getNamedKeyStroke(KeyEvent.VK_O,
KeyEvent.CTRL_MASK + KeyEvent.SHIFT_MASK));
}
示例2: ChartWindow
import VASSAL.tools.LaunchButton; //导入依赖的package包/类
public ChartWindow() {
root = new JPanel();
ActionListener al = new ActionListener() {
boolean initialized;
public void actionPerformed(ActionEvent e) {
if (!initialized) {
String key = PositionOption.key + id;
GameModule.getGameModule().getPrefs().addOption(new PositionOption(key, frame));
initialized = true;
}
frame.setVisible(!frame.isVisible());
}
};
launch = new LaunchButton(null, TOOLTIP, BUTTON_TEXT, HOTKEY, ICON, al);
setAttribute(NAME, Resources.getString("Editor.ChartWindow.component_type"));
setAttribute(BUTTON_TEXT, Resources.getString("Editor.ChartWindow.component_type"));
launch.setAttribute(TOOLTIP, Resources.getString("Editor.ChartWindow.component_type"));
}
示例3: DoActionButton
import VASSAL.tools.LaunchButton; //导入依赖的package包/类
public DoActionButton() {
ActionListener rollAction = new ActionListener() {
public void actionPerformed(ActionEvent e) {
try {
doActions();
}
catch (RecursionLimitException ex) {
RecursionLimiter.infiniteLoop(ex);
}
}
};
final String description = Resources.getString("Editor.DoAction.component_type"); //$NON-NLS-1$
launch = new LaunchButton(
description, TOOLTIP, BUTTON_TEXT, HOTKEY, ICON, rollAction);
setAttribute(NAME, description);
setAttribute(TOOLTIP, description);
launch.setAttribute(BUTTON_TEXT, description);
}
示例4: SpecialDiceButton
import VASSAL.tools.LaunchButton; //导入依赖的package包/类
public SpecialDiceButton() {
dialog = new JDialog(GameModule.getGameModule().getFrame());
dialog.setLayout(new MigLayout("ins 0"));
dialogLabel = new JLabel();
dialogLabel.setIcon(resultsIcon);
dialog.add(dialogLabel);
final ActionListener rollAction = new ActionListener() {
public void actionPerformed(ActionEvent e) {
DR();
}
};
launch = new LaunchButton(null, TOOLTIP, BUTTON_TEXT, HOTKEY, ICON, rollAction);
final String desc = Resources.getString("Editor.SpecialDiceButton.symbols"); //$NON-NLS-1$
setAttribute(NAME, desc);
setAttribute(BUTTON_TEXT, desc);
launch.setAttribute(TOOLTIP, desc);
}
示例5: NotesWindow
import VASSAL.tools.LaunchButton; //导入依赖的package包/类
public NotesWindow() {
privateNotes = new PrivateNotesController();
secretNotes = new SecretNotesController();
frame = new NotesDialog();
frame.setTitle(Resources.getString("Notes.notes")); //$NON-NLS-1$
ActionListener al = new ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
captureState();
frame.setVisible(!frame.isShowing());
}
};
launch = new LaunchButton(Resources.getString("Notes.notes"), TOOLTIP, BUTTON_TEXT, HOT_KEY, ICON, al); //$NON-NLS-1$
launch.setAttribute(ICON, "/images/notes.gif"); //$NON-NLS-1$
launch.setToolTipText(Resources.getString("Notes.notes")); //$NON-NLS-1$
frame.pack();
setup(false);
}
示例6: ToolbarMenu
import VASSAL.tools.LaunchButton; //导入依赖的package包/类
public ToolbarMenu() {
launch = new LaunchButton(Resources.getString(Resources.MENU), TOOLTIP, BUTTON_TEXT, BUTTON_HOTKEY, BUTTON_ICON, new ActionListener() {
public void actionPerformed(ActionEvent e) {
launch();
}
});
menu = new JPopupMenu();
launch.putClientProperty(MENU_PROPERTY, menu);
launch.setToolTipText("Display Menu Options");
GameModule.getGameModule().getGameState().addGameComponent(this);
}
示例7: PlayerRoster
import VASSAL.tools.LaunchButton; //导入依赖的package包/类
public PlayerRoster() {
ActionListener al = new ActionListener() {
public void actionPerformed(ActionEvent e) {
launch();
}
};
retireButton = new LaunchButton(Resources.getString("PlayerRoster.retire"), TOOL_TIP, BUTTON_TEXT, null, BUTTON_ICON, al); //$NON-NLS-1$
retireButton.setToolTipText(Resources.getString("PlayerRoster.allow_another")); //$NON-NLS-1$
retireButton.setVisible(false);
translatedObserver = Resources.getString("PlayerRoster.observer"); //$NON-NLS-1$
}
示例8: ImageSaver
import VASSAL.tools.LaunchButton; //导入依赖的package包/类
public ImageSaver() {
final ActionListener al = new ActionListener() {
public void actionPerformed(ActionEvent e) {
writeMapAsImage();
}
};
launch =
new LaunchButton(null, TOOLTIP, BUTTON_TEXT, HOTKEY, ICON_NAME, al);
// Set defaults for backward compatibility
launch.setAttribute(TOOLTIP, "Save Map as PNG image");
launch.setAttribute(BUTTON_TEXT, "");
launch.setAttribute(ICON_NAME, DEFAULT_ICON);
}
示例9: MapShader
import VASSAL.tools.LaunchButton; //导入依赖的package包/类
public MapShader() {
ActionListener al = new ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
toggleShading();
}
};
launch = new LaunchButton("Shade", TOOLTIP, BUTTON_TEXT, HOT_KEY, ICON, al);
launch.setEnabled(false);
setLaunchButtonVisibility();
setConfigureName("Shading");
reset();
}
示例10: PieceRecenterer
import VASSAL.tools.LaunchButton; //导入依赖的package包/类
public PieceRecenterer() {
ActionListener al = new ActionListener() {
public void actionPerformed(ActionEvent e) {
GameModule.getGameModule().sendAndLog(recenter(map));
}
};
launch = new LaunchButton("Recenter",TOOLTIP,BUTTON_TEXT,HOTKEY,ICON,al);
dispatcher = new DeckVisitorDispatcher(this);
}
示例11: LayerControl
import VASSAL.tools.LaunchButton; //导入依赖的package包/类
public LayerControl() {
launch = new LaunchButton("Reset Layers", TOOLTIP, BUTTON_TEXT, BUTTON_HOTKEY, BUTTON_ICON, new ActionListener() {
public void actionPerformed(ActionEvent e) {
launch();
}
});
}
示例12: TextSaver
import VASSAL.tools.LaunchButton; //导入依赖的package包/类
public TextSaver() {
ActionListener al = new ActionListener() {
public void actionPerformed(ActionEvent e) {
apply();
}
};
launch = new LaunchButton("Save Text", TOOLTIP, BUTTON_TEXT,
HOTKEY, ICON_NAME, al);
launch.setAttribute(TOOLTIP, "Save map contents as plain text file");
}
示例13: HidePiecesButton
import VASSAL.tools.LaunchButton; //导入依赖的package包/类
public HidePiecesButton() {
ActionListener al = new ActionListener() {
public void actionPerformed(ActionEvent e) {
setPiecesVisible(!piecesVisible);
}
};
launch = new LaunchButton(null, TOOLTIP, BUTTON_TEXT, HOTKEY, LAUNCH_ICON, al);
launch.setAttribute(TOOLTIP, "Hide all pieces on this map");
addMouseListener(this);
}
示例14: MassKeyCommand
import VASSAL.tools.LaunchButton; //导入依赖的package包/类
public MassKeyCommand() {
ActionListener al = new ActionListener() {
public void actionPerformed(ActionEvent e) {
apply();
}
};
launch = new LaunchButton("CTRL", TOOLTIP, BUTTON_TEXT, HOTKEY, ICON, al);
}
示例15: PieceWindow
import VASSAL.tools.LaunchButton; //导入依赖的package包/类
public PieceWindow() {
root = new JPanel(new BorderLayout());
ActionListener al = new ActionListener() {
public void actionPerformed(ActionEvent e) {
launchButtonPressed();
}
};
launch = new LaunchButton(Resources.getString("Editor.PieceWindow.pieces"), TOOLTIP, BUTTON_TEXT, HOTKEY, ICON, al);
launch.setToolTipText(Resources.getString("Editor.PieceWindow.show_hide_pieces_window", Resources.getString("Editor.PieceWindow.pieces")));
}