本文整理匯總了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();
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
示例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());
}
示例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());
}
});
}
示例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();
}
}
示例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();
}
示例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);
}
示例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);
}
示例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;
}
示例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);
}
示例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());
}
}
示例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());
}
});
}