69 |
JViewport vp = (JViewport)parent; |
JViewport vp = (JViewport)parent; |
70 |
Component view = vp.getView(); |
Component view = vp.getView(); |
71 |
if (view != null) |
if (view != null) |
72 |
return view.getPreferredSize(); |
{ |
73 |
|
if (view instanceof Scrollable) |
74 |
|
return ((Scrollable)view).getPreferredScrollableViewportSize(); |
75 |
|
return view.getPreferredSize(); |
76 |
|
} |
77 |
else |
else |
78 |
return new Dimension(); |
return new Dimension(); |
79 |
} |
} |
124 |
|
|
125 |
JViewport port = (JViewport) parent; |
JViewport port = (JViewport) parent; |
126 |
Component view = port.getView(); |
Component view = port.getView(); |
127 |
|
|
128 |
if (view == null) |
if (view == null) |
129 |
return; |
return; |
130 |
|
|
143 |
if (portBounds.height >= viewMinimum.height) |
if (portBounds.height >= viewMinimum.height) |
144 |
{ |
{ |
145 |
portBounds.y = 0; |
portBounds.y = 0; |
146 |
viewPref.height = portBounds.height; |
if ( !(view instanceof Scrollable) || ((Scrollable)view).getScrollableTracksViewportHeight()) |
147 |
|
viewPref.height = portBounds.height; |
148 |
} |
} |
149 |
else |
else |
150 |
{ |
{ |
158 |
if (portBounds.width >= viewMinimum.width) |
if (portBounds.width >= viewMinimum.width) |
159 |
{ |
{ |
160 |
portBounds.x = 0; |
portBounds.x = 0; |
161 |
viewPref.width = portBounds.width; |
if ( !(view instanceof Scrollable) || ((Scrollable)view).getScrollableTracksViewportWidth()) |
162 |
|
viewPref.width = portBounds.width; |
163 |
} |
} |
164 |
else |
else |
165 |
{ |
{ |