本文整理汇总了Java中com.kotcrab.vis.ui.widget.color.ColorPickerAdapter类的典型用法代码示例。如果您正苦于以下问题:Java ColorPickerAdapter类的具体用法?Java ColorPickerAdapter怎么用?Java ColorPickerAdapter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ColorPickerAdapter类属于com.kotcrab.vis.ui.widget.color包,在下文中一共展示了ColorPickerAdapter类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: buildColourPicker
import com.kotcrab.vis.ui.widget.color.ColorPickerAdapter; //导入依赖的package包/类
@Override
public <T> Object buildColourPicker(ConfigurableAttribute<T> attr) {
ColourPickerWrapper pickerWrapper = ColourPickerWrapper.instance();
TextButton btn = new TextButton(attr.displayName()+" - "+attr.get().toString(), skin);
btn.addListener(new ClickListener() {
@Override
public void clicked(InputEvent event, float x, float y) {
pickerWrapper.setListener(new ColorPickerAdapter() {
@Override
public void changed(Color newColor) {
attr.setSafe(newColor.toString());
btn.setText(attr.displayName()+" - "+newColor.toString());
}
});
pickerWrapper.colour(attr.get().toString());
pickerWrapper.open(btn);
}
});
return btn;
}
开发者ID:ncguy2,项目名称:Argent,代码行数:21,代码来源:GDXComponentBuilder.java
示例2: BasicEntityPropertiesTable
import com.kotcrab.vis.ui.widget.color.ColorPickerAdapter; //导入依赖的package包/类
public BasicEntityPropertiesTable (EntityProperties properties, ColorPicker picker) {
this.properties = properties;
this.picker = picker;
createIdTable();
createPositionTable();
createScaleTable();
createOriginTable();
createRotationTintTable();
createFlipTable();
pickerListener = new ColorPickerAdapter() {
@Override
public void finished (Color newColor) {
for (EntityProxy entity : properties.getSelectedEntities())
entity.setColor(newColor);
properties.getParentTab().dirty();
tint.setColor(newColor);
tint.setUnknown(false);
picker.setListener(null);
properties.endSnapshot();
}
};
}
开发者ID:kotcrab,项目名称:vis-editor,代码行数:26,代码来源:BasicEntityPropertiesTable.java
示例3: prepareColorPickerListener
import com.kotcrab.vis.ui.widget.color.ColorPickerAdapter; //导入依赖的package包/类
/** @param listener a non-null method that consumes colors.
* @return an instance of {@link ColorPickerListener} that should be attached to currently shown {@link ColorPicker}
* instance. */
public static ColorPickerListener prepareColorPickerListener(final ActorConsumer<?, Color> listener) {
return new ColorPickerAdapter() {
@Override
public void canceled(final Color oldColor) {
finished(oldColor);
}
@Override
public void finished(final Color newColor) {
listener.consume(newColor);
}
};
}
开发者ID:czyzby,项目名称:gdx-lml,代码行数:17,代码来源:ColorPickerListenerLmlAttribute.java
示例4: TestColorPicker
import com.kotcrab.vis.ui.widget.color.ColorPickerAdapter; //导入依赖的package包/类
public TestColorPicker () {
super("color picker");
final Image image = new Image(white);
picker = new ColorPicker("color picker", new ColorPickerAdapter() {
@Override
public void finished (Color newColor) {
image.setColor(newColor);
}
});
VisTextButton showPickerButton = new VisTextButton("show color picker");
showPickerButton.addListener(new ChangeListener() {
@Override
public void changed (ChangeEvent event, Actor actor) {
getStage().addActor(picker.fadeIn());
}
});
Color c = new Color(27 / 255.0f, 161 / 255.0f, 226 / 255.0f, 1);
picker.setColor(c);
image.setColor(c);
TableUtils.setSpacingDefaults(this);
add(showPickerButton);
add(image).size(32).pad(3);
pack();
setPosition(948, 148);
}
开发者ID:kotcrab,项目名称:vis-editor,代码行数:33,代码来源:TestColorPicker.java
注:本文中的com.kotcrab.vis.ui.widget.color.ColorPickerAdapter类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论