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


Java LaunchButton类代码示例

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

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

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

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

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

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

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

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

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

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


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