本文整理汇总了Java中com.badlogic.gdx.scenes.scene2d.utils.Disableable类的典型用法代码示例。如果您正苦于以下问题:Java Disableable类的具体用法?Java Disableable怎么用?Java Disableable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Disableable类属于com.badlogic.gdx.scenes.scene2d.utils包,在下文中一共展示了Disableable类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: process
import com.badlogic.gdx.scenes.scene2d.utils.Disableable; //导入依赖的package包/类
@Override
public void process(final LmlParser parser, final LmlTag tag, final Actor actor, final String rawAttributeData) {
final ActorConsumer<?, Color> listener = parser.parseAction(rawAttributeData, Color.WHITE);
if (listener == null) {
parser.throwErrorIfStrict(
"Color picker attribute needs a reference to an action that consumes a Color instance. No method found for ID: "
+ rawAttributeData);
return;
}
final ColorPickerListener colorPickerListener = getListener(listener);
actor.addListener(new ClickListener() {
@Override
public void clicked(final InputEvent event, final float x, final float y) {
if (actor instanceof Disableable && ((Disableable) actor).isDisabled()) {
return;
}
final ColorPicker colorPicker = ColorPickerContainer.requestInstance();
colorPicker.setListener(null);
colorPicker.setColor(actor.getColor());
colorPicker.setListener(colorPickerListener);
colorPicker.centerWindow();
actor.getStage().addActor(colorPicker.fadeIn());
}
});
}
开发者ID:czyzby,项目名称:gdx-lml,代码行数:26,代码来源:ColorPickerLmlAttribute.java
示例2: updateWidgets
import com.badlogic.gdx.scenes.scene2d.utils.Disableable; //导入依赖的package包/类
private void updateWidgets () {
for (Disableable disableable : disableTargets) {
disableable.setDisabled(formInvalid);
}
if (messageLabel != null) {
if (errorMsgText != null) {
messageLabel.setText(errorMsgText);
} else {
messageLabel.setText(successMsg); //setText will default to "" if successMsg is null
}
Color targetColor = errorMsgText != null ? style.errorLabelColor : style.validLabelColor;
if (targetColor != null && style.colorTransitionDuration != 0) {
messageLabel.addAction(Actions.color(targetColor, style.colorTransitionDuration));
} else {
messageLabel.setColor(targetColor);
}
}
}
开发者ID:kotcrab,项目名称:vis-editor,代码行数:21,代码来源:SimpleFormValidator.java
示例3: process
import com.badlogic.gdx.scenes.scene2d.utils.Disableable; //导入依赖的package包/类
@Override
public void process(final LmlParser parser, final LmlTag tag, final Actor actor, final String rawAttributeData) {
if (actor instanceof Disableable) {
((Disableable) actor).setDisabled(parser.parseBoolean(rawAttributeData, actor));
} else {
parser.throwErrorIfStrict(
"This widget cannot be disabled, as it does not implement Disableable interface. Received disabled attribute on tag: "
+ tag.getTagName() + " with actor: " + actor);
}
}
开发者ID:czyzby,项目名称:gdx-lml,代码行数:11,代码来源:DisabledLmlAttribute.java
示例4: processFormAttribute
import com.badlogic.gdx.scenes.scene2d.utils.Disableable; //导入依赖的package包/类
@Override
protected void processFormAttribute(final LmlParser parser, final LmlTag tag, final VisFormTable parent,
final Actor actor, final String rawAttributeData) {
if (actor instanceof Disableable) {
if (parser.parseBoolean(rawAttributeData, actor)) {
parent.addWidgetToDisable((Disableable) actor);
}
} else {
parser.throwErrorIfStrict(
"Only Disableable widgets can be attached to the form with this attribute. Found widget that does not implement Disableable attribute: "
+ actor + " with tag: " + tag.getTagName());
}
}
开发者ID:czyzby,项目名称:gdx-lml,代码行数:14,代码来源:DisableOnFormErrorLmlAttribute.java
示例5: clicked
import com.badlogic.gdx.scenes.scene2d.utils.Disableable; //导入依赖的package包/类
@Override
public void clicked(final InputEvent event, final float x, final float y) {
if (actor instanceof Disableable && ((Disableable) actor).isDisabled()) {
return;
}
actor.getStage().addActor(visWindow.fadeIn());
}
开发者ID:czyzby,项目名称:gdx-lml,代码行数:8,代码来源:VisStageAttacher.java
示例6: enableComponents
import com.badlogic.gdx.scenes.scene2d.utils.Disableable; //导入依赖的package包/类
/**
* Sets the enabled property on the given components
*
* @param enabled
* @param components
*/
protected void enableComponents(boolean enabled, Disableable... components) {
for (Disableable c : components) {
if (c != null)
c.setDisabled(!enabled);
}
}
开发者ID:langurmonkey,项目名称:gaiasky,代码行数:13,代码来源:LandAtWindow.java
示例7: addWidgetToDisable
import com.badlogic.gdx.scenes.scene2d.utils.Disableable; //导入依赖的package包/类
/** See {@link SimpleFormValidator#addDisableTarget(Disableable)}.
*
* @param disableable will be disabled if any errors are found in the form. */
public void addWidgetToDisable(final Disableable disableable) {
formValidator.addDisableTarget(disableable);
}
开发者ID:czyzby,项目名称:gdx-lml,代码行数:7,代码来源:VisFormTable.java
示例8: SimpleFormValidator
import com.badlogic.gdx.scenes.scene2d.utils.Disableable; //导入依赖的package包/类
/**
* @param targetToDisable target actor that will be disabled if form is invalid. Eg. you can pass form Confirm button.
* May be null.
* @param messageLabel label that text will be changed if from is valid or invalid. May be null.
*/
public SimpleFormValidator (Disableable targetToDisable, Label messageLabel, FormValidatorStyle style) {
this.style = style;
if (targetToDisable != null) disableTargets.add(targetToDisable);
this.messageLabel = messageLabel;
}
开发者ID:kotcrab,项目名称:vis-editor,代码行数:11,代码来源:SimpleFormValidator.java
示例9: addDisableTarget
import com.badlogic.gdx.scenes.scene2d.utils.Disableable; //导入依赖的package包/类
public void addDisableTarget (Disableable disableable) {
disableTargets.add(disableable);
updateWidgets();
}
开发者ID:kotcrab,项目名称:vis-editor,代码行数:5,代码来源:SimpleFormValidator.java
示例10: removeDisableTarget
import com.badlogic.gdx.scenes.scene2d.utils.Disableable; //导入依赖的package包/类
public boolean removeDisableTarget (Disableable disableable) {
boolean result = disableTargets.removeValue(disableable, true);
updateWidgets();
return result;
}
开发者ID:kotcrab,项目名称:vis-editor,代码行数:6,代码来源:SimpleFormValidator.java
示例11: FormValidator
import com.badlogic.gdx.scenes.scene2d.utils.Disableable; //导入依赖的package包/类
/** @see SimpleFormValidator#SimpleFormValidator(Disableable) */
public FormValidator (Disableable targetToDisable) {
super(targetToDisable);
}
开发者ID:kotcrab,项目名称:vis-editor,代码行数:5,代码来源:FormValidator.java
示例12: EnableActionListener
import com.badlogic.gdx.scenes.scene2d.utils.Disableable; //导入依赖的package包/类
public EnableActionListener(Disableable disableable) {
this.disableable = disableable;
}
开发者ID:e-ucm,项目名称:ead,代码行数:4,代码来源:EnableActionListener.java
示例13: isDisabled
import com.badlogic.gdx.scenes.scene2d.utils.Disableable; //导入依赖的package包/类
/**
* @param actor might be a {@link Disableable}.
* @return true if actor is disabled.
*/
protected boolean isDisabled (final Actor actor) {
return actor instanceof Disableable && ((Disableable) actor).isDisabled();
}
开发者ID:kotcrab,项目名称:vis-editor,代码行数:8,代码来源:Draggable.java
注:本文中的com.badlogic.gdx.scenes.scene2d.utils.Disableable类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论