summaryrefslogtreecommitdiff
path: root/libjava/javax/swing/plaf/basic/BasicScrollPaneUI.java
diff options
context:
space:
mode:
authorbryce <bryce@138bc75d-0d04-0410-961f-82ee72b054a4>2002-08-09 04:26:17 +0000
committerbryce <bryce@138bc75d-0d04-0410-961f-82ee72b054a4>2002-08-09 04:26:17 +0000
commit71946bc3b406beb3d1fb9b447204e4236d645c43 (patch)
treecdf9958b411887bead2263ea8ef0bdfc8eae6319 /libjava/javax/swing/plaf/basic/BasicScrollPaneUI.java
parent0fc014c9ce8232f14be66144bf5a4c08a3e5ffe7 (diff)
downloadgcc-71946bc3b406beb3d1fb9b447204e4236d645c43.tar.gz
AWT/Swing merge from GNU Classpath.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@56147 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/javax/swing/plaf/basic/BasicScrollPaneUI.java')
-rw-r--r--libjava/javax/swing/plaf/basic/BasicScrollPaneUI.java66
1 files changed, 66 insertions, 0 deletions
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);
+ }
+}
+
+
+
+
+
+
+
+
+
+
+
+