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


Java LaunchButton.setAttribute方法代码示例

本文整理汇总了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));
}
 
开发者ID:ajmath,项目名称:VASSAL-src,代码行数:23,代码来源:GlobalMap.java

示例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"));
}
 
开发者ID:ajmath,项目名称:VASSAL-src,代码行数:20,代码来源:ChartWindow.java

示例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);
}
 
开发者ID:ajmath,项目名称:VASSAL-src,代码行数:20,代码来源:DoActionButton.java

示例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);
}
 
开发者ID:ajmath,项目名称:VASSAL-src,代码行数:18,代码来源:SpecialDiceButton.java

示例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);
}
 
开发者ID:ajmath,项目名称:VASSAL-src,代码行数:18,代码来源:NotesWindow.java

示例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);
}
 
开发者ID:ajmath,项目名称:VASSAL-src,代码行数:16,代码来源:ImageSaver.java

示例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");
}
 
开发者ID:ajmath,项目名称:VASSAL-src,代码行数:12,代码来源:TextSaver.java

示例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);
}
 
开发者ID:ajmath,项目名称:VASSAL-src,代码行数:11,代码来源:HidePiecesButton.java


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