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


Java SelectBox类代码示例

本文整理汇总了Java中com.badlogic.gdx.scenes.scene2d.ui.SelectBox的典型用法代码示例。如果您正苦于以下问题:Java SelectBox类的具体用法?Java SelectBox怎么用?Java SelectBox使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


SelectBox类属于com.badlogic.gdx.scenes.scene2d.ui包,在下文中一共展示了SelectBox类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getActor

import com.badlogic.gdx.scenes.scene2d.ui.SelectBox; //导入依赖的package包/类
@Override
public Actor getActor(VisualSettingManager visualSettingManager) {
	final SelectBox<String> selectBox = new SelectBox<String>(visualSettingManager.getSkin());
	selectBox.setItems(options);
	selectBox.setSelected(selected);
	selectBox.addListener(new EventListener() {
		@Override
		public boolean handle(Event event) {
			if (!(event instanceof SettingsMenu.SaveEvent))
				return false;
			set(selectBox.getSelected());
			return true;
		}
	});
	return selectBox;
}
 
开发者ID:RedTroop,项目名称:Cubes_2,代码行数:17,代码来源:DropDownSetting.java

示例2: createDropdown

import com.badlogic.gdx.scenes.scene2d.ui.SelectBox; //导入依赖的package包/类
private void createDropdown() {
    final float screenWidth = Gdx.graphics.getWidth();
    final float screenHeight = Gdx.graphics.getHeight();

    final SelectBox<String> dropdown = new SelectBox<String>(skin);
    dropdown.setSize(screenWidth, screenHeight / 10);
    dropdown.setPosition(0, screenHeight - dropdown.getHeight());

    dropdown.addListener(new ChangeListener() {
        @Override
        public void changed(ChangeEvent event, Actor actor) {
            inputListener.setSelectedEffectType(dropdown.getSelected());
        }
    });

    // Load dropdown.
    Array<String> effectTypes = ParticleEffectManager.getInstance().getParticleEffectTypes();
    dropdown.setItems(effectTypes);
    dropdown.getStyle().font = font;

    stage.addActor(dropdown);
}
 
开发者ID:alexschimpf,项目名称:joe,代码行数:23,代码来源:ParticleEffectViewer.java

示例3: stylePropertyChanged

import com.badlogic.gdx.scenes.scene2d.ui.SelectBox; //导入依赖的package包/类
@Override
public void stylePropertyChanged(StyleProperty styleProperty,
        Actor styleActor) {
    if (styleProperty.type == Drawable.class) {
        dialogFactory.showDialogDrawables(styleProperty);
    } else if (styleProperty.type == Color.class) {
        dialogFactory.showDialogColors(styleProperty);
    } else if (styleProperty.type == BitmapFont.class) {
        dialogFactory.showDialogFonts(styleProperty);
    } else if (styleProperty.type == Float.TYPE) {
        main.getUndoableManager().addUndoable(new UndoableManager.DoubleUndoable(main, styleProperty, ((Spinner) styleActor).getValue()), false);
    } else if (styleProperty.type == ScrollPaneStyle.class) {
        main.getUndoableManager().addUndoable(new UndoableManager.SelectBoxUndoable(root, styleProperty, (SelectBox) styleActor), true);
    } else if (styleProperty.type == LabelStyle.class) {
        main.getUndoableManager().addUndoable(new UndoableManager.SelectBoxUndoable(root, styleProperty, (SelectBox) styleActor), true);
    } else if (styleProperty.type == ListStyle.class) {
        main.getUndoableManager().addUndoable(new UndoableManager.SelectBoxUndoable(root, styleProperty, (SelectBox) styleActor), true);
    }
}
 
开发者ID:raeleus,项目名称:skin-composer,代码行数:20,代码来源:MainListener.java

示例4: GraphicsOptions

import com.badlogic.gdx.scenes.scene2d.ui.SelectBox; //导入依赖的package包/类
public GraphicsOptions (Skin skin) {
	setName("Graphics");
	resolutionSelectBox = new SelectBox<String>(skin);
	resolutionSelectBox.setItems(GameConfig.SUPPORTED_RESOLUTIONS);
	resolutionSelectBox.setSelected(OrionPrefs.getString(StringValue.GRAPHICS_RESOLUTION));

	fullscreenCheckBox = new CheckBox("Fullscreen", skin);
	fullscreenCheckBox.setChecked(OrionPrefs.getBoolean(BooleanValue.GRAPHICS_FULLSCREEN));

	TextButton applyButton = new TextButton("Apply", skin);
	applyButton.addListener(new ChangeListener() {

		@Override
		public void changed (ChangeEvent event, Actor actor) {
			OrionPrefs.putBoolean(BooleanValue.GRAPHICS_FULLSCREEN, fullscreenCheckBox.isChecked());
			OrionPrefs.putString(StringValue.GRAPHICS_RESOLUTION, resolutionSelectBox.getSelected());
			GameManager.refreshDisplayMode();
		}
	});

	add(resolutionSelectBox);
	row();
	add(fullscreenCheckBox);
	row();
	add(applyButton);
}
 
开发者ID:libgdx-jam,项目名称:GDXJam,代码行数:27,代码来源:OptionsDialog.java

示例5: PlacedArtifactTable

import com.badlogic.gdx.scenes.scene2d.ui.SelectBox; //导入依赖的package包/类
public PlacedArtifactTable() {
	setBackground(Styles.NINE_PATCH_POPUP_BG_01);

	selectBox = new SelectBox<ArtifactDefinitions.ConcreteArtifactType>(Styles.UI_SKIN);
	selectBox.setItems(ArtifactDefinitions.ConcreteArtifactType.values());
	add(selectBox);

	addButton = new TextButton("add artifact", Styles.UI_SKIN);
	add(addButton);
	row();

	artifactContent = new Table();
	scrollPane = new ScrollPane(artifactContent);
	scrollPane.setFadeScrollBars(false);
	add(scrollPane).colspan(2).height(200);

	pack();
}
 
开发者ID:aphex-,项目名称:Alien-Ark,代码行数:19,代码来源:PlacedArtifactTable.java

示例6: process

import com.badlogic.gdx.scenes.scene2d.ui.SelectBox; //导入依赖的package包/类
@Override
public void process(final LmlParser parser, final LmlTag tag, final SelectBox<?> actor,
        final String rawAttributeData) {
    LmlUtilities.getLmlUserObject(actor).addOnCloseAction(new ActorConsumer<Object, Object>() {
        @Override
        @SuppressWarnings("unchecked")
        public Object consume(final Object widget) {
            try {
                actor.setSelectedIndex(parser.parseInt(rawAttributeData, actor));
            } catch (final Exception exception) {
                Exceptions.ignore(exception); // Possible number format exception. Trying to select string.
                ((SelectBox<String>) actor).setSelected(parser.parseString(rawAttributeData, actor));
            }
            return null;
        }
    });
}
 
开发者ID:czyzby,项目名称:gdx-lml,代码行数:18,代码来源:SelectBoxSelectedLmlAttribute.java

示例7: createUI

import com.badlogic.gdx.scenes.scene2d.ui.SelectBox; //导入依赖的package包/类
private void createUI () {
	skin = new Skin(Gdx.files.internal("data/uiskin.json"));
	ui = new Stage();

	String[] filters = new String[TextureFilter.values().length];
	int idx = 0;
	for (TextureFilter filter : TextureFilter.values()) {
		filters[idx++] = filter.toString();
	}
	hwMipMap = new CheckBox("Hardware Mips", skin);
	minFilter = new SelectBox(skin);
	minFilter.setItems(filters);
	magFilter = new SelectBox(skin.get(SelectBoxStyle.class));
	magFilter.setItems("Nearest", "Linear");

	Table table = new Table();
	table.setSize(ui.getWidth(), 30);
	table.setY(ui.getHeight() - 30);
	table.add(hwMipMap).spaceRight(5);
	table.add(new Label("Min Filter", skin)).spaceRight(5);
	table.add(minFilter).spaceRight(5);
	table.add(new Label("Mag Filter", skin)).spaceRight(5);
	table.add(magFilter);

	ui.addActor(table);
}
 
开发者ID:basherone,项目名称:libgdxcn,代码行数:27,代码来源:MipMapTest.java

示例8: LoginActor

import com.badlogic.gdx.scenes.scene2d.ui.SelectBox; //导入依赖的package包/类
public LoginActor(Skin skin) {
	super(skin);
	login = new Login();
	
	Window loginWindow = new TWindow("", skin, "window2");
	Label teacherName = new Label("Lehrer", skin);
	teachersSelectBox = new SelectBox<String>(skin);
	TextButton loginButton = new TextButton("Start", skin, "defaultBig");

	setPosition(AppMain.WIDTH / 2, 225);
	
	loginWindow.add(teacherName).row();
	loginWindow.add(teachersSelectBox).width(175).row();
	loginWindow.add(loginButton).width(175).height(100).colspan(2).padTop(40);
	add(loginWindow);
	
	loginButton.addListener(new ChangeListener() {
		public void changed (ChangeEvent event, Actor actor) {
			AppMain.user.login(teachersSelectBox.getSelected());
		}
	});
}
 
开发者ID:javosuher,项目名称:Terminkalender,代码行数:23,代码来源:LoginActor.java

示例9: sendTaskData

import com.badlogic.gdx.scenes.scene2d.ui.SelectBox; //导入依赖的package包/类
private void sendTaskData() {
	String location = locationText.getText();
	if(location.contains(AppWebSockets.POINTSPLIT) || location.contains(AppWebSockets.DATASPLIT) || 
	   location.contains(AppWebSockets.TASKSPLIT)) {
		Resources.warningDialog.show("you musn't use ',', ';', or ':'", getStage());
		cancelTask();
	}
	else {
		task.setLocation(locationText.getText());
		int numberPartners = partnertsboxes.size;
		task.clearPartners();
		for(int index = 0; index < numberPartners; ++index) {
			SelectBox<String> partnertsBox = partnertsboxes.get(index);
			task.addPartner(partnertsBox.getSelected());
		}
		if(task.getWhatArray().size > 0) {
			task.setWhat(whatBox.getSelected());
		}
		if(task.getWhereArray().size > 0) {
			task.setWhere(whereBox.getSelected());
		}
		task.addDataServer();
	}
}
 
开发者ID:javosuher,项目名称:Terminkalender,代码行数:25,代码来源:SetTaskInCalendarDialog.java

示例10: addSelectBox

import com.badlogic.gdx.scenes.scene2d.ui.SelectBox; //导入依赖的package包/类
public <E> void addSelectBox(String label, E selected, E[] values, Consumer<E> lis) {
  LabelStyle style = skin.get(LabelStyle.class);
  Label l = new Label(label, style);
  table.add(l).minHeight(l.getMinHeight()).prefHeight(l.getPrefHeight());

  SelectBox<E> sb = new SelectBox<E>(skin.get(SelectBoxStyle.class));
  sb.setItems(values);
  sb.setSelected(selected);
  sb.addListener(new ChangeListener() {
    @Override
    public void changed(ChangeEvent event, Actor actor) {
      lis.accept(sb.getSelected());
    }
  });
  Cell<SelectBox<E>> right = table.add(sb).minHeight(sb.getMinHeight()).prefHeight(sb.getMinHeight());
  if (nbColumns > 2)
    right.colspan(nbColumns - 1);

  table.row();
}
 
开发者ID:guillaume-alvarez,项目名称:ShapeOfThingsThatWere,代码行数:21,代码来源:FramedMenu.java

示例11: addBooleanSelectBox

import com.badlogic.gdx.scenes.scene2d.ui.SelectBox; //导入依赖的package包/类
public void addBooleanSelectBox(String label, boolean selected, Consumer<Boolean> lis) {
  LabelStyle style = skin.get(LabelStyle.class);
  Label l = new Label(label, style);
  table.add(l).minHeight(l.getMinHeight()).prefHeight(l.getPrefHeight());

  SelectBox<Boolean> sb = new SelectBox<Boolean>(skin.get(SelectBoxStyle.class));
  sb.setItems(Boolean.TRUE, Boolean.FALSE);
  sb.setSelected(selected);
  sb.addListener(new ChangeListener() {
    @Override
    public void changed(ChangeEvent event, Actor actor) {
      lis.accept(sb.getSelected());
    }
  });
  Cell<SelectBox<Boolean>> right = table.add(sb).minHeight(sb.getMinHeight()).prefHeight(sb.getMinHeight());
  if (nbColumns > 2)
    right.colspan(nbColumns - 1);

  table.row();
}
 
开发者ID:guillaume-alvarez,项目名称:ShapeOfThingsThatWere,代码行数:21,代码来源:FramedMenu.java

示例12: doClick

import com.badlogic.gdx.scenes.scene2d.ui.SelectBox; //导入依赖的package包/类
public static void doClick(Actor actor){
	addField.remove();
	Frame.actorPanel.lock();
	Frame.propertyPanel.clear();
	Frame.effectPanel.clear();
	Frame.eventPanel.clear();
	selectedActor = actor;
	Scene.getCurrentScene().outline(actor);
	Frame.actorPanel.list.setSelectedIndex(Frame.actorPanel.indexOf(actor.getName()));
	StatusBar.updateSelected(actor.getName());
	Frame.dashPanel.update();
	Frame.propertyPanel.update();
	Frame.effectPanel.update();
	Frame.eventPanel.update();
	Frame.actorPanel.unlock();
	if(selectedActor instanceof List || selectedActor instanceof SelectBox){
		addField.setPosition(actor.getX(), actor.getY() - addField.getHeight());
		Scene.getRoot().addActor(addField);
	}
}
 
开发者ID:pyros2097,项目名称:GdxStudio,代码行数:21,代码来源:SceneEditor.java

示例13: setup

import com.badlogic.gdx.scenes.scene2d.ui.SelectBox; //导入依赖的package包/类
public static void setup(){
	registerSerializer(Actor.class, new ActorSerializer());
	registerSerializer(Scene.class, new SceneSerializer());
	registerSerializer(ImageJson.class, new ImageJson());
	registerSerializer(Label.class, new LabelSerializer());
	registerSerializer(Button.class, new ButtonSerializer());
	registerSerializer(TextButton.class, new TextButtonSerializer());
	registerSerializer(Table.class, new TableSerializer());
	registerSerializer(CheckBox.class, new CheckBoxSerializer());
	registerSerializer(SelectBox.class, new SelectBoxSerializer());
	registerSerializer(List.class, new ListSerializer());
	registerSerializer(Slider.class, new SliderSerializer());
	registerSerializer(TextField.class, new TextFieldSerializer());
	registerSerializer(Touchpad.class, new TouchpadSerializer());
	registerSerializer(Sprite.class, new SpriteSerializer());
	
	registerSerializer(Dialog.class, new DialogSerializer());
	registerSerializer(SplitPane.class, new SplitPaneSerializer());
	registerSerializer(ScrollPane.class, new ScrollPaneSerializer());
	registerSerializer(Stack.class, new StackSerializer());
	registerSerializer(Tree.class, new TreeSerializer());
	registerSerializer(Table.class, new TableSerializer());
	registerSerializer(ButtonGroup.class, new ButtonGroupSerializer());
	registerSerializer(HorizontalGroup.class, new HorizontalGroupSerializer());
	registerSerializer(VerticalGroup.class, new VerticalGroupSerializer());
}
 
开发者ID:pyros2097,项目名称:GdxStudio,代码行数:27,代码来源:Serializer.java

示例14: fillAnimations

import com.badlogic.gdx.scenes.scene2d.ui.SelectBox; //导入依赖的package包/类
private void fillAnimations() {
	@SuppressWarnings("unchecked")
	SelectBox<String> cb = (SelectBox<String>) id.getField();
	cb.clearItems();

	// When creating, give option to add all elements
	if (e == null)
		cb.getItems().add("<ADD ALL>");

	String ids[] = spriteWidget.getAnimations();
	for (String s : ids)
		cb.getItems().add(s);

	cb.getList().setItems(cb.getItems());
	if (cb.getItems().size > 0)
		cb.setSelectedIndex(0);

	cb.invalidateHierarchy();

	setAnimation();
}
 
开发者ID:bladecoder,项目名称:bladecoder-adventure-engine,代码行数:22,代码来源:EditAnimationDialog.java

示例15: ok

import com.badlogic.gdx.scenes.scene2d.ui.SelectBox; //导入依赖的package包/类
/**
 * Override to append all animations if selected.
 */
@Override
protected void ok() {
	@SuppressWarnings("unchecked")
	SelectBox<String> cb = (SelectBox<String>) id.getField();

	if (e == null && cb.getSelectedIndex() == 0) {
		for (int i = 1; i < cb.getItems().size; i++) {
			cb.setSelectedIndex(i);
			inputsToModel(true);
			// doc.setId(e, cb.getItems().get(i));

			if (listener != null)
				listener.changed(new ChangeEvent(), this);
		}

	} else {
		super.ok();
	}
}
 
开发者ID:bladecoder,项目名称:bladecoder-adventure-engine,代码行数:23,代码来源:EditAnimationDialog.java


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