本文整理汇总了Java中com.badlogic.gdx.scenes.scene2d.ui.Button.setChecked方法的典型用法代码示例。如果您正苦于以下问题:Java Button.setChecked方法的具体用法?Java Button.setChecked怎么用?Java Button.setChecked使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.badlogic.gdx.scenes.scene2d.ui.Button
的用法示例。
在下文中一共展示了Button.setChecked方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: notify
import com.badlogic.gdx.scenes.scene2d.ui.Button; //导入方法依赖的package包/类
@Override
public void notify(Events event, Object... data) {
switch (event) {
case TOGGLE_VISIBILITY_CMD:
boolean interf = (Boolean) data[1];
if (!interf) {
String key = (String) data[0];
Button b = buttonMap.get(key);
b.setProgrammaticChangeEvents(false);
if (b != null) {
if (data.length == 3) {
b.setChecked((Boolean) data[2]);
} else {
b.setChecked(!b.isChecked());
}
}
b.setProgrammaticChangeEvents(true);
}
break;
default:
break;
}
}
示例2: switchCheckedButton
import com.badlogic.gdx.scenes.scene2d.ui.Button; //导入方法依赖的package包/类
/** @param button will become currently checked button. */
public void switchCheckedButton(final Button button) {
if (checkedButton != null) {
// Unchecking previous button.
checkedButton.setProgrammaticChangeEvents(false);
checkedButton.setChecked(false);
}
button.setChecked(true);
checkedButton = button;
}
示例3: process
import com.badlogic.gdx.scenes.scene2d.ui.Button; //导入方法依赖的package包/类
@Override
public void process(final LmlParser parser, final LmlTag tag, final Button actor, final String rawAttributeData) {
// We don't want to invoke change listeners just yet.
actor.setProgrammaticChangeEvents(false); // True by default.
actor.setChecked(parser.parseBoolean(rawAttributeData, actor));
actor.setProgrammaticChangeEvents(true); // Switching to default state. No getter, so we are basically guessing.
}
示例4: setChecked
import com.badlogic.gdx.scenes.scene2d.ui.Button; //导入方法依赖的package包/类
@Override
public void setChecked(String text) {
if (text == null) throw new IllegalArgumentException("text cannot be null.");
for (int i = 0, n = getButtons().size; i < n; i++) {
Button button = (Button)getButtons().get(i);
if (button instanceof IconButton && text.equals((String)((IconButton)button).getText().toString())) {
button.setChecked(true);
return;
}
}
}