From 71946bc3b406beb3d1fb9b447204e4236d645c43 Mon Sep 17 00:00:00 2001 From: bryce Date: Fri, 9 Aug 2002 04:26:17 +0000 Subject: AWT/Swing merge from GNU Classpath. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@56147 138bc75d-0d04-0410-961f-82ee72b054a4 --- .../javax/swing/plaf/basic/BasicScrollPaneUI.java | 66 ++++++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 libjava/javax/swing/plaf/basic/BasicScrollPaneUI.java (limited to 'libjava/javax/swing/plaf/basic/BasicScrollPaneUI.java') diff --git a/libjava/javax/swing/plaf/basic/BasicScrollPaneUI.java b/libjava/javax/swing/plaf/basic/BasicScrollPaneUI.java new file mode 100644 index 00000000000..8d50b046e2e --- /dev/null +++ b/libjava/javax/swing/plaf/basic/BasicScrollPaneUI.java @@ -0,0 +1,66 @@ +package javax.swing.plaf.basic; + + +import javax.swing.plaf.*; +import javax.swing.*; +import java.awt.*; + + + +public class BasicScrollPaneUI extends ScrollPaneUI +{ + int min_w = 50; + int min_h = 50; + + public static ComponentUI createUI(final JComponent c) + { + return new BasicScrollPaneUI(); + } + + + public void installUI(final JComponent c) + { + super.installUI(c); + } + + + public Dimension getPreferredSize(JComponent c) + { + JScrollPane p = (JScrollPane ) c; + + Dimension d = new Dimension(min_w, + min_h); + + Dimension a = p.getViewport().getPreferredSize(); + + if (a != null) + { + d.width = Math.max(d.width, a.width); + d.height = Math.max(d.height, a.height); + } + + + System.out.println("BasicScrollPaneUI->preff->"+d); + return d; + } + + public void paint(Graphics g, JComponent c) + { + System.out.println("BasicScrollPaneUI->paint()->"+c); + + JScrollPane p = (JScrollPane ) c; + p.getViewport().paint(g); + } +} + + + + + + + + + + + + -- cgit v1.2.1