本文整理汇总了Java中de.lessvoid.nifty.controls.DropDown类的典型用法代码示例。如果您正苦于以下问题:Java DropDown类的具体用法?Java DropDown怎么用?Java DropDown使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
DropDown类属于de.lessvoid.nifty.controls包,在下文中一共展示了DropDown类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: onStartScreen
import de.lessvoid.nifty.controls.DropDown; //导入依赖的package包/类
@Override
public void onStartScreen() {
joysticks = inputManager.getJoysticks();
hasJoysticks = joysticks != null && joysticks.length > 0;
if (hasJoysticks) {
DropDown<String> joystickElement = screen.findNiftyControl("joystickControl", DropDown.class);
int activeElement = 0; //we will default to first element if it is not set in options
for (int i = 0; i < joysticks.length; i++) {
joystickElement.addItem(joysticks[i].getName());
if (options.getJoyId().orElse(-1) == joysticks[i].getJoyId()) {
activeElement = i;
}
}
joystickElement.selectItemByIndex(activeElement);
}
}
开发者ID:ZoltanTheHun,项目名称:SkyHussars,代码行数:17,代码来源:OptionsMenu.java
示例2: showSettingsPopup
import de.lessvoid.nifty.controls.DropDown; //导入依赖的package包/类
@SuppressWarnings("unchecked")
public void showSettingsPopup() {
popupSettings = nifty.createPopup("popupSettings");
// build the dropdown for resolutions
DropDown<ResolutionEntry> dropdown = popupSettings.findNiftyControl("popupSettings_dropdownResolution", DropDown.class);
dropdown.addItem(new ResolutionEntry(640, 480));
dropdown.addItem(new ResolutionEntry(800, 600));
dropdown.addItem(new ResolutionEntry(1024, 768));
dropdown.addItem(new ResolutionEntry(1280, 960));
dropdown.addItem(new ResolutionEntry(1280, 1024));
dropdown.addItem(new ResolutionEntry(1280, 720));
dropdown.addItem(new ResolutionEntry(1280, 800));
dropdown.addItem(new ResolutionEntry(1680, 1050));
dropdown.addItem(new ResolutionEntry(1920, 1080));
dropdown.addItem(new ResolutionEntry(1920, 1200));
nifty.showPopup(screen, popupSettings.getId(), null);
}
开发者ID:AMPBEdu,项目名称:gjOryx,代码行数:20,代码来源:LoginScreen.java
示例3: populateTimeControl
import de.lessvoid.nifty.controls.DropDown; //导入依赖的package包/类
private void populateTimeControl() {
DropDown<String> timeControl = screen.findNiftyControl("timeControl", DropDown.class);
timeControl.clear();
timeControl.addItem("Now");
for (int i = 0; i < 24; i++) {
timeControl.addItem((i < 10 ? "0" + i : i) + ":00");
}
timeControl.selectItemByIndex(0);
}
开发者ID:ZoltanTheHun,项目名称:SkyHussars,代码行数:10,代码来源:SingleMissionMenu.java
示例4: populateEnemyCount
import de.lessvoid.nifty.controls.DropDown; //导入依赖的package包/类
private void populateEnemyCount() {
DropDown<String> enemyCountBtn = screen.findNiftyControl("enemyCount", DropDown.class);
enemyCountBtn.clear();
for (int i = 0; i < 251; i++) {
enemyCountBtn.addItem("" + i);
}
enemyCountBtn.selectItemByIndex(0);
}
开发者ID:ZoltanTheHun,项目名称:SkyHussars,代码行数:9,代码来源:SingleMissionMenu.java
示例5: setJoystick
import de.lessvoid.nifty.controls.DropDown; //导入依赖的package包/类
private void setJoystick() {
if (hasJoysticks) {
DropDown<String> joystickElement = screen.findNiftyControl("joystickControl", DropDown.class);
options.setJoyId(Optional.of(joysticks[joystickElement.getSelectedIndex()].getJoyId()));
optionsManager.persistOptions(options);
}
}
开发者ID:ZoltanTheHun,项目名称:SkyHussars,代码行数:8,代码来源:OptionsMenu.java
示例6: bind
import de.lessvoid.nifty.controls.DropDown; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void bind(Nifty nifty, Screen screen) {
window = screen.findNiftyControl("wdObjects", Window.class);
ddXml = screen.findNiftyControl("ddXml", DropDown.class);
ddPresetObject = screen.findNiftyControl("ddPresetObject", DropDown.class);
nifty.subscribeAnnotations(this);
String defaultFname = MainApp.DEFAULT_TABLESETUP_FNAME;
int n = defaultFname.lastIndexOf('/');
dirName = defaultFname.substring(0, n);
refreshDdXml(defaultFname.substring(n + 1));
ddPresetObject.addAllItems(Arrays.asList(PRESET_OBJECTS));
}
开发者ID:dwhuang,项目名称:SMILE,代码行数:16,代码来源:ObjectsWindowController.java
示例7: bind
import de.lessvoid.nifty.controls.DropDown; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void bind(Nifty nifty, Screen screen) {
window = screen.findNiftyControl("wdRobot", Window.class);
ddRobotJoint = screen.findNiftyControl("ddRobotJoint", DropDown.class);
for (String s : ROBOT_JOINTS) {
ddRobotJoint.addItem(s);
}
ddRobotJointInd = ddRobotJoint.getSelectedIndex();
nifty.subscribeAnnotations(this);
}
开发者ID:dwhuang,项目名称:SMILE,代码行数:14,代码来源:RobotWindowController.java
示例8: fillDropDown
import de.lessvoid.nifty.controls.DropDown; //导入依赖的package包/类
protected void fillDropDown(String id, List<String> strings, int index){
DropDown dd = guiCtrl.getControl(id, DropDown.class);
dd.disable();
dd.clear();
dd.addAllItems(strings);
dd.selectItemByIndex(index);
dd.enable();
}
开发者ID:methusalah,项目名称:OpenRTS,代码行数:9,代码来源:GUIDrawer.java
示例9: populatePlaneSelect
import de.lessvoid.nifty.controls.DropDown; //导入依赖的package包/类
private void populatePlaneSelect() {
DropDown<String> planeSelect = screen.findNiftyControl("planeSelect", DropDown.class);
planeSelect.clear();
planeRegistry.availablePlanes().forEach(planeName -> planeSelect.addItem(planeName));
planeSelect.selectItemByIndex(0);
}
开发者ID:ZoltanTheHun,项目名称:SkyHussars,代码行数:7,代码来源:SingleMissionMenu.java
示例10: findDropDownControl
import de.lessvoid.nifty.controls.DropDown; //导入依赖的package包/类
private DropDown findDropDownControl(final String id) {
return screen.findNiftyControl(id, DropDown.class);
}
开发者ID:utsav2601,项目名称:MinionVsAlien-3D-game,代码行数:4,代码来源:GuiAppState.java
注:本文中的de.lessvoid.nifty.controls.DropDown类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论