53 |
public class BasicScrollPaneUI extends ScrollPaneUI |
public class BasicScrollPaneUI extends ScrollPaneUI |
54 |
implements ScrollPaneConstants |
implements ScrollPaneConstants |
55 |
{ |
{ |
56 |
|
|
57 |
public static ComponentUI createUI(final JComponent c) |
public static ComponentUI createUI(final JComponent c) |
58 |
{ |
{ |
59 |
return new BasicScrollPaneUI(); |
return new BasicScrollPaneUI(); |
60 |
} |
} |
61 |
|
|
62 |
protected void installDefaults(JScrollPane p) |
protected void installDefaults(JScrollPane p) |
63 |
{ |
{ |
77 |
p.setBorder(null); |
p.setBorder(null); |
78 |
} |
} |
79 |
|
|
80 |
public void installUI(final JComponent c) |
public void installUI(final JComponent c) |
81 |
{ |
{ |
82 |
super.installUI(c); |
super.installUI(c); |
83 |
this.installDefaults((JScrollPane)c); |
this.installDefaults((JScrollPane)c); |
84 |
} |
} |
85 |
|
|
87 |
{ |
{ |
88 |
super.uninstallUI(c); |
super.uninstallUI(c); |
89 |
this.uninstallDefaults((JScrollPane)c); |
this.uninstallDefaults((JScrollPane)c); |
90 |
} |
} |
91 |
|
|
92 |
|
|
93 |
public Dimension getMinimumSize(JComponent c) |
public Dimension getMinimumSize(JComponent c) |
94 |
{ |
{ |
95 |
JScrollPane p = (JScrollPane ) c; |
JScrollPane p = (JScrollPane ) c; |
96 |
ScrollPaneLayout sl = (ScrollPaneLayout) p.getLayout(); |
ScrollPaneLayout sl = (ScrollPaneLayout) p.getLayout(); |
97 |
return sl.minimumLayoutSize(c); |
return sl.minimumLayoutSize(c); |
98 |
} |
} |
99 |
|
|
100 |
public Dimension getPreferredSize(JComponent c) |
public Dimension getPreferredSize(JComponent c) |
101 |
{ |
{ |
102 |
JScrollPane p = (JScrollPane ) c; |
JScrollPane p = (JScrollPane ) c; |
103 |
ScrollPaneLayout sl = (ScrollPaneLayout) p.getLayout(); |
ScrollPaneLayout sl = (ScrollPaneLayout) p.getLayout(); |
104 |
return sl.preferredLayoutSize(c); |
return sl.preferredLayoutSize(c); |
105 |
} |
} |
106 |
|
|
107 |
|
|
108 |
public void paint(Graphics g, JComponent c) |
public void paint(Graphics g, JComponent c) |
109 |
{ |
{ |
110 |
// do nothing; the normal painting-of-children algorithm, along with |
// do nothing; the normal painting-of-children algorithm, along with |
111 |
// ScrollPaneLayout, does all the relevant work. |
// ScrollPaneLayout, does all the relevant work. |
112 |
} |
} |
113 |
} |
} |
114 |
|
|
115 |
|
|