153 |
|
|
154 |
if (scrollbarDisplayPolicy != SCROLLBARS_NEVER) |
if (scrollbarDisplayPolicy != SCROLLBARS_NEVER) |
155 |
{ |
{ |
156 |
hAdjustable = new ScrollPaneAdjustable(Scrollbar.HORIZONTAL); |
hAdjustable = new ScrollPaneAdjustable (this, Scrollbar.HORIZONTAL); |
157 |
vAdjustable = new ScrollPaneAdjustable(Scrollbar.VERTICAL); |
vAdjustable = new ScrollPaneAdjustable (this, Scrollbar.VERTICAL); |
158 |
} |
} |
159 |
|
|
160 |
wheelScrollingEnabled = true; |
wheelScrollingEnabled = true; |
215 |
* |
* |
216 |
* @return The viewport size. |
* @return The viewport size. |
217 |
*/ |
*/ |
218 |
public Dimension |
public Dimension getViewportSize () |
|
getViewportSize() |
|
219 |
{ |
{ |
220 |
Dimension viewsize = getSize(); |
Dimension viewsize = getSize (); |
221 |
Insets insets = getInsets(); |
Insets insets = getInsets (); |
222 |
viewsize.width = viewsize.width - (insets.left + insets.right); |
viewsize.width = (viewsize.width |
223 |
viewsize.height = viewsize.height - (insets.top + insets.bottom); |
- (insets.left + insets.right) |
224 |
|
- getVScrollbarWidth ()); |
225 |
ScrollPaneAdjustable v = (ScrollPaneAdjustable)getVAdjustable(); |
viewsize.height = (viewsize.height |
226 |
ScrollPaneAdjustable h = (ScrollPaneAdjustable)getHAdjustable(); |
- (insets.top + insets.bottom) |
227 |
|
- getHScrollbarHeight ()); |
228 |
if ((v != null) && v.isVisible()) |
return viewsize; |
|
viewsize.width = viewsize.width - v.getSize().width; |
|
|
if ((h != null) && h.isVisible()) |
|
|
viewsize.height = viewsize.height - v.getSize().height; |
|
|
|
|
|
return(viewsize); |
|
229 |
} |
} |
230 |
|
|
231 |
/*************************************************************************/ |
/*************************************************************************/ |
341 |
return; |
return; |
342 |
|
|
343 |
setPeer((ComponentPeer)getToolkit().createScrollPane(this)); |
setPeer((ComponentPeer)getToolkit().createScrollPane(this)); |
344 |
|
super.addNotify(); |
|
if (hAdjustable != null) |
|
|
hAdjustable.addNotify(); |
|
|
if (vAdjustable != null) |
|
|
vAdjustable.removeNotify(); |
|
345 |
} |
} |
346 |
|
|
347 |
/*************************************************************************/ |
/*************************************************************************/ |
352 |
public void |
public void |
353 |
removeNotify() |
removeNotify() |
354 |
{ |
{ |
|
if (hAdjustable != null) |
|
|
hAdjustable.removeNotify(); |
|
|
if (vAdjustable != null) |
|
|
vAdjustable.removeNotify(); |
|
|
|
|
355 |
super.removeNotify(); |
super.removeNotify(); |
356 |
} |
} |
357 |
|
|