From 5109821d5ceebe220207e08433b402922f25e42f Mon Sep 17 00:00:00 2001 From: mdb Date: Wed, 15 Jan 2003 00:47:06 +0000 Subject: [PATCH] A test app for the runtime adjustment stuff. git-svn-id: https://samskivert.googlecode.com/svn/trunk@1016 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- .../com/samskivert/util/AdjustTestApp.java | 50 +++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 projects/samskivert/tests/src/java/com/samskivert/util/AdjustTestApp.java diff --git a/projects/samskivert/tests/src/java/com/samskivert/util/AdjustTestApp.java b/projects/samskivert/tests/src/java/com/samskivert/util/AdjustTestApp.java new file mode 100644 index 00000000..5ce2e4a6 --- /dev/null +++ b/projects/samskivert/tests/src/java/com/samskivert/util/AdjustTestApp.java @@ -0,0 +1,50 @@ +// +// $Id: AdjustTestApp.java,v 1.1 2003/01/15 00:47:06 mdb Exp $ + +package com.samskivert.util; + +import java.awt.BorderLayout; +import javax.swing.BorderFactory; +import javax.swing.JComponent; +import javax.swing.JFrame; +import javax.swing.JPanel; + +/** + * Does something extraordinary. + */ +public class AdjustTestApp +{ + public static void main (String[] args) + { + Config config = new Config("test"); + new RuntimeAdjust.IntAdjust( + "This is a test adjustment. It is nice.", + "samskivert.test.int_adjust1", config, 5); + new RuntimeAdjust.IntAdjust( + "This is another test adjustment. It is nice.", + "samskivert.thwack.int_adjust2", config, 15); + new RuntimeAdjust.BooleanAdjust( + "This is a test adjustment. It is nice.", + "samskivert.thwack.boolean_adjust1", config, true); + + new RuntimeAdjust.IntAdjust( + "This is an other test adjustment. It is nice.", + "otherpackage.test.int_adjust2", config, 15); + new RuntimeAdjust.BooleanAdjust( + "This is a an other test adjustment. It is nice.", + "otherpackage.test.boolean_adjust1", config, false); + new RuntimeAdjust.EnumAdjust( + "This is yet an other test adjustment.", + "otherpackage.test.enum_adjust1", config, + new String[] { "debug", "info", "warning" }, "info"); + + JPanel editor = RuntimeAdjust.createAdjustEditor(); + JFrame frame = new JFrame(); + ((JComponent)frame.getContentPane()).setBorder( + BorderFactory.createEmptyBorder(5, 5, 5, 5)); + frame.getContentPane().add(editor, BorderLayout.CENTER); + frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + frame.pack(); + frame.show(); + } +}