From 64355cce3c1d6c11f442781fe465639f80a4d1f9 Mon Sep 17 00:00:00 2001 From: mdb Date: Wed, 25 Sep 2002 07:26:19 +0000 Subject: [PATCH] Added some new make[HV]Box variants. git-svn-id: https://samskivert.googlecode.com/svn/trunk@851 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- .../com/samskivert/swing/GroupLayout.java | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/projects/samskivert/src/java/com/samskivert/swing/GroupLayout.java b/projects/samskivert/src/java/com/samskivert/swing/GroupLayout.java index 016137a7..0f3abb81 100644 --- a/projects/samskivert/src/java/com/samskivert/swing/GroupLayout.java +++ b/projects/samskivert/src/java/com/samskivert/swing/GroupLayout.java @@ -1,5 +1,5 @@ // -// $Id: GroupLayout.java,v 1.5 2002/05/16 02:02:38 mdb Exp $ +// $Id: GroupLayout.java,v 1.6 2002/09/25 07:26:19 mdb Exp $ // // samskivert library - useful routines for java programs // Copyright (C) 2001 Michael Bayne @@ -324,6 +324,16 @@ public abstract class GroupLayout return new JPanel(new HGroupLayout()); } + /** + * Creates a {@link JPanel} that is configured with an {@link + * HGroupLayout} with a configuration that stretches in both + * directions, with the specified gap. + */ + public static JPanel makeHStretchBox (int gap) + { + return new JPanel(new HGroupLayout(STRETCH, STRETCH, gap, CENTER)); + } + /** * Creates a {@link JPanel} that is configured with an {@link * HGroupLayout} with the specified on-axis policy (default @@ -397,6 +407,16 @@ public abstract class GroupLayout DEFAULT_GAP, justification)); } + /** + * Creates a {@link JPanel} that is configured with an {@link + * VGroupLayout} with a configuration that stretches in both + * directions, with the specified gap. + */ + public static JPanel makeVStretchBox (int gap) + { + return new JPanel(new VGroupLayout(STRETCH, STRETCH, gap, CENTER)); + } + protected int _policy = NONE; protected int _offpolicy = CONSTRAIN; protected int _gap = DEFAULT_GAP;