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


Java CheckBox类代码示例

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


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

示例1: addPieceChoice

import com.badlogic.gdx.scenes.scene2d.ui.CheckBox; //导入依赖的package包/类
private void addPieceChoice(){
    buttonTable = new Table();
    buttonTable.bottom();
    buttonTable.setFillParent(true);

    pieceChoiceGroup = new ButtonGroup<CheckBox>();
    whiteCheckBox = new CheckBox(" White", game.getSkin());
    blackCheckBox = new CheckBox(" Black", game.getSkin());
    pieceChoiceGroup.add(blackCheckBox);
    pieceChoiceGroup.add(whiteCheckBox);
    pieceChoiceGroup.setMaxCheckCount(1);
    pieceChoiceGroup.setMinCheckCount(1);
    pieceChoiceGroup.setUncheckLast(true);
    pieceChoiceGroup.setChecked("Black");

    buttonTable.add(whiteCheckBox).center().padBottom(15).row();
    buttonTable.add(blackCheckBox).center().padBottom(40).row();
}
 
开发者ID:antonioalmeida,项目名称:retro-reversi,代码行数:19,代码来源:DifficultyMenuView.java

示例2: GraphicsOptions

import com.badlogic.gdx.scenes.scene2d.ui.CheckBox; //导入依赖的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

示例3: AudioOptions

import com.badlogic.gdx.scenes.scene2d.ui.CheckBox; //导入依赖的package包/类
public AudioOptions (Skin skin) {
	setName("Audio");
	soundSlider = new Slider(0, 1, 0.05f, false, skin);
	soundSlider.setValue(OrionPrefs.getFloat(FloatValue.AUDIO_SOUND_VOLUME));
	musicSlider = new Slider(0, 1, 0.05f, false, skin);
	musicSlider.setValue(OrionPrefs.getFloat(FloatValue.AUDIO_MUSIC_VOLUME));
	
	musicCheckBox = new CheckBox("Music Enabled", skin);
	musicCheckBox.setChecked(OrionPrefs.getBoolean(BooleanValue.AUDIO_MUSIC_ENABLED));
	soundCheckBox = new CheckBox("Sound Enabled", skin);
	soundCheckBox.setChecked(OrionPrefs.getBoolean(BooleanValue.AUDIO_MUSIC_ENABLED));
	
	Table soundTable = new Table();
	soundTable.add(soundSlider);
	soundTable.add(soundCheckBox);
	
	Table musicTable = new Table();
	musicTable.add(musicSlider);
	musicTable.add(musicCheckBox);
	
	add(soundTable);
	row();
	add(musicTable);
	
}
 
开发者ID:libgdx-jam,项目名称:GDXJam,代码行数:26,代码来源:OptionsDialog.java

示例4: addCheckBox

import com.badlogic.gdx.scenes.scene2d.ui.CheckBox; //导入依赖的package包/类
public boolean addCheckBox(final String label, final boolean checked, final Procedure1<Boolean> update) {
  boolean _xblockexpression = false;
  {
    Label _createLabel = this.widgets.createLabel(label);
    Cell<Label> _add = this.table.<Label>add(_createLabel);
    this.defaultCellOptions(_add);
    final CheckBox box = this.widgets.createCheckBox();
    box.setChecked(checked);
    Cell<CheckBox> _add_1 = this.table.<CheckBox>add(box);
    this.defaultCellOptions(_add_1);
    this.table.row();
    final Procedure0 _function = new Procedure0() {
      @Override
      public void apply() {
        boolean _isChecked = box.isChecked();
        update.apply(Boolean.valueOf(_isChecked));
      }
    };
    _xblockexpression = this.updateProcedures.add(_function);
  }
  return _xblockexpression;
}
 
开发者ID:CymricNPG,项目名称:abattle,代码行数:23,代码来源:OptionTable.java

示例5: createUI

import com.badlogic.gdx.scenes.scene2d.ui.CheckBox; //导入依赖的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

示例6: setup

import com.badlogic.gdx.scenes.scene2d.ui.CheckBox; //导入依赖的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

示例7: EmptyRendererEditor

import com.badlogic.gdx.scenes.scene2d.ui.CheckBox; //导入依赖的package包/类
public EmptyRendererEditor(Controller control) {
	this.controller = control;
	float pad = WidgetBuilder.dpToPixels(8);
	pad(pad);

	ApplicationAssets applicationAssets = controller.getApplicationAssets();
	Skin skin = applicationAssets.getSkin();
	setBackground(skin.getDrawable(SkinConstants.DRAWABLE_PAGE));

	add(hitAll = new CheckBox(applicationAssets.getI18N().m("hit.all"),
			skin));
	hitAll.addListener(new ChangeListener() {
		@Override
		public void changed(ChangeEvent event, Actor actor) {
			EmptyRenderer emptyRenderer = Q.getComponent(modelEntity,
					EmptyRenderer.class);
			controller.action(SetField.class, emptyRenderer,
					FieldName.HIT_ALL, hitAll.isChecked());
		}
	});
}
 
开发者ID:e-ucm,项目名称:ead,代码行数:22,代码来源:EmptyRendererEditor.java

示例8: a

import com.badlogic.gdx.scenes.scene2d.ui.CheckBox; //导入依赖的package包/类
private void a(Skin paramSkin, c[] paramArrayOfc)
{
  int i = paramArrayOfc.length;
  for (int j = 0; j < i; j++)
  {
    c localc = paramArrayOfc[j];
    CheckBox localCheckBox = new CheckBox(localc.c, paramSkin);
    localCheckBox.setChecked(localc.d);
    localCheckBox.addListener(new b(this, localc, localCheckBox));
    localCheckBox.left();
    ((com.a.a.c)localCheckBox.getCells().get(0)).j();
    add(localCheckBox).a(Float.valueOf(0.85F), Float.valueOf(0.0F)).o().m().j(8.0F);
    this.a.put(Integer.valueOf(localc.a), localCheckBox);
    row();
  }
}
 
开发者ID:isnuryusuf,项目名称:ingress-indonesia-dev,代码行数:17,代码来源:a.java

示例9: addCharacterPosition

import com.badlogic.gdx.scenes.scene2d.ui.CheckBox; //导入依赖的package包/类
private void addCharacterPosition(UserCharacterDataPacket character)
{
	characters.add(character);
	text(character.getNickname());
	text(character.getLevel().toString());
	CheckBox checkBox = new CheckBox("", Settings.DEFAULT_SKIN);
	checkBox.setName(character.getNickname());
	checkBoxes.add(checkBox);
	getContentTable().add(checkBox);
	getContentTable().row();
}
 
开发者ID:MMORPG-Prototype,项目名称:MMORPG_Prototype,代码行数:12,代码来源:ChoosingCharacterDialog.java

示例10: addCheckboxStyles

import com.badlogic.gdx.scenes.scene2d.ui.CheckBox; //导入依赖的package包/类
private void addCheckboxStyles() {
    Texture sheet = game.manager.get("ui/switch.png");
    int width = sheet.getWidth();
    int height = sheet.getHeight() / 3;
    TextureRegion broken = new TextureRegion(sheet, 0, 0, width, height);
    TextureRegion on = new TextureRegion(sheet, 0, height, width, height);
    TextureRegion off = new TextureRegion(sheet, 0, 2 * height, width, height);

    CheckBox.CheckBoxStyle style = new CheckBox.CheckBoxStyle();
    style.checkboxOn = new TextureRegionDrawable(on);
    style.checkboxOff = new TextureRegionDrawable(off);
    style.checkboxOnDisabled = style.checkboxOffDisabled = new TextureRegionDrawable(broken);
    style.font = get("normal", BitmapFont.class);
    add("default", style);
}
 
开发者ID:danirod,项目名称:rectball,代码行数:16,代码来源:RectballSkin.java

示例11: AContinentForm

import com.badlogic.gdx.scenes.scene2d.ui.CheckBox; //导入依赖的package包/类
public AContinentForm(Skin skin, AbstractSampler sampler, Samplers pool) {
	super(skin, sampler, pool);

	inputTable = new InputTable(skin);
	inputTable.setBackground(Styles.INNER_BACKGROUND);
	inputTable.addEntry(NAME_ITERATIONS, 60);
	inputTable.addEntry(NAME_GROWTH, 60);
	inputTable.addEntry(NAME_SIZE, 60);
	inputTable.addEntry(NAME_EDGE, 60);

	inputTable.setEntryValueListener(new InputTable.EntryValueListener() {
		@Override
		public void onChange(String entryName, String entryValue) {
			notifyChanges();
		}
	});

	add(inputTable);

	row();
	cbSmoothEdge = new CheckBox("Smooth edge", skin);
	cbSmoothEdge.addListener(new ChangeListener() {
		@Override
		public void changed(ChangeEvent event, Actor actor) {
			notifyChanges();
		}
	});
	add(cbSmoothEdge);
}
 
开发者ID:aphex-,项目名称:Opus-Prototype,代码行数:30,代码来源:AContinentForm.java

示例12: newRadioButton

import com.badlogic.gdx.scenes.scene2d.ui.CheckBox; //导入依赖的package包/类
private CheckBox newRadioButton(String text) {
	CheckBox radioButton = new CheckBox(text, checkBoxStyle);
	radioButton.getImageCell().pad(20 * scale);
	radioButton.getImageCell().size(
			radioButton.getImageCell().getPrefWidth()
			* scale);
	return radioButton;
}
 
开发者ID:raatmarien,项目名称:Point-and-Hit,代码行数:9,代码来源:OptionsScreen.java

示例13: createStaticMenu

import com.badlogic.gdx.scenes.scene2d.ui.CheckBox; //导入依赖的package包/类
private void createStaticMenu() {
	Table container = new Table();
	container.setFillParent(true);
	container.top();
	stage.addActor(container);

	Label title = new Label("Configuration", uiSkin, "title");
	Label musicLabel = new Label("Musique :", uiSkin);
	
	CheckBox musicCheckBox = new CheckBox("", uiSkin);
	musicCheckBox.setChecked(GlobalConfiguration.musicOn);
	musicCheckBox.addListener(new MusicCheckBoxListener());
	
	Label seedLabel = new Label("Seed :", uiSkin);
	String configuredSeed = (GlobalConfiguration.configuredSeed == null) ? null : ""+GlobalConfiguration.configuredSeed;
	TextField seedField = new TextField(configuredSeed, uiSkin);
	TextButton saveButton = new TextButton("Sauvegarder", uiSkin);
	saveButton.addListener(new SaveConfigListener(seedField, stage));
	
	Label returnLabel = new Label("Menu", uiSkin);
	returnLabel.addListener(new ButtonRedirectListener(game, new MainMenuScreen(game)));
	
	Table actorContainer = new Table();
	actorContainer.add(musicLabel);
	actorContainer.add(musicCheckBox);
	actorContainer.row().padTop(10);
	actorContainer.add(seedLabel).padRight(10);
	actorContainer.add(seedField);
	actorContainer.row().padTop(10);
	actorContainer.add(saveButton).colspan(2);
	
	container.add(title).padTop(10);
	container.row();
	container.add(actorContainer).expand();
	container.row();
	container.add(returnLabel).bottom().left().pad(10);
}
 
开发者ID:gcleenew,项目名称:RottenCave,代码行数:38,代码来源:ConfigurationScreen.java

示例14: switchCase

import com.badlogic.gdx.scenes.scene2d.ui.CheckBox; //导入依赖的package包/类
/** @param checkBox will have its text changed. */
public void switchCase(final CheckBox checkBox) {
    if (checkBox.isChecked()) {
        checkBox.setText(checkBox.getText().toString().toUpperCase());
    } else {
        checkBox.setText(checkBox.getText().toString().toLowerCase());
    }
}
 
开发者ID:czyzby,项目名称:gdx-lml,代码行数:9,代码来源:MainView.java

示例15: GameSelectionDialog

import com.badlogic.gdx.scenes.scene2d.ui.CheckBox; //导入依赖的package包/类
public GameSelectionDialog(String title, Game game, Skin skin) {
	super(title, skin);
	
	this.game = game;
	
	TextButton enterGameButton = new TextButton("Start", skin);
	Label nameLabel = new Label("Dein Name", skin);
	Label passwordLabel = new Label("Passwort", skin);
	nameText = new TextFieldActor("", skin);
	passwordText = new TextFieldActor("", skin);
	CheckBox showPasswordCheckBox = new CheckBox("Passwort anzeigen", skin);
	showPasswordCheckBox.right();
	
	getButtonTable().defaults().width(175).height(100);
	
	getContentTable().padTop(40);
	getContentTable().add(nameLabel).center().row();
	getContentTable().add(nameText).width(200).center().row();
	getContentTable().add(passwordLabel).center().row();
	getContentTable().add(passwordText).width(200).center().row();
	getContentTable().add(showPasswordCheckBox).center().colspan(2).center();
	getButtonTable().padTop(30);
	button(enterGameButton, "Start");
	
	passwordText.setPasswordCharacter('*');
	passwordText.setPasswordMode(true);
	showPasswordCheckBox.setChecked(false);
	
	showPasswordCheckBox.addListener(new ChangeListener() {
		public void changed (ChangeEvent event, Actor actor) {
			passwordText.setPasswordMode(!passwordText.isPasswordMode());
		}
	});
}
 
开发者ID:javosuher,项目名称:Terminkalender,代码行数:35,代码来源:GameSelectionDialog.java


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