diff options
| author | estebandlc <estebandlc@google.com> | 2015-05-02 22:02:51 -0700 |
|---|---|---|
| committer | estebandlc <estebandlc@google.com> | 2015-05-02 22:10:02 -0700 |
| commit | 36cb608ac90b021ae6253f8e8cd45a968b6c1357 (patch) | |
| tree | 172f0405aa993b9deb77f1fc2031e50831ef79b9 /chartlib | |
| parent | 04b9ef4622497e37e3e345ead7673a56f3bd4bbd (diff) | |
| download | platform_tools_base-36cb608ac90b021ae6253f8e8cd45a968b6c1357.tar.gz platform_tools_base-36cb608ac90b021ae6253f8e8cd45a968b6c1357.tar.bz2 platform_tools_base-36cb608ac90b021ae6253f8e8cd45a968b6c1357.zip | |
Removes VerticalBagLayout usages
Fixes the layout when using BoxLayout
Change-Id: Icb34034cc24b084e465cda1d5b0ed59514ede4d7
Diffstat (limited to 'chartlib')
| -rw-r--r-- | chartlib/src/test/java/AnimatedComponentVisualTests.java | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/chartlib/src/test/java/AnimatedComponentVisualTests.java b/chartlib/src/test/java/AnimatedComponentVisualTests.java index 837e3cf01a..847b88f3ff 100644 --- a/chartlib/src/test/java/AnimatedComponentVisualTests.java +++ b/chartlib/src/test/java/AnimatedComponentVisualTests.java @@ -112,7 +112,7 @@ public class AnimatedComponentVisualTests extends JDialog { }); } - static interface Value { + interface Value { void set(int v); @@ -137,6 +137,7 @@ public class AnimatedComponentVisualTests extends JDialog { panel.add(slider, BorderLayout.CENTER); panel.add(new JLabel(name + ": "), BorderLayout.WEST); panel.add(text, BorderLayout.EAST); + panel.setAlignmentX(Component.LEFT_ALIGNMENT); return panel; } @@ -146,12 +147,7 @@ public class AnimatedComponentVisualTests extends JDialog { panel.add(animated, BorderLayout.CENTER); JPanel controls = new JPanel(); - LayoutManager manager; - try { - manager = (LayoutManager) Class.forName("sun.awt.VerticalBagLayout").newInstance(); - } catch (Exception e) { - manager = new BoxLayout(controls, BoxLayout.Y_AXIS); - } + LayoutManager manager = new BoxLayout(controls, BoxLayout.Y_AXIS); controls.setLayout(manager); controls.setPreferredSize(new Dimension(300, 800)); panel.add(controls, BorderLayout.WEST); @@ -160,8 +156,8 @@ public class AnimatedComponentVisualTests extends JDialog { private static Component createButton(String label, ActionListener action) { JButton button = new JButton(label); - button.setPreferredSize(button.getPreferredSize()); button.addActionListener(action); + button.setMaximumSize(new Dimension(Integer.MAX_VALUE, button.getMaximumSize().height)); return button; } @@ -248,6 +244,7 @@ public class AnimatedComponentVisualTests extends JDialog { controls.add(createEventButton(1, events, null)); controls.add(createEventButton(2, events, variance)); + controls.add(new Box.Filler(new Dimension(0, 0), new Dimension(300, Integer.MAX_VALUE), new Dimension(300, Integer.MAX_VALUE))); panel.add(timeline, BorderLayout.CENTER); return panel; } |
