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


Java ScrollPane.setFlickScroll方法代码示例

本文整理汇总了Java中com.badlogic.gdx.scenes.scene2d.ui.ScrollPane.setFlickScroll方法的典型用法代码示例。如果您正苦于以下问题:Java ScrollPane.setFlickScroll方法的具体用法?Java ScrollPane.setFlickScroll怎么用?Java ScrollPane.setFlickScroll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.badlogic.gdx.scenes.scene2d.ui.ScrollPane的用法示例。


在下文中一共展示了ScrollPane.setFlickScroll方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addPreviewProperties

import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane; //导入方法依赖的package包/类
private void addPreviewProperties(Table bottom, InputListener scrollPaneListener) {
    Label label = new Label("Preview Properties", getSkin(), "title");
    bottom.add(label);

    bottom.row();
    previewPropertiesTable = new Table();
    previewPropertiesTable.defaults().pad(5.0f);

    ScrollPane scrollPane = new ScrollPane(previewPropertiesTable, getSkin());
    scrollPane.setFadeScrollBars(false);
    scrollPane.setFlickScroll(false);
    scrollPane.addListener(scrollPaneListener);
    bottom.add(scrollPane).grow().padTop(10.0f).padBottom(10.0f);
    
    refreshPreviewProperties();
}
 
开发者ID:raeleus,项目名称:skin-composer,代码行数:17,代码来源:RootTable.java

示例2: addPreview

import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane; //导入方法依赖的package包/类
private void addPreview(Table top, InputListener scrollPaneListener) {
    Label label = new Label("Preview", getSkin(), "title");
    top.add(label);

    top.row();
    previewTable = new Table(getSkin());
    previewTable.setBackground("white");
    ScrollPane scrollPane = new ScrollPane(previewTable, getSkin());
    scrollPane.setFadeScrollBars(false);
    scrollPane.setFlickScroll(false);
    scrollPane.addListener(scrollPaneListener);
    top.add(scrollPane).grow().padTop(10.0f).padBottom(10.0f);

    refreshPreview();
}
 
开发者ID:raeleus,项目名称:skin-composer,代码行数:16,代码来源:RootTable.java

示例3: makeContentContainer

import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane; //导入方法依赖的package包/类
@Override
protected Actor makeContentContainer() {
	ScrollPane scrollPane = new ScrollPane(super.makeContentContainer());
	scrollPane.setFlickScroll(true);
	scrollPane.setFlingTime(0.75f);
	return scrollPane;
}
 
开发者ID:frigidplanet,项目名称:droidtowers,代码行数:8,代码来源:ScrollableTowerWindow.java

示例4: FilesListWidget

import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane; //导入方法依赖的package包/类
public FilesListWidget(Skin skin) {
	super(false);

	style = skin.get(FilesListWidgetStyle.class);
	folderStyle = new FileIconWidgetStyle(style.folderIcon, style.font,
			style.fontColor, style.selected, style.over);
	fileStyle = new FileIconWidgetStyle(style.fileIcon, style.font,
			style.fontColor, style.selected, style.over);

	filesContainer = new Group();

	ScrollPaneStyle scrollStyle = skin.get(ScrollPaneStyle.class);
	scrollPane = new ScrollPane(filesContainer, scrollStyle);
	scrollPane.setFlickScroll(false);
	scrollPane.setFlingTime(0);
	scrollPane.setSmoothScrolling(false);

	currentPath = new TextField("", skin);
	currentPath.addListener(new InputListener() {
		@Override
		public boolean keyDown(InputEvent event, int keycode) {
			switch (keycode) {
			case Keys.ENTER:
				String path = currentPath.getText();
				FileHandle fileHandle = Gdx.files.absolute(path);
				if (fileHandle.exists()) {
					setSelectedFile(fileHandle, true);
				}
				return true;
			}
			return false;
		}
	});

	add(currentPath).expandX();
	add(scrollPane).expand(true, true);

}
 
开发者ID:e-ucm,项目名称:ead,代码行数:39,代码来源:FilesListWidget.java

示例5: createList

import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane; //导入方法依赖的package包/类
private void createList() {
	Skin skin = getGameObject().getComponentInParent(JCanvas.class).getSkin();
	ListStyle style = new ListStyle(skin.get("default", ListStyle.class));

	int realSize = (int) (((getTransform().getScale().x + getTransform().getScale().y) / 2) * fontSize);
	Gdx.app.log("JLabel", "font size: " + realSize);

	SmartFontGenerator fontGen = new SmartFontGenerator();
	FileHandle exoFile = Gdx.files.internal(fontResource.getResourcePath());
	BitmapFont fontBitmap = fontGen.createFont(exoFile, fontResource.getResourcePath() + realSize, realSize);

	if (fontBitmap != null) {
		style.font = fontBitmap;
	}
	if (fontColorSelected != null) {
		style.fontColorSelected = fontColorSelected;
	}
	if (fontColorSelected != null) {
		style.fontColorUnselected = fontColorUnselected;
	}

	if (selection != null) {
		style.selection = DrawableHelper.getDrawableFromAsset(selection.getResourcePath());
	}
	if (background != null) {
		style.background = DrawableHelper.getDrawableFromAsset(background.getResourcePath());
	}

	list = new List<T>(style);
	list.setItems(tempItems);
	list.getSelection().setMultiple(false);
	list.getSelection().setRequired(true);
	if (list.getItems().size > 0) {
		list.setSelectedIndex(1);
	}

	list.addListener(new EventListener() {

		@Override
		public boolean handle(Event event) {
			Gdx.app.log("JList", "event: " + event);
			;

			return false;
		}
	});

	scrollPane = new ScrollPane(list, skin);
	scrollPane.setFlickScroll(false);
}
 
开发者ID:Radomiej,项目名称:JavityEngine,代码行数:51,代码来源:JList.java

示例6: DialogPathErrors

import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane; //导入方法依赖的package包/类
public DialogPathErrors(Main main, Skin skin, String windowStyleName, Array<DrawableData> drawables, Array<FontData> fonts) {
    super("", skin, windowStyleName);
    
    this.main = main;

    foundDrawables = new Array<>();
    foundFonts = new Array<>();
    
    setFillParent(true);
    
    key(Keys.ENTER, true);
    key(Keys.ESCAPE, false);
    Table table = getContentTable();
    table.defaults().pad(10.0f);
    
    Label label = new Label("Path Errors", skin, "title");
    table.add(label);
    
    table.row();
    label = new Label("The following assets could not be found. Please resolve by clicking the associated button.", skin);
    label.setAlignment(Align.center);
    table.add(label).padBottom(0);
    
    table.row();
    dataTable = new Table();
    scrollPane = new ScrollPane(dataTable, skin);
    scrollPane.setFlickScroll(false);
    scrollPane.setFadeScrollBars(false);
    table.add(scrollPane).grow();
    
    resetDrawableTable(main, skin, drawables, fonts);
    
    button("Apply", true);
    applyButton = (TextButton) getButtonTable().getCells().first().getActor();
    applyButton.addListener(main.getHandListener());
    applyButton.setDisabled(true);
    
    button("Cancel", false);
    getButtonTable().getCells().get(1).getActor().addListener(main.getHandListener());
    
    getCell(getButtonTable()).padBottom(20.0f);
    
    table.setWidth(200);
}
 
开发者ID:raeleus,项目名称:skin-composer,代码行数:45,代码来源:DialogPathErrors.java

示例7: DialogWarnings

import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane; //导入方法依赖的package包/类
public DialogWarnings(Main main, Array<String> warnings) {
    super("", main.getSkin(), "welcome");
    this.main = main;
    this.warnings = warnings;
    
    setMovable(false);
    
    Button button = new Button(getSkin(), "close");
    button.addListener(main.getHandListener());
    button.addListener(new ChangeListener() {
        @Override
        public void changed(ChangeListener.ChangeEvent event, Actor actor) {
            hide();
        }
    });
    getContentTable().add(button).expandX().right().pad(0.0f).space(0.0f).padTop(5.0f).padRight(5.0f);
    
    getContentTable().row();
    Label label = new Label("Warnings:", getSkin(), "black-underline");
    getContentTable().add(label);
    
    getContentTable().row();
    Table table = new Table();
    table.pad(10.0f).padTop(0.0f);
    table.defaults().space(10.0f);
    scrollPane = new ScrollPane(table, main.getSkin());
    scrollPane.setFadeScrollBars(false);
    scrollPane.setFlickScroll(false);
    scrollPane.setScrollingDisabled(true, false);
    getContentTable().add(scrollPane).grow();
    
    for (String warning : warnings) {
        table.row();
        label = new Label(warning, getSkin());
        table.add(label);
    }
    
    getButtonTable().defaults().minWidth(100.0f).pad(10.0f);
    button("OK", false).key(Keys.ESCAPE, false).key(Keys.ENTER, false);
    button("Export to Text File", true);
    getButtonTable().getCells().first().getActor().addListener(main.getHandListener());
    
    main.getRootTable().addListener(new StageResizeListener() {
        @Override
        public void resized(int width, int height) {
            if (!MathUtils.isEqual(getWidth(), width)) {
                setWidth(Math.min(resetWidth, width));
            }
            
            if (!MathUtils.isEqual(getHeight(), height)) {
                setHeight(Math.min(resetHeight, height));
            }
            
            setPosition(width / 2.0f, height / 2.0f, Align.center);
            setPosition((int) getX(), (int) getY());
        }
    });
}
 
开发者ID:raeleus,项目名称:skin-composer,代码行数:59,代码来源:DialogWarnings.java

示例8: parse

import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane; //导入方法依赖的package包/类
@Override
public Actor parse(CocoStudioUIEditor editor, ObjectData widget) {
    ScrollPaneStyle style = new ScrollPaneStyle();

    if (widget.getFileData() != null) {

        style.background = editor
            .findDrawable(widget, widget.getFileData());
    }

    ScrollPane scrollPane = new ScrollPane(null, style);

    if ("Vertical_Horizontal".equals(widget.getScrollDirectionType())) {
        scrollPane.setForceScroll(true, true);
    } else if ("Horizontal".equals(widget.getScrollDirectionType())) {
        scrollPane.setForceScroll(true, false);
    } else if ("Vertical".equals(widget.getScrollDirectionType())) {
        scrollPane.setForceScroll(false, true);
    }

    scrollPane.setClamp(widget.isClipAble());
    scrollPane.setFlickScroll(widget.isIsBounceEnabled());

    Table table = new Table();
    table.setSize(widget.getInnerNodeSize().getWidth(), widget
        .getInnerNodeSize().getHeight());

    if (widget.getComboBoxIndex() == 0) {// 无颜色

    } else if (widget.getComboBoxIndex() == 1) {// 单色

        Pixmap pixmap = new Pixmap((int) table.getWidth(),
            (int) table.getHeight(), Format.RGBA8888);
        Color color = editor.getColor(widget.getSingleColor(),
            widget.getBackColorAlpha());

        pixmap.setColor(color);

        pixmap.fill();

        Drawable drawable = new TextureRegionDrawable(new TextureRegion(
            new Texture(pixmap)));

        table.setBackground(drawable);
        pixmap.dispose();

    }
    scrollPane.setWidget(table);
    return scrollPane;
}
 
开发者ID:varFamily,项目名称:cocos-ui-libgdx,代码行数:51,代码来源:CCScrollView.java

示例9: process

import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane; //导入方法依赖的package包/类
@Override
public void process(final LmlParser parser, final LmlTag tag, final ScrollPane actor,
        final String rawAttributeData) {
    actor.setFlickScroll(parser.parseBoolean(rawAttributeData, actor));
}
 
开发者ID:czyzby,项目名称:gdx-lml,代码行数:6,代码来源:ScrollFlickLmlAttribute.java

示例10: LicenseScreen

import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane; //导入方法依赖的package包/类
public LicenseScreen (Game g) {
	game = g;
	stage = new Stage(new FitViewport(WIDTH, HEIGHT));
	skin = new Skin();
	assets = new Assets();
	assets.initMainMenu();
	Gdx.input.setInputProcessor(stage);

	FileHandle handle;
	handle = Gdx.files.internal(LICENSE_PATH);
	licenseString = handle.readString();

	Table table = new Table();
	table.setFillParent(true);
	stage.addActor(table);

	skin.add("default", new BitmapFont(Gdx.files.internal(FONT_PATH)));

	LabelStyle labelStyle = new LabelStyle();
	labelStyle.font = skin.getFont("default");
	skin.add("default", labelStyle);

	ScrollPaneStyle scrollPaneStyle = new ScrollPaneStyle();
	skin.add("default", scrollPaneStyle);

	TextButtonStyle textButtonStyle = new TextButtonStyle();
	textButtonStyle.font = skin.getFont("default");
	textButtonStyle.up = new NinePatchDrawable(assets.getBoxPatch());
	skin.add("default", textButtonStyle);

	Label license = new Label(licenseString, skin);
	ScrollPane scrollPane = new ScrollPane(license, skin);
	scrollPane.setFlickScroll(true);
	table.add(scrollPane);
	table.row();

	TextButton backButton = new TextButton("Back", skin);
	table.add(backButton).padTop(TABLE_PAD);
	table.padTop(TABLE_PAD);
	table.padBottom(TABLE_PAD);
	table.row();

	backButton.addListener(new ChangeListener() {
		public void changed (ChangeEvent event, Actor actor) {
			dispose();
			game.setScreen(new MainMenuScreen(game));
		}
	});
}
 
开发者ID:oddlydrawn,项目名称:nahlc-g,代码行数:50,代码来源:LicenseScreen.java

示例11: addNormalWidgets

import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane; //导入方法依赖的package包/类
private void addNormalWidgets () {
	Skin skin = VisUI.getSkin();

	TextArea textArea = new TextArea("Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec iaculis odio.", skin);
	textArea.setPrefRows(5);

	// ---

	VisTable table = new VisTable();

	for (int i = 0; i < 20; i++)
		table.add(new Label("Label #" + (i + 1), skin)).expand().fill().row();

	ScrollPane scrollPane = new ScrollPane(table, skin, "list");
	scrollPane.setFlickScroll(false);
	scrollPane.setFadeScrollBars(false);

	// ---

	add(textArea).row();
	add(scrollPane).spaceTop(8).fillX().expandX().row();
}
 
开发者ID:kotcrab,项目名称:vis-editor,代码行数:23,代码来源:TestTextAreaAndScroll.java

示例12: FontPickerDialog

import com.badlogic.gdx.scenes.scene2d.ui.ScrollPane; //导入方法依赖的package包/类
/**
 * 
 */
public FontPickerDialog(final SkinEditorGame game, Field field) {

	super("Bitmap Font Picker", game.skin);

	this.game = game;
	this.field = field;

	tableFonts = new Table(game.skin);
	tableFonts.left().top().pad(5);
	tableFonts.defaults().pad(5);

	fonts = game.skinProject.getAll(BitmapFont.class);

	updateTable();

	TextButton buttonNewFont = new TextButton("New Font", game.skin);
	buttonNewFont.addListener(new ChangeListener() {

		@Override
		public void changed(ChangeEvent event, Actor actor) {

			showNewFontDialog();

		}

	});


	ScrollPane scrollPane = new ScrollPane(tableFonts, game.skin);
	scrollPane.setFlickScroll(false);
	scrollPane.setFadeScrollBars(false);
	scrollPane.setScrollbarsOnTop(true);

	getContentTable().add(scrollPane).width(720).height(420).pad(20);
	getButtonTable().add(buttonNewFont);
	getButtonTable().padBottom(15);
	button("Cancel", false);
	key(com.badlogic.gdx.Input.Keys.ESCAPE, false);

}
 
开发者ID:Longri,项目名称:cachebox3.0,代码行数:44,代码来源:FontPickerDialog.java


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