/[classpath]/classpath/javax/swing/JScrollPane.java
ViewVC logotype

Diff of /classpath/javax/swing/JScrollPane.java

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

revision 1.17 by mkoch, Tue Jan 25 07:07:25 2005 UTC revision 1.18 by mkoch, Wed Jan 26 23:32:51 2005 UTC
# Line 99  public class JScrollPane Line 99  public class JScrollPane
99    boolean wheelScrollingEnabled;    boolean wheelScrollingEnabled;
100    ChangeListener scrollListener;      ChangeListener scrollListener;  
101    
   public static final String COLUMN_HEADER_CHANGED_PROPERTY = "columnHeader";  
   public static final String COMPONENT_ORIENTATION_CHANGED_PROPERTY = "componentOrientation";  
   public static final String HORIZONTAL_SCROLLBAR_CHANGED_PROPERTY = "horizontalScrollBar";  
   public static final String HORIZONTAL_SCROLLBAR_POLICY_CHANGED_PROPERTY = "horizontalScrollBarPolicy";  
   public static final String LAYOUT_CHANGED_PROPERTY = "layout";  
   public static final String ROW_HEADER_CHANGED_PROPERTY = "rowHeader";  
   public static final String VERTICAL_SCROLLBAR_CHANGED_PROPERTY = "verticalScrollBar";  
   public static final String VERTICAL_SCROLLBAR_POLICY_CHANGED_PROPERTY = "verticalScrollBarPolicy";  
   public static final String VIEWPORT_CHANGED_PROPERTY = "viewport";  
   public static final String VIEWPORT_BORDER_CHANGED_PROPERTY = "viewportBorder";  
   public static final String WHEEL_SCROLLING_ENABLED_CHANGED_PROPERTY = "wheelScrollingEnabled";  
   
102    public JViewport getColumnHeader()    public JViewport getColumnHeader()
103    {    {
104      return columnHeader;      return columnHeader;
# Line 247  public class JScrollPane Line 235  public class JScrollPane
235    {    {
236      ComponentOrientation old = super.getComponentOrientation();      ComponentOrientation old = super.getComponentOrientation();
237      super.setComponentOrientation(co);      super.setComponentOrientation(co);
238      firePropertyChange(COMPONENT_ORIENTATION_CHANGED_PROPERTY, old, co);      firePropertyChange("componentOrientation", old, co);
239      sync();      sync();
240    }    }
241    
242    public void setColumnHeader(JViewport h)    public void setColumnHeader(JViewport h)
243    {    {
244        if (columnHeader == h)
245          return;
246        
247      JViewport old = columnHeader;      JViewport old = columnHeader;
248      removeNonNull(old);      removeNonNull(old);
249      columnHeader = h;      columnHeader = h;
250      addNonNull(h);      addNonNull(h);
251      firePropertyChange(COLUMN_HEADER_CHANGED_PROPERTY, old, h);      firePropertyChange("columnHeader", old, h);
252      sync();      sync();
253    }    }
254    
# Line 327  public class JScrollPane Line 318  public class JScrollPane
318    
319    public void setHorizontalScrollBar(JScrollBar h)    public void setHorizontalScrollBar(JScrollBar h)
320    {    {
321        if (horizontalScrollBar == h)
322          return;
323    
324      JScrollBar old = horizontalScrollBar;      JScrollBar old = horizontalScrollBar;
325      removeNonNull(old);      removeNonNull(old);
326      horizontalScrollBar = h;      horizontalScrollBar = h;
327      addNonNull(h);      addNonNull(h);
328      firePropertyChange(HORIZONTAL_SCROLLBAR_CHANGED_PROPERTY, old, h);      firePropertyChange("horizontalScrollBar", old, h);
329      sync();      sync();
330    
331      if (old != null)      if (old != null)
# Line 349  public class JScrollPane Line 343  public class JScrollPane
343    }    }
344    
345    public void setHorizontalScrollBarPolicy(int h)    public void setHorizontalScrollBarPolicy(int h)
346    {        {
347        if (horizontalScrollBarPolicy == h)
348          return;
349        
350      if (h != HORIZONTAL_SCROLLBAR_AS_NEEDED      if (h != HORIZONTAL_SCROLLBAR_AS_NEEDED
351          && h != HORIZONTAL_SCROLLBAR_NEVER          && h != HORIZONTAL_SCROLLBAR_NEVER
352          && h != HORIZONTAL_SCROLLBAR_ALWAYS)          && h != HORIZONTAL_SCROLLBAR_ALWAYS)
353        throw new IllegalArgumentException("unknown horizontal scrollbar policy");            throw new IllegalArgumentException("unknown horizontal scrollbar policy");    
354    
355      int old = horizontalScrollBarPolicy;      int old = horizontalScrollBarPolicy;
356      horizontalScrollBarPolicy = h;      horizontalScrollBarPolicy = h;
357      firePropertyChange(HORIZONTAL_SCROLLBAR_POLICY_CHANGED_PROPERTY, old, h);      firePropertyChange("horizontalScrollBarPolicy", old, h);
358      sync();      sync();
359    }    }
360    
# Line 366  public class JScrollPane Line 364  public class JScrollPane
364      ScrollPaneLayout tmp = (ScrollPaneLayout) l;      ScrollPaneLayout tmp = (ScrollPaneLayout) l;
365      super.setLayout(l);      super.setLayout(l);
366      tmp.syncWithScrollPane(this);      tmp.syncWithScrollPane(this);
367      firePropertyChange(LAYOUT_CHANGED_PROPERTY, old, l);      firePropertyChange("layout", old, l);
368      sync();      sync();
369    }    }
370    
371    public void setRowHeader(JViewport v)    public void setRowHeader(JViewport v)
372    {    {
373        if (rowHeader == v)
374          return;
375        
376      JViewport old = rowHeader;      JViewport old = rowHeader;
377      removeNonNull(old);      removeNonNull(old);
378      rowHeader = v;      rowHeader = v;
379      addNonNull(v);      addNonNull(v);
380      firePropertyChange(ROW_HEADER_CHANGED_PROPERTY, old, v);      firePropertyChange("rowHeader", old, v);
381      sync();      sync();
382    }    }
383    
# Line 390  public class JScrollPane Line 391  public class JScrollPane
391    
392    public void setVerticalScrollBar(JScrollBar v)    public void setVerticalScrollBar(JScrollBar v)
393    {    {
394        if (verticalScrollBar == v)
395          return;
396        
397      JScrollBar old = verticalScrollBar;      JScrollBar old = verticalScrollBar;
398      removeNonNull(old);      removeNonNull(old);
399      verticalScrollBar = v;      verticalScrollBar = v;
400      addNonNull(v);      addNonNull(v);
401      firePropertyChange(VERTICAL_SCROLLBAR_CHANGED_PROPERTY, old, v);      firePropertyChange("verticalScrollBar", old, v);
402      sync();      sync();
403    
404      if (old != null)      if (old != null)
# Line 413  public class JScrollPane Line 417  public class JScrollPane
417    
418    public void setVerticalScrollBarPolicy(int v)    public void setVerticalScrollBarPolicy(int v)
419    {    {
420        if (verticalScrollBarPolicy == v)
421          return;
422        
423      if (v != VERTICAL_SCROLLBAR_AS_NEEDED      if (v != VERTICAL_SCROLLBAR_AS_NEEDED
424          && v != VERTICAL_SCROLLBAR_NEVER          && v != VERTICAL_SCROLLBAR_NEVER
425          && v != VERTICAL_SCROLLBAR_ALWAYS)          && v != VERTICAL_SCROLLBAR_ALWAYS)
426        throw new IllegalArgumentException("unknown vertical scrollbar policy");            throw new IllegalArgumentException("unknown vertical scrollbar policy");    
427        
428      int old = verticalScrollBarPolicy;      int old = verticalScrollBarPolicy;
429      verticalScrollBarPolicy = v;      verticalScrollBarPolicy = v;
430      firePropertyChange(VERTICAL_SCROLLBAR_POLICY_CHANGED_PROPERTY, old, v);      firePropertyChange("verticalScrollBarPolicy", old, v);
431      sync();      sync();
432    }    }
433    
434    public void setWheelScrollingEnabled(boolean b)    public void setWheelScrollingEnabled(boolean b)
435    {    {
436        if (wheelScrollingEnabled == b)
437          return;
438        
439      boolean old = wheelScrollingEnabled;      boolean old = wheelScrollingEnabled;
440      wheelScrollingEnabled = b;      wheelScrollingEnabled = b;
441      firePropertyChange(WHEEL_SCROLLING_ENABLED_CHANGED_PROPERTY, old, b);      firePropertyChange("wheelScrollingEnabled", old, b);
442      sync();      sync();
443    }    }
444    
445    public void setViewport(JViewport v)    public void setViewport(JViewport v)
446    {    {
447        if (viewport == v)
448          return;
449        
450      JViewport old = viewport;      JViewport old = viewport;
451      removeNonNull(old);      removeNonNull(old);
452      if (old != null)      if (old != null)
# Line 443  public class JScrollPane Line 457  public class JScrollPane
457      addNonNull(v);      addNonNull(v);
458      revalidate();      revalidate();
459      repaint();      repaint();
460      firePropertyChange(VIEWPORT_CHANGED_PROPERTY, old, v);      firePropertyChange("viewport", old, v);
461      sync();      sync();
462    }    }
463    
464    public void setViewportBorder(Border b)    public void setViewportBorder(Border b)
465    {    {
466        if (viewportBorder == b)
467          return;
468        
469      Border old = viewportBorder;      Border old = viewportBorder;
470      viewportBorder = b;      viewportBorder = b;
471      firePropertyChange(VIEWPORT_BORDER_CHANGED_PROPERTY, old, b);      firePropertyChange("viewportBorder", old, b);
472      sync();      sync();
473    }    }
474            

Legend:
Removed from v.1.17  
changed lines
  Added in v.1.18

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