X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;f=src%2Fjexer%2Fdemos%2FDemoMainWindow.java;h=7ad14fe145860ce2b9faffc68b02345eeecc485d;hb=766e7308328d2d5aa1abfe6ba61b8cc05cc05ea9;hp=1ae35f0b7dab058f42fdef8e7b6946241d00b6fe;hpb=a69ed767c9c07cf35cf1c5f7821fc009cfe79cd2;p=fanfix.git diff --git a/src/jexer/demos/DemoMainWindow.java b/src/jexer/demos/DemoMainWindow.java index 1ae35f0..7ad14fe 100644 --- a/src/jexer/demos/DemoMainWindow.java +++ b/src/jexer/demos/DemoMainWindow.java @@ -31,9 +31,6 @@ package jexer.demos; import java.io.File; import java.io.IOException; import java.text.MessageFormat; -import java.util.Calendar; -import java.util.GregorianCalendar; -import java.util.Locale; import java.util.ResourceBundle; import jexer.TAction; @@ -42,6 +39,7 @@ import jexer.TEditColorThemeWindow; import jexer.TEditorWindow; import jexer.TLabel; import jexer.TProgressBar; +import jexer.TTableWindow; import jexer.TTimer; import jexer.TWidget; import jexer.TWindow; @@ -86,17 +84,6 @@ public class DemoMainWindow extends TWindow { */ TProgressBar progressBar; - /** - * Day of week label is updated with TSpinner clicks. - */ - TLabel dayOfWeekLabel; - - /** - * Day of week to demonstrate TSpinner. Has to be at class scope so that - * it can be accessed by the anonymous TAction class. - */ - GregorianCalendar calendar = new GregorianCalendar(); - // ------------------------------------------------------------------------ // Constructors ----------------------------------------------------------- // ------------------------------------------------------------------------ @@ -191,6 +178,25 @@ public class DemoMainWindow extends TWindow { ); row += 2; + addLabel(i18n.getString("ttableLabel"), 1, row); + addButton(i18n.getString("ttableButton1"), 35, row, + new TAction() { + public void DO() { + new DemoTableWindow(getApplication(), + i18n.getString("tableWidgetDemo")); + } + } + ); + addButton(i18n.getString("ttableButton2"), 48, row, + new TAction() { + public void DO() { + new TTableWindow(getApplication(), + i18n.getString("tableDemo")); + } + } + ); + row += 2; + addLabel(i18n.getString("treeViewLabel"), 1, row); addButton(i18n.getString("treeViewButton"), 35, row, new TAction() { @@ -223,11 +229,11 @@ public class DemoMainWindow extends TWindow { } } ); - row += 2; - progressBar = addProgressBar(1, row, 22, 0); + row = 15; + progressBar = addProgressBar(48, row, 12, 0); row++; - timerLabel = addLabel(i18n.getString("timerLabel"), 1, row); + timerLabel = addLabel(i18n.getString("timerLabel"), 48, row); timer = getApplication().addTimer(250, true, new TAction() { @@ -245,33 +251,6 @@ public class DemoMainWindow extends TWindow { } ); - dayOfWeekLabel = addLabel("Wednesday-", 35, row - 1, "tmenu", false); - dayOfWeekLabel.setLabel(String.format("%-10s", - calendar.getDisplayName(Calendar.DAY_OF_WEEK, - Calendar.LONG, Locale.getDefault()))); - - addSpinner(35 + dayOfWeekLabel.getWidth(), row - 1, - new TAction() { - public void DO() { - calendar.add(Calendar.DAY_OF_WEEK, 1); - dayOfWeekLabel.setLabel(String.format("%-10s", - calendar.getDisplayName( - Calendar.DAY_OF_WEEK, Calendar.LONG, - Locale.getDefault()))); - } - }, - new TAction() { - public void DO() { - calendar.add(Calendar.DAY_OF_WEEK, -1); - dayOfWeekLabel.setLabel(String.format("%-10s", - calendar.getDisplayName( - Calendar.DAY_OF_WEEK, Calendar.LONG, - Locale.getDefault()))); - } - } - ); - - activate(first); statusBar = newStatusBar(i18n.getString("statusBar"));