本文整理汇总了Java中com.badlogic.gdx.scenes.scene2d.ui.SplitPane类的典型用法代码示例。如果您正苦于以下问题:Java SplitPane类的具体用法?Java SplitPane怎么用?Java SplitPane使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SplitPane类属于com.badlogic.gdx.scenes.scene2d.ui包,在下文中一共展示了SplitPane类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setup
import com.badlogic.gdx.scenes.scene2d.ui.SplitPane; //导入依赖的package包/类
public static void setup(){
registerSerializer(Actor.class, new ActorSerializer());
registerSerializer(Scene.class, new SceneSerializer());
registerSerializer(ImageJson.class, new ImageJson());
registerSerializer(Label.class, new LabelSerializer());
registerSerializer(Button.class, new ButtonSerializer());
registerSerializer(TextButton.class, new TextButtonSerializer());
registerSerializer(Table.class, new TableSerializer());
registerSerializer(CheckBox.class, new CheckBoxSerializer());
registerSerializer(SelectBox.class, new SelectBoxSerializer());
registerSerializer(List.class, new ListSerializer());
registerSerializer(Slider.class, new SliderSerializer());
registerSerializer(TextField.class, new TextFieldSerializer());
registerSerializer(Touchpad.class, new TouchpadSerializer());
registerSerializer(Sprite.class, new SpriteSerializer());
registerSerializer(Dialog.class, new DialogSerializer());
registerSerializer(SplitPane.class, new SplitPaneSerializer());
registerSerializer(ScrollPane.class, new ScrollPaneSerializer());
registerSerializer(Stack.class, new StackSerializer());
registerSerializer(Tree.class, new TreeSerializer());
registerSerializer(Table.class, new TableSerializer());
registerSerializer(ButtonGroup.class, new ButtonGroupSerializer());
registerSerializer(HorizontalGroup.class, new HorizontalGroupSerializer());
registerSerializer(VerticalGroup.class, new VerticalGroupSerializer());
}
示例2: createActor
import com.badlogic.gdx.scenes.scene2d.ui.SplitPane; //导入依赖的package包/类
@Override
public Actor createActor (Skin skin) {
// Create the semaphore
NonBlockingSemaphoreRepository.clear();
NonBlockingSemaphoreRepository.addSemaphore("dogSemaphore", 1);
Reader reader = null;
try {
// Parse Buddy's tree
reader = Gdx.files.internal("data/dogSemaphore.tree").reader();
BehaviorTreeParser<Dog> parser = new BehaviorTreeParser<Dog>(BehaviorTreeParser.DEBUG_HIGH);
BehaviorTree<Dog> buddyTree = parser.parse(reader, new Dog("Buddy"));
// Clone Buddy's tree for Snoopy
BehaviorTree<Dog> snoopyTree = (BehaviorTree<Dog>)buddyTree.cloneTask();
snoopyTree.setObject(new Dog("Snoopy"));
// Create split pane
BehaviorTreeViewer<?> buddyTreeViewer = createTreeViewer(buddyTree.getObject().name, buddyTree, false, skin);
BehaviorTreeViewer<?> snoopyTreeViewer = createTreeViewer(snoopyTree.getObject().name, snoopyTree, false, skin);
return new SplitPane(new ScrollPane(buddyTreeViewer, skin), new ScrollPane(snoopyTreeViewer, skin), true, skin,
"default-horizontal");
} finally {
StreamUtils.closeQuietly(reader);
}
}
示例3: addNormalWidgets
import com.badlogic.gdx.scenes.scene2d.ui.SplitPane; //导入依赖的package包/类
private void addNormalWidgets () {
Skin skin = VisUI.getSkin();
Label label = new Label("Lorem \nipsum \ndolor \nsit \namet", skin);
Label label2 = new Label("Consectetur \nadipiscing \nelit", skin);
VisTable table = new VisTable(true);
VisTable table2 = new VisTable(true);
table.add(label);
table2.add(label2);
SplitPane splitPane = new SplitPane(table, table2, false, skin);
add(splitPane).fill().expand();
}
示例4: MainScreen
import com.badlogic.gdx.scenes.scene2d.ui.SplitPane; //导入依赖的package包/类
public MainScreen() {
Gdx.gl.glClearColor(.3f, .3f, .3f, 1);
skin = new Skin(Gdx.files.internal("data/uiskin.json"));
stage = new Stage(new ScreenViewport());
stage.setDebugAll(DEBUG_STAGE);
// Create split pane
List<String> testList = createTestList();
ScrollPane leftScrollPane = new ScrollPane(testList, skin);
splitPane = new SplitPane(leftScrollPane, null, false, skin, "default-horizontal");
splitPane.setSplitAmount(Math.min((testList.getPrefWidth() + 10) / stage.getWidth(), splitPane.getSplit()));
// Create layout
Table t = new Table(skin);
t.setFillParent(true);
t.add(splitPane).colspan(3).grow();
t.row();
t.add(pauseButton = new PauseButton(skin)).width(90).left();
t.add(new FpsLabel("FPS: ", skin)).left();
t.add(testDescriptionLabel = new Label("", skin)).left();
stage.addActor(t);
// Set selected test
changeTest(0);
}
示例5: resetProperties
import com.badlogic.gdx.scenes.scene2d.ui.SplitPane; //导入依赖的package包/类
public void resetProperties() {
properties.clear();
if (clazz.equals(Button.class)) {
newStyleProperties(ButtonStyle.class);
} else if (clazz.equals(CheckBox.class)) {
newStyleProperties(CheckBoxStyle.class);
properties.get("checkboxOn").optional = false;
properties.get("checkboxOff").optional = false;
properties.get("font").optional = false;
} else if (clazz.equals(ImageButton.class)) {
newStyleProperties(ImageButtonStyle.class);
} else if (clazz.equals(ImageTextButton.class)) {
newStyleProperties(ImageTextButtonStyle.class);
properties.get("font").optional = false;
} else if (clazz.equals(Label.class)) {
newStyleProperties(LabelStyle.class);
properties.get("font").optional = false;
} else if (clazz.equals(List.class)) {
newStyleProperties(ListStyle.class);
properties.get("font").optional = false;
properties.get("fontColorSelected").optional = false;
properties.get("fontColorUnselected").optional = false;
properties.get("selection").optional = false;
} else if (clazz.equals(ProgressBar.class)) {
newStyleProperties(ProgressBarStyle.class);
//Though specified as optional in the doc, there are bugs without "background" being mandatory
properties.get("background").optional = false;
} else if (clazz.equals(ScrollPane.class)) {
newStyleProperties(ScrollPaneStyle.class);
} else if (clazz.equals(SelectBox.class)) {
newStyleProperties(SelectBoxStyle.class);
properties.get("font").optional = false;
properties.get("fontColor").optional = false;
properties.get("scrollStyle").optional = false;
properties.get("scrollStyle").value = "default";
properties.get("listStyle").optional = false;
properties.get("listStyle").value = "default";
} else if (clazz.equals(Slider.class)) {
newStyleProperties(SliderStyle.class);
//Though specified as optional in the doc, there are bugs without "background" being mandatory
properties.get("background").optional = false;
} else if (clazz.equals(SplitPane.class)) {
newStyleProperties(SplitPaneStyle.class);
properties.get("handle").optional = false;
} else if (clazz.equals(TextButton.class)) {
newStyleProperties(TextButtonStyle.class);
properties.get("font").optional = false;
} else if (clazz.equals(TextField.class)) {
newStyleProperties(TextFieldStyle.class);
properties.get("font").optional = false;
properties.get("fontColor").optional = false;
} else if (clazz.equals(TextTooltip.class)) {
newStyleProperties(TextTooltipStyle.class);
properties.get("label").optional = false;
properties.get("label").value = "default";
} else if (clazz.equals(Touchpad.class)) {
newStyleProperties(TouchpadStyle.class);
} else if (clazz.equals(Tree.class)) {
newStyleProperties(TreeStyle.class);
properties.get("plus").optional = false;
properties.get("minus").optional = false;
} else if (clazz.equals(Window.class)) {
newStyleProperties(WindowStyle.class);
properties.get("titleFont").optional = false;
}
}
示例6: getHandledType
import com.badlogic.gdx.scenes.scene2d.ui.SplitPane; //导入依赖的package包/类
@Override
public Class<SplitPane> getHandledType() {
return SplitPane.class;
}
示例7: process
import com.badlogic.gdx.scenes.scene2d.ui.SplitPane; //导入依赖的package包/类
@Override
public void process(final LmlParser parser, final LmlTag tag, final SplitPane actor,
final String rawAttributeData) {
actor.setSplitAmount(parser.parseFloat(rawAttributeData, actor));
}
示例8: process
import com.badlogic.gdx.scenes.scene2d.ui.SplitPane; //导入依赖的package包/类
@Override
public void process(final LmlParser parser, final LmlTag tag, final SplitPane actor,
final String rawAttributeData) {
actor.setMaxSplitAmount(parser.parseFloat(rawAttributeData, actor));
}
示例9: process
import com.badlogic.gdx.scenes.scene2d.ui.SplitPane; //导入依赖的package包/类
@Override
public void process(final LmlParser parser, final LmlTag tag, final SplitPane actor,
final String rawAttributeData) {
actor.setMinSplitAmount(parser.parseFloat(rawAttributeData, actor));
}
示例10: getNewInstanceOfActor
import com.badlogic.gdx.scenes.scene2d.ui.SplitPane; //导入依赖的package包/类
@Override
protected Actor getNewInstanceOfActor(final LmlActorBuilder builder) {
final AlignedLmlActorBuilder alignedBuilder = (AlignedLmlActorBuilder) builder;
return new SplitPane(null, null, alignedBuilder.isVertical(), getSkin(builder), alignedBuilder.getStyleName());
}
示例11: getSplitPane
import com.badlogic.gdx.scenes.scene2d.ui.SplitPane; //导入依赖的package包/类
/** @return casted widget. */
protected SplitPane getSplitPane() {
return (SplitPane) getActor();
}
示例12: read
import com.badlogic.gdx.scenes.scene2d.ui.SplitPane; //导入依赖的package包/类
@Override
public Group read(Json json, JsonValue jv, Class arg2) {
SplitPane label = new SplitPane(null, null, false, Asset.skin);
readGroup(jv, label);
return label;
}
示例13: CategoryStatsScreen
import com.badlogic.gdx.scenes.scene2d.ui.SplitPane; //导入依赖的package包/类
public CategoryStatsScreen(MissingWords missingWords) {
super(missingWords);
font = new BitmapFont(Gdx.files.internal("fonts/title.fnt"), Gdx.files.internal("fonts/title.png"), false);
fontList = new BitmapFont(Gdx.files.internal("fonts/listFont.fnt"), Gdx.files.internal("fonts/listFont.png"), false);
/* Creamos el fondo de pantalla */
background = new Background(MissingWords.myManager.get("background.png", Texture.class));
stage.addActor(background);
/* Creamos el bot�n de vuelta atr�s */
backButton = new BackButton();
backButton.addListener(new BackButtonListener(missingWords));
/* Creamos la tabla que ocupar� todo el stage (pantalla) */
stageTable = new Table();
stageTable.setFillParent(true);
/* Creamos la etiqueta de la categor�a */
title = new Label(null, new LabelStyle(font, font.getColor()));
/* Creamos el progreso de la categor�a */
progress = new Label(null, new LabelStyle(font, font.getColor()));
/* Creamos la lista de palabras de la categor�a */
list = new List<String>(new ListStyle(
fontList,
fontList.getColor(),
fontList.getColor(),
new TextureRegionDrawable(
new TextureRegion(MissingWords.myManager.get("selection.png", Texture.class)))));
/* Creamos el scroll para la lista de palabras */
ScrollPane scroll = new ScrollPane(list, new ScrollPaneStyle(new TextureRegionDrawable(
new TextureRegion(MissingWords.myManager.get("background.png", Texture.class))),
null,
null,
new TextureRegionDrawable(
new TextureRegion(MissingWords.myManager.get("verticalScroll.png", Texture.class))),
new TextureRegionDrawable(
new TextureRegion(MissingWords.myManager.get("squareBlue.png", Texture.class)))));
/* Creamos la tabla izquierda del SplitPane */
left = new Table();
left.add(title).expand();
left.row();
left.add(progress).expand();
left.row();
left.add(backButton).align(Align.left).pad(10);
/* Creamos la tabla derecha del SplitPane */
right = new Table();
right.add(scroll).fill().expand();
/* Creamos el SplitPane */
SplitPane split = new SplitPane(left, right, false, new SplitPaneStyle(
new TextureRegionDrawable(
new TextureRegion(MissingWords.myManager.get("split.png", Texture.class)))));
stageTable.add(split).fill().expand(); // A�adimos el SplitPane a la stageTable
stage.addActor(stageTable); // A�adimos la stageTable al stage
}