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


Java VisImageButton类代码示例

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


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

示例1: getActorByName

import com.kotcrab.vis.ui.widget.VisImageButton; //导入依赖的package包/类
public Actor getActorByName(String name){
    switch (name){
        case "Group":
            return new Group();
        case "Label":
            return new NativeLabel("",getMainFont());
        case "CheckBox":
            return new VisCheckBox("");
        case "Image":
            return new Image(assetManager.get("badlogic.jpg",Texture.class));
        case "Button":
            return new VisImageButton(VisUI.getSkin().get(VisImageButton.VisImageButtonStyle.class));
        case "TextField":
            return new TextField("",VisUI.getSkin());
        default:
            return new Actor();
    }
}
 
开发者ID:whitecostume,项目名称:libgdx_ui_editor,代码行数:19,代码来源:EditorManager.java

示例2: build

import com.kotcrab.vis.ui.widget.VisImageButton; //导入依赖的package包/类
@Override
public void build(Group group) {
	pauseButtonTexture = new TextureRegionDrawable(new TextureRegion(new Texture("pause.png")));
	backButtonTexture = new TextureRegionDrawable(new TextureRegion(new Texture("back.png")));
	
	pauseButton = new VisImageButton(pauseButtonTexture);
	pauseButton.addListener(new ChangeListener() {
		@Override
		public void changed(ChangeEvent event, Actor actor) {
			((WorldSimulator)getController()).toggleOverlayMenu();
		}
	});
	
	pauseButton.setWidth(widthVal.get(pauseButton));
	pauseButton.setHeight(heightVal.get(pauseButton));
	
	group.addActor(pauseButton);
}
 
开发者ID:mcgeer,项目名称:Climatar,代码行数:19,代码来源:PauseView.java

示例3: addVisWidgets

import com.kotcrab.vis.ui.widget.VisImageButton; //导入依赖的package包/类
private void addVisWidgets () {
	Drawable icon = VisUI.getSkin().getDrawable("icon-folder");
	VisImageButton normal = new VisImageButton(icon);
	VisImageButton disabled = new VisImageButton(icon);
	disabled.setGenerateDisabledImage(true);
	disabled.setDisabled(true);
	add(new VisLabel("VisImageButton normal"));
	add(normal).row();
	add(new VisLabel("VisImageButton disabled"));
	add(disabled).row();

	VisImageTextButton normalText = new VisImageTextButton("text", icon);
	VisImageTextButton disabledText = new VisImageTextButton("text", icon);
	disabledText.setGenerateDisabledImage(true);
	disabledText.setDisabled(true);
	add(new VisLabel("VisImageTextButton normal"));
	add(normalText).row();
	add(new VisLabel("VisImageTextButton disabled"));
	add(disabledText).padBottom(3f).row();
}
 
开发者ID:kotcrab,项目名称:vis-editor,代码行数:21,代码来源:TestGenerateDisabledImage.java

示例4: parseUqAttr

import com.kotcrab.vis.ui.widget.VisImageButton; //导入依赖的package包/类
public static void parseUqAttr(Actor actor, XmlReader.Element element){
    Class cls  = EditorManager.getInstance().getActorType(actor);
    if (cls.equals(Label.class)){
        parseLabel((Label) actor,element);
    }else if (cls.equals(Image.class)){
        parseImage((Image) actor,element);
    }else if (cls.equals(Button.class)){
        parseButton((VisImageButton) actor,element);
    }else if (cls.equals(TextField.class)){
        parseTextField((TextField) actor,element);
    }
}
 
开发者ID:whitecostume,项目名称:libgdx_ui_editor,代码行数:13,代码来源:XmlUtils.java

示例5: parseButton

import com.kotcrab.vis.ui.widget.VisImageButton; //导入依赖的package包/类
public static void parseButton(VisImageButton button, XmlReader.Element element){
    String upPath = element.get("up");
    String downPath = element.get("down");
    String checkPath = element.get("check");
    Drawable up = new TextureRegionDrawable(new TextureRegion(new Texture(Config.getImageFilePath(upPath))));
    Drawable down = new TextureRegionDrawable(new TextureRegion(new Texture(Config.getImageFilePath(downPath))));
    Drawable checked = new TextureRegionDrawable(new TextureRegion(new Texture(Config.getImageFilePath(checkPath))));
    VisImageButton.VisImageButtonStyle buttonStyle = new VisImageButton.VisImageButtonStyle(
            up,down,checked,up,down,checked
    );
    button.setStyle(buttonStyle);
    attr2Button(button, new String[]{upPath, downPath, checkPath});
}
 
开发者ID:whitecostume,项目名称:libgdx_ui_editor,代码行数:14,代码来源:XmlUtils.java

示例6: validateApiKey

import com.kotcrab.vis.ui.widget.VisImageButton; //导入依赖的package包/类
@LmlAction("validateApiKey") void validateApiKey() {
    final VisWindow pleaseWaitDialog = (VisWindow) interfaceService.getParser().parseTemplate(Gdx.files.internal("lml/compression/dialogTinifyValidation.lml")).first();
    final VisImageButton btnClose = WidgetUtils.obtainCloseButton(pleaseWaitDialog);
    btnClose.setGenerateDisabledImage(true);
    btnClose.setDisabled(true);
    pleaseWaitDialog.setCenterOnAdd(true);
    pleaseWaitDialog.pack();
    stage.addActor(pleaseWaitDialog.fadeIn());

    tinifyService.validateApiKey(new TinifyService.ValidationListener() {
        @Override
        public void onValid() {
            Gdx.app.log(TAG, "Tinify API key validation succeed");

            pleaseWaitDialog.findActor("groupChecking").setVisible(false);
            pleaseWaitDialog.findActor("groupValid").setVisible(true);
            pleaseWaitDialog.closeOnEscape();
            btnClose.setDisabled(false);
        }

        @Override
        public void onInvalid() {
            Gdx.app.log(TAG, "Tinify API key validation failed");

            pleaseWaitDialog.findActor("groupChecking").setVisible(false);
            pleaseWaitDialog.findActor("groupInvalid").setVisible(true);
            pleaseWaitDialog.closeOnEscape();
            btnClose.setDisabled(false);
        }

        @Override
        public void onError(Exception e) {
            Gdx.app.error(TAG, "Error during Tinify API key validation", e);

            pleaseWaitDialog.fadeOut();
            errorDialogController.setError(e);
            interfaceService.showDialog(errorDialogController.getClass());
        }
    });
}
 
开发者ID:crashinvaders,项目名称:gdx-texture-packer-gui,代码行数:41,代码来源:TinifyCompDialogController.java

示例7: createMainTable

import com.kotcrab.vis.ui.widget.VisImageButton; //导入依赖的package包/类
protected void createMainTable () {
	mainTable = new VisTable();
	mainTable.setBackground(style.background);

	VisImageButton closeButton = new VisImageButton(style.closeButtonStyle);
	closeButton.addListener(new ChangeListener() {
		@Override
		public void changed (ChangeEvent event, Actor actor) {
			close();
		}
	});

	mainTable.add(contentTable).pad(3).fill().expand();
	mainTable.add(closeButton).top();
}
 
开发者ID:crashinvaders,项目名称:gdx-texture-packer-gui,代码行数:16,代码来源:Toast.java

示例8: process

import com.kotcrab.vis.ui.widget.VisImageButton; //导入依赖的package包/类
@Override
public void process(final LmlParser parser, final LmlTag tag, final VisImageButton actor,
        final String rawAttributeData) {
    final VisImageButtonStyle style = new VisImageButtonStyle(actor.getStyle());
    style.imageUp = parser.getData().getDefaultSkin().getDrawable(parser.parseString(rawAttributeData, actor));
    actor.setStyle(style);
}
 
开发者ID:czyzby,项目名称:gdx-lml,代码行数:8,代码来源:ButtonImageLmlAttribute.java

示例9: getNewInstanceOfActor

import com.kotcrab.vis.ui.widget.VisImageButton; //导入依赖的package包/类
@Override
protected Actor getNewInstanceOfActor(final LmlActorBuilder builder) {
    final Skin skin = getSkin(builder);
    final VisImageButton button = new VisImageButton(skin.get(builder.getStyleName(), VisImageButtonStyle.class));
    button.setSkin(skin); // Not set internally by the constructor.
    return button;
}
 
开发者ID:czyzby,项目名称:gdx-lml,代码行数:8,代码来源:VisImageButtonLmlTag.java

示例10: build

import com.kotcrab.vis.ui.widget.VisImageButton; //导入依赖的package包/类
public VisImageButton build () {
	VisImageButton button;

	if (toolId != null) {
		button = new ToolButton(icon.drawable(), text, toolId);
		button.addListener(new EventButtonChangeListener(new ToolSwitchedEvent(toolId)));
	} else {
		button = new ToolbarButton(icon.drawable(), text, type);

		if (toggle)
			button.addListener(new VisChangeListener((changeEvent, actor) -> App.eventBus.post(new ToggleToolbarEvent(type, button.isChecked()))));
		else
			button.addListener(new EventButtonChangeListener(new ToolbarEvent(type)));

	}

	button.setGenerateDisabledImage(true);
	button.setProgrammaticChangeEvents(false);

	if (group != null) group.add(button);

	if (toggle) {
		button.getStyle().checked = VisUI.getSkin().getDrawable("button-down");
		button.getStyle().focusBorder = null;
	}

	switch (policy) {
		case SAVABLE:
			savableScope.add(button);
			break;
		case SCENE:
			sceneScope.add(button);
			break;
		case NONE:
			break;
	}

	return button;
}
 
开发者ID:kotcrab,项目名称:vis-editor,代码行数:40,代码来源:ToolbarModule.java

示例11: initShortCutTable

import com.kotcrab.vis.ui.widget.VisImageButton; //导入依赖的package包/类
private void initShortCutTable(){
    VisTable shortcutTable = new VisTable();
    VisImageButton alignLeftBtn = new VisImageButton(new TextureRegionDrawable(new TextureRegion(
            EditorManager.getInstance().assetManager.get("icon/align_left.png",Texture.class)
    )));
    alignLeftBtn.setUserObject(Align.left);
    VisImageButton alignRightBtn = new VisImageButton(new TextureRegionDrawable(new TextureRegion(
            EditorManager.getInstance().assetManager.get("icon/align_right.png",Texture.class)
    )));
    alignRightBtn.setUserObject(Align.right);
    VisImageButton alignCenterBtn = new VisImageButton(new TextureRegionDrawable(new TextureRegion(
            EditorManager.getInstance().assetManager.get("icon/align_center.png",Texture.class)
    )));
    alignCenterBtn.setUserObject(Align.center);

    VisImageButton alignHCenterBtn = new VisImageButton(new TextureRegionDrawable(new TextureRegion(
            EditorManager.getInstance().assetManager.get("icon/align_h_center.png",Texture.class)
    )));
    alignHCenterBtn.setUserObject(Config.centerH);
    VisImageButton alignTopButton = new VisImageButton(new TextureRegionDrawable(new TextureRegion(
            EditorManager.getInstance().assetManager.get("icon/align_top.png",Texture.class)
    )));
    alignTopButton.setUserObject(Align.top);
    VisImageButton alignBottomButton = new VisImageButton(new TextureRegionDrawable(new TextureRegion(
            EditorManager.getInstance().assetManager.get("icon/align_bottom.png",Texture.class)
    )));
    alignBottomButton.setUserObject(Align.bottom);

    alignLeftBtn.addListener(alignClickListener);
    alignRightBtn.addListener(alignClickListener);
    alignCenterBtn.addListener(alignClickListener);
    alignHCenterBtn.addListener(alignClickListener);
    alignBottomButton.addListener(alignClickListener);
    alignTopButton.addListener(alignClickListener);

    shortcutTable.add(alignLeftBtn);
    shortcutTable.add(alignRightBtn).spaceLeft(5);
    shortcutTable.row();
    shortcutTable.add(alignCenterBtn).spaceTop(5);
    shortcutTable.add(alignHCenterBtn).spaceLeft(5).spaceTop(5);
    shortcutTable.row();
    shortcutTable.add(alignTopButton).spaceTop(5);
    shortcutTable.add(alignBottomButton).spaceLeft(5).spaceTop(5);

    this.add(shortcutTable).expand().left().padLeft(10).top().padTop(10);
}
 
开发者ID:whitecostume,项目名称:libgdx_ui_editor,代码行数:47,代码来源:EditorWindow.java

示例12: obtainCloseButton

import com.kotcrab.vis.ui.widget.VisImageButton; //导入依赖的package包/类
/** Obtains close button from {@link VisWindow} */
public static VisImageButton obtainCloseButton(VisWindow window) {
    return  (VisImageButton) window.getTitleTable().getChildren().peek();
}
 
开发者ID:crashinvaders,项目名称:gdx-texture-packer-gui,代码行数:5,代码来源:WidgetUtils.java

示例13: getHandledType

import com.kotcrab.vis.ui.widget.VisImageButton; //导入依赖的package包/类
@Override
public Class<VisImageButton> getHandledType() {
    return VisImageButton.class;
}
 
开发者ID:czyzby,项目名称:gdx-lml,代码行数:5,代码来源:ImageButtonGenerateDisabledLmlAttribute.java

示例14: process

import com.kotcrab.vis.ui.widget.VisImageButton; //导入依赖的package包/类
@Override
public void process(final LmlParser parser, final LmlTag tag, final VisImageButton actor,
        final String rawAttributeData) {
    actor.setGenerateDisabledImage(parser.parseBoolean(rawAttributeData, actor));
}
 
开发者ID:czyzby,项目名称:gdx-lml,代码行数:6,代码来源:ImageButtonGenerateDisabledLmlAttribute.java

示例15: getComponentActors

import com.kotcrab.vis.ui.widget.VisImageButton; //导入依赖的package包/类
@Override
protected Actor[] getComponentActors(final Actor actor) {
    return new Actor[] { ((VisImageButton) actor).getImage() };
}
 
开发者ID:czyzby,项目名称:gdx-lml,代码行数:5,代码来源:VisImageButtonLmlTag.java


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