List of usage examples for com.badlogic.gdx.scenes.scene2d.ui ScrollPane setScrollingDisabled
public void setScrollingDisabled(boolean x, boolean y)
From source file:org.brian.blueirisviewer.ui.AboutWnd.java
License:Open Source License
@Override public void onCreate(Skin skin, Window window, Table table) { window.setTitle("About BlueIrisView"); Table scrollTable = new Table(skin); scrollTable.columnDefaults(0).align(Align.left); scrollTable.pad(10, 10, 10, 30);//from w w w . j a v a 2 s . co m ScrollPane scrollPane = new ScrollPane(scrollTable, skin); scrollPane.setFadeScrollBars(false); scrollPane.setScrollingDisabled(true, false); table.add(scrollPane).colspan(2).align(Align.center); table.row(); scrollTable.add("BlueIrisView Version 2.8.1"); scrollTable.row(); scrollTable.add().height(10); scrollTable.row(); scrollTable.add("by Brian Pearce - 2018"); scrollTable.row(); scrollTable.add().height(20); scrollTable.row(); scrollTable.add("Powered by libGDX " + Version.VERSION); scrollTable.row(); scrollTable.add().height(10); scrollTable.row(); texLibGDXImage = new Texture(Gdx.files.internal("data/libgdx_about.png")); Image imgLibGDX = new Image(texLibGDXImage); scrollTable.add(imgLibGDX); scrollTable.row(); scrollTable.add().height(20); scrollTable.row(); scrollTable.add( "BlueIrisView uses the XStream library for settings serialization.\n\nXStream's license follows:"); scrollTable.row(); scrollTable.add().height(10); scrollTable.row(); Label lblXStreamLicense = new Label(xStreamLicense, skin); scrollTable.add(lblXStreamLicense); scrollTable.row(); scrollTable.add().height(20); scrollTable.row(); scrollTable.add(new Label("-----------------------------------", skin)); scrollTable.row(); scrollTable.add().height(10); scrollTable.row(); scrollTable.add( "BlueIrisView uses the json-simple library.\n\njson-simple is licensed with Apache License, Version 2.0 "); scrollTable.row(); scrollTable.add().height(5); scrollTable.row(); scrollTable.add(new Label("http://www.apache.org/licenses/LICENSE-2.0", skin)); scrollTable.row(); scrollTable.add().height(10); scrollTable.row(); scrollTable.add().height(20); scrollTable.row(); scrollTable.add(new Label("-----------------------------------", skin)); scrollTable.row(); scrollTable.add().height(10); scrollTable.row(); scrollTable.add(new Label( "BlueIrisView optionally uses the libjpeg-turbo library to reduce CPU usage on Windows.", skin)); scrollTable.row(); scrollTable.add().height(5); scrollTable.row(); scrollTable .add(new Label("this software is based in part on the work of the Independent JPEG Group", skin)); scrollTable.row(); scrollTable.add().height(5); scrollTable.row(); scrollTable.add(new Label( "Redistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n- Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n- Redistributions in binary form must reproduce the above copyright notice,\n this list of conditions and the following disclaimer in the documentation\n and/or other materials provided with the distribution.\n- Neither the name of the libjpeg-turbo Project nor the names of its\n contributors may be used to endorse or promote products derived from this\n software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\",\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\nARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE\nLIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\nCONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\nSUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\nINTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\nCONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\nARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\nPOSSIBILITY OF SUCH DAMAGE.", skin)); scrollTable.row(); scrollTable.add().height(10); scrollTable.row(); final CheckBox cbSaveErrorLogToDisk = new CheckBox(" Log Errors To Disk", skin); cbSaveErrorLogToDisk.setChecked(BlueIrisViewer.bivSettings.logErrorsToDisk); cbSaveErrorLogToDisk.addListener(new ChangeListener() { @Override public void changed(ChangeEvent event, Actor actor) { if (BlueIrisViewer.bivSettings.logErrorsToDisk) Logger.debug("Disabling File Logging", AboutWnd.this); BlueIrisViewer.bivSettings.logErrorsToDisk = cbSaveErrorLogToDisk.isChecked(); BlueIrisViewer.bivSettings.Save(); if (BlueIrisViewer.bivSettings.logErrorsToDisk) Logger.debug("Enabled File Logging", AboutWnd.this); } }); table.add(cbSaveErrorLogToDisk).align(Align.left); final TextButton btnClose = new TextButton("Close", skin); btnClose.addListener(new ChangeListener() { @Override public void changed(ChangeEvent event, Actor actor) { hide(); } }); table.add(btnClose).align(Align.right); table.row(); }
From source file:org.shadebob.skineditor.actors.OptionsPane.java
License:Apache License
/** * /*from ww w . j a v a 2 s . c o m*/ */ public OptionsPane(final SkinEditorGame game) { super(); this.game = game; left(); top(); setBackground(game.skin.getDrawable("default-pane")); add(new Label("Styles", game.skin, "title")).pad(5).row(); listStyles = new List<String>(game.skin, "dimmed"); listStyles.setItems(listItems); ScrollPane scroll = new ScrollPane(listStyles, game.skin); scroll.setFlickScroll(false); scroll.setFadeScrollBars(false); scroll.setScrollbarsOnTop(true); scroll.setScrollBarPositions(false, true); scroll.setScrollingDisabled(true, false); add(scroll).height(200).expandX().fillX().pad(5).row(); // Add buttons Table tableStylesButtons = new Table(); TextButton buttonNewStyle = new TextButton("New Style", game.skin); TextButton buttonDeleteStyle = new TextButton("Delete Style", game.skin); tableStylesButtons.add(buttonNewStyle).pad(5); tableStylesButtons.add(buttonDeleteStyle).pad(5); add(tableStylesButtons).row(); // Callbacks listStyles.addListener(new ChangeListener() { @Override public void changed(ChangeEvent event, Actor actor) { String key = (String) listStyles.getSelected(); if (key != null) { Gdx.app.log("OptionsPane", "Selected style: " + key); currentStyle = styles.get(key); updateTableFields(key); } } }); buttonNewStyle.addListener(new ChangeListener() { @Override public void changed(ChangeEvent event, Actor actor) { createNewStyle(); } }); buttonDeleteStyle.addListener(new ChangeListener() { @Override public void changed(ChangeEvent event, Actor actor) { showDeleteDialog(); } }); // Initialize table add(new Label("Fields", game.skin, "title")).pad(5).padTop(10).row(); tableFields = new Table(game.skin); tableFields.setBackground(game.skin.getDrawable("dialogDim")); tableFields.left().top(); ScrollPane scroll2 = new ScrollPane(tableFields, game.skin); scroll2.setFlickScroll(false); scroll2.setFadeScrollBars(false); scroll2.setScrollbarsOnTop(true); scroll2.setScrollBarPositions(false, true); scroll2.setScrollingDisabled(true, false); add(scroll2).pad(5).expand().fill(); }
From source file:ui.PracticeScrollPanel.java
License:Apache License
public PracticeScrollPanel(final PracticeScreen screen, Rectangle bounds) { this.screen = screen; Table table = new Table(); int i = 0;//from w w w . j av a 2 s . c o m while (i < NUM_GAMETYPES) { table.row().expandX().pad(40); for (int j = 0; j < NUM_COLUMNS; j++) { final GameType type = GameType.values()[i % GameType.values().length]; final String name = GameNames[type.ordinal()]; final Image img = new Image(HyperTask.res.getTexture(name)); img.setSize(78, 78); img.setColor(GameColors[type.ordinal()]); img.setOrigin(Align.center); //img.setScale(1.2f); img.addListener(new ClickListener() { @Override public void clicked(InputEvent event, float x, float y) { AudioManager.instance().play(HyperTask.res.getSound(SOUND_CLICK), CLICK_VOLUME); img.addAction( Actions.sequence(Actions.scaleTo(1.8f, 1.8f, 0.1f), Actions.scaleTo(1, 1, 0.1f))); screen.setGame(type); } }); table.add(img); i++; if (i >= NUM_GAMETYPES) break; } } final ScrollPane scroll = new ScrollPane(table); scroll.setOverscroll(false, true); scroll.setScrollingDisabled(true, false); setBounds(bounds.x, bounds.y, bounds.width, bounds.height); add(scroll).expand().fill(); }