/[classpath]/classpath/java/awt/ScrollPane.java
ViewVC logotype

Diff of /classpath/java/awt/ScrollPane.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.14 by mkoch, Sun Mar 2 19:28:14 2003 UTC revision 1.15 by mkoch, Tue Mar 18 13:30:21 2003 UTC
# Line 153  ScrollPane(int scrollbarDisplayPolicy) Line 153  ScrollPane(int scrollbarDisplayPolicy)
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;
# Line 215  getVAdjustable() Line 215  getVAdjustable()
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  /*************************************************************************/  /*************************************************************************/
# Line 347  addNotify() Line 341  addNotify()
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  /*************************************************************************/  /*************************************************************************/
# Line 362  addNotify() Line 352  addNotify()
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    

Legend:
Removed from v.1.14  
changed lines
  Added in v.1.15

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26