diff options
author | nobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-07-15 16:39:52 +0000 |
---|---|---|
committer | nobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1999-07-15 16:39:52 +0000 |
commit | 2325b338766316babe9c0343e378fa3a24c9f32b (patch) | |
tree | db208a2657302e9308ef1fb6157ce6059f1a65fb /java/gjt/test/RowLayoutTest.java | |
parent | 9f29df04f390576fd4ff1c68d9a006ff543b46a5 (diff) | |
download | ATCD-ACE-4_6_45.tar.gz |
This commit was manufactured by cvs2svn to create tag 'ACE-4_6_45'.ACE-4_6_45
Diffstat (limited to 'java/gjt/test/RowLayoutTest.java')
-rw-r--r-- | java/gjt/test/RowLayoutTest.java | 124 |
1 files changed, 0 insertions, 124 deletions
diff --git a/java/gjt/test/RowLayoutTest.java b/java/gjt/test/RowLayoutTest.java deleted file mode 100644 index eb7b419ca17..00000000000 --- a/java/gjt/test/RowLayoutTest.java +++ /dev/null @@ -1,124 +0,0 @@ -package gjt.test; - -import java.applet.Applet; -import java.net.URL; -import java.awt.*; -import gjt.*; - -/** - * Lays out 3 image buttons, and provides controls for setting - * orientations and gaps on the fly.<p> - * - * @version 1.0, April 25, 1996 - * @author David Geary - * @see gjt.test.UnitTest - * @see gjt.ImageButton - * @see gjt.Box - */ -public class RowLayoutTest extends UnitTest { - public String title() { - return "RowLayout Test"; - } - public Panel centerPanel() { - RowButtonPanel buttonPanel = new RowButtonPanel(this); - Panel panel = new Panel(); - - panel.setLayout(new BorderLayout()); - panel.add("Center", buttonPanel); - panel.add("North", new Box(new RowPicker(buttonPanel), - "Row Layout Settings")); - return panel; - } -} - -class RowButtonPanel extends Panel implements DialogClient { - private ImageButton one, two, three; - private Panel panel = new Panel(); - private TenPixelBorder border = new TenPixelBorder(panel); - - public RowButtonPanel(Applet applet) { - URL cb = applet.getCodeBase(); - - one = new ImageButton(applet.getImage(cb, - "gifs/one.gif")); - two = new ImageButton(applet.getImage(cb, - "gifs/two.gif")); - three = new ImageButton(applet.getImage(cb, - "gifs/three.gif")); - - panel.setLayout(new RowLayout(0)); - panel.add(one); - panel.add(two); - panel.add(three); - - setLayout(new BorderLayout()); - add ("Center", border); - } - public void updateOrientations(Orientation horient, - Orientation vorient, - int gap) { - panel.setLayout(new RowLayout(horient, vorient, gap)); - border.validate(); - } - public void dialogDismissed(Dialog d) { } -} - -class RowPicker extends Panel { - private Label horientLabel = new Label("Horizontal:"); - private Label vorientLabel = new Label("Vertical:"); - private Label gapLabel = new Label("Gap:"); - - private Choice hchoice = new Choice(); - private Choice vchoice = new Choice(); - private Choice gapChoice = new Choice(); - - private RowButtonPanel buttonPanel; - - public RowPicker(RowButtonPanel buttonPanel) { - Panel orientations = new Panel(); - Panel gap = new Panel(); - - this.buttonPanel = buttonPanel; - hchoice.addItem("left"); - hchoice.addItem("center"); - hchoice.addItem("right"); - hchoice.select(1); - - vchoice.addItem("top"); - vchoice.addItem("center"); - vchoice.addItem("bottom"); - vchoice.select(1); - - gapChoice.addItem("0"); - gapChoice.addItem("5"); - gapChoice.addItem("10"); - gapChoice.addItem("15"); - gapChoice.addItem("20"); - - orientations.add(horientLabel); - orientations.add(hchoice); - orientations.add(vorientLabel); - orientations.add(vchoice); - - gap.add(gapLabel); - gap.add(gapChoice); - - add(new Box(orientations, "Orientations")); - add(new Box(gap, "Gap")); - } - public boolean action(Event event, Object what) { - String horient, vorient; - int gap; - - horient = hchoice.getSelectedItem(); - vorient = vchoice.getSelectedItem(); - gap = - (new Integer(gapChoice.getSelectedItem())).intValue(); - - buttonPanel.updateOrientations( - Orientation.fromString(horient), - Orientation.fromString(vorient), gap); - - return true; - } -} |