• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java VisImageButton类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: AlignmentToolsDialog

import com.kotcrab.vis.ui.widget.VisImageButton; //导入依赖的package包/类
public AlignmentToolsDialog (ModuleInjector injector) {
	injector.injectModules(this);

	setBackground(VisUI.getSkin().getDrawable("window-bg"));
	setTouchable(Touchable.enabled);
	setVisible(false);

	top().left();
	defaults().left();
	TableUtils.setSpacingDefaults(this);

	VisTable horizontalAlign = new VisTable(true);

	VisImageButton alignLeft = new VisImageButton(Icons.ALIGN_LEFT.drawable(), "Align entities at left edge");
	VisImageButton alignRight = new VisImageButton(Icons.ALIGN_RIGHT.drawable(), "Align entities at right edge");
	VisImageButton alignCenterX = new VisImageButton(Icons.ALIGN_CENTER_X.drawable(), "Center entities at x axis");
	VisImageButton alignTop = new VisImageButton(Icons.ALIGN_BOTTOM.drawable(), "Align entities at top edge");
	VisImageButton alignBottom = new VisImageButton(Icons.ALIGN_TOP.drawable(), "Align entities at bottom edge");
	VisImageButton alignCenterY = new VisImageButton(Icons.ALIGN_CENTER_Y.drawable(), "Center entities at y axis");

	VisImageButton closeButton = new VisImageButton("close-window");

	horizontalAlign.add("Horizontal").width(70);
	horizontalAlign.add(alignLeft);
	horizontalAlign.add(alignRight);
	horizontalAlign.add(alignCenterX);

	VisTable verticalAlign = new VisTable(true);

	verticalAlign.add("Vertical").width(70);
	verticalAlign.add(alignTop);
	verticalAlign.add(alignBottom);
	verticalAlign.add(alignCenterY);

	add(new VisLabel("Alignment", Align.center)).expandX().fillX().top();
	add(closeButton).right().row();
	add(horizontalAlign).padLeft(3).colspan(2).row();
	add(verticalAlign).padLeft(3).colspan(2);

	pack();

	alignLeft.addListener(new VisChangeListener((event, actor) -> alignSelected(Align.left)));
	alignRight.addListener(new VisChangeListener((event, actor) -> alignSelected(Align.right)));
	alignCenterX.addListener(new VisChangeListener((event, actor) -> alignSelectedCenter(false)));
	alignTop.addListener(new VisChangeListener((event, actor) -> alignSelected(Align.top)));
	alignBottom.addListener(new VisChangeListener((event, actor) -> alignSelected(Align.bottom)));
	alignCenterY.addListener(new VisChangeListener((event, actor) -> alignSelectedCenter(true)));

	closeButton.addListener(new VisChangeListener((event, actor) -> setVisible(false)));
}
 
开发者ID:kotcrab,项目名称:vis-editor,代码行数:51,代码来源:AlignmentToolsDialog.java


示例17: LayersDialog

import com.kotcrab.vis.ui.widget.VisImageButton; //导入依赖的package包/类
public LayersDialog (SceneTab sceneTab, SceneModuleContainer sceneMC) {
	super(true);
	this.sceneTab = sceneTab;
	this.scene = sceneTab.getScene();
	sceneMC.injectModules(this);

	setBackground(VisUI.getSkin().getDrawable("window-bg"));
	setTouchable(Touchable.enabled);

	VisImageButton layerAddButton = new VisImageButton(Icons.LAYER_ADD.drawable(), "Add new layer");
	layerUpButton = new VisImageButton(Icons.LAYER_UP.drawable(), "Move layer up");
	layerDownButton = new VisImageButton(Icons.LAYER_DOWN.drawable(), "Move layer down");
	layerSettingsButton = new VisImageButton(Icons.SETTINGS.drawable(), "Show layer settings");
	layerRemoveButton = new VisImageButton(Icons.LAYER_REMOVE.drawable(), "Delete layer");

	layerUpButton.setGenerateDisabledImage(true);
	layerDownButton.setGenerateDisabledImage(true);
	layerRemoveButton.setGenerateDisabledImage(true);

	layerAddButton.addListener(new VisChangeListener((event, actor) ->
			Dialogs.showInputDialog(getStage(), "New Layer", "Name:", true,
					input -> scene.getLayerByName(input) == null,
					(DefaultInputDialogListener) input -> undoModule.execute(new LayerAddedAction(input)))));

	layerUpButton.addListener(new VisChangeListener((event, actor) -> undoModule.execute(new LayerMovedAction(true))));
	layerDownButton.addListener(new VisChangeListener((event, actor) -> undoModule.execute(new LayerMovedAction(false))));

	layerSettingsButton.addListener(new VisChangeListener((event1, actor1) -> getStage().addActor(new LayerSettingsDialog(sceneMC, scene).fadeIn())));

	layerRemoveButton.addListener(new VisChangeListener((event, actor) ->
			Dialogs.showOptionDialog(getStage(), "Delete Layer", "Are you sure you want to delete layer '" + scene.getActiveLayer().name + "'?",
					OptionDialogType.YES_NO, new OptionDialogAdapter() {
						@Override
						public void yes () {
							UndoableActionGroup layerRemovedGroup = new UndoableActionGroup("Delete Layer");
							layerRemovedGroup.add(new EntitiesRemovedAction(sceneMC, sceneTab.getEntityEngine(),
									VisBagUtils.toSet(layerManipulator.getEntitiesWithLayer(scene.getActiveLayerId()))));
							layerRemovedGroup.add(new LayerRemovedAction(scene.getActiveLayer()));
							layerRemovedGroup.finalizeGroup();

							undoModule.execute(layerRemovedGroup);
						}
					})));

	layersTable = new VisTable();

	VisScrollPane layersScrollPane = new VisScrollPane(layersTable);
	layersScrollPane.setScrollingDisabled(true, false);
	layersScrollPane.setFadeScrollBars(false);

	top();
	left();
	defaults().left();
	defaults().padLeft(5).padRight(5);
	add(new VisLabel("Layers")).center().row();
	add(layersScrollPane).expandX().fillX().row();
	addSeparator();
	add(TableBuilder.build(layerAddButton, layerUpButton, layerDownButton, layerSettingsButton, layerRemoveButton)).padBottom(8);

	rebuildLayersTable();

	sceneObservable = nid -> {
		if (nid == EditorScene.LAYER_ADDED || nid == EditorScene.LAYER_INSERTED || nid == EditorScene.LAYER_REMOVED
				|| nid == EditorScene.LAYERS_SORTED || nid == EditorScene.ACTIVE_LAYER_CHANGED || nid == EditorScene.LAYER_DATA_CHANGED) {
			rebuildLayersTable();
			sceneTab.dirty();
		}
	};

	scene.addObservable(sceneObservable);
}
 
开发者ID:kotcrab,项目名称:vis-editor,代码行数:72,代码来源:LayersDialog.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java SimpleSetPredicate类代码示例发布时间:2022-05-22
下一篇:
Java JavassistBuildException类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap