Commit 4319ce9 1 parent 399d026 commit 4319ce9 Copy full SHA for 4319ce9
File tree 2 files changed +40
-0
lines changed
stripe/src/com/ray3k/stripe
2 files changed +40
-0
lines changed Original file line number Diff line number Diff line change 2
2
* Updated to libGDX 1.12.1
3
3
* Updated source compatibility to Java 8
4
4
* Added CollapsibleGroup
5
+ * Added ToggleGroup
5
6
* Fixed KeepSizedWithinStage in PopTable
6
7
* Fixed issues with PopTable focus
7
8
* Other minor PopTable bug fixes
Original file line number Diff line number Diff line change
1
+ package com .ray3k .stripe ;
2
+
3
+ import com .badlogic .gdx .scenes .scene2d .ui .Container ;
4
+ import com .badlogic .gdx .scenes .scene2d .ui .Table ;
5
+
6
+ /**
7
+ * A layout widget that can be programmatically changed to display one of two tables. This is useful in user interfaces
8
+ * that need to display alternate layouts depending on certain criteria.
9
+ */
10
+ public class ToggleGroup extends Container <Table > {
11
+ public Table table1 = new Table ();
12
+ public Table table2 = new Table ();
13
+ public boolean showingTable1 ;
14
+
15
+ public ToggleGroup () {
16
+ showTable1 ();
17
+ fill ();
18
+ }
19
+
20
+ public void showTable1 () {
21
+ setActor (table1 );
22
+ showingTable1 = true ;
23
+ }
24
+
25
+ public void showTable2 () {
26
+ setActor (table2 );
27
+ showingTable1 = false ;
28
+ }
29
+
30
+ public void swap () {
31
+ if (showingTable1 ) showTable2 ();
32
+ else showTable1 ();
33
+ }
34
+
35
+ @ Override @ Deprecated
36
+ public void setActor (Table table ) {
37
+ super .setActor (table );
38
+ }
39
+ }
You can’t perform that action at this time.
0 commit comments