本文整理汇总了Java中VASSAL.tools.LaunchButton.setAttribute方法的典型用法代码示例。如果您正苦于以下问题:Java LaunchButton.setAttribute方法的具体用法?Java LaunchButton.setAttribute怎么用?Java LaunchButton.setAttribute使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类VASSAL.tools.LaunchButton
的用法示例。
在下文中一共展示了LaunchButton.setAttribute方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: 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);
}
示例7: 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");
}
示例8: 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);
}