/[classpath]/classpath/javax/swing/text/JTextComponent.java
ViewVC logotype

Diff of /classpath/javax/swing/text/JTextComponent.java

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

revision 1.30 by rabbit78, Fri May 20 19:42:31 2005 UTC revision 1.31 by rabbit78, Mon May 23 14:26:58 2005 UTC
# Line 69  import javax.swing.JComponent; Line 69  import javax.swing.JComponent;
69  import javax.swing.JViewport;  import javax.swing.JViewport;
70  import javax.swing.KeyStroke;  import javax.swing.KeyStroke;
71  import javax.swing.Scrollable;  import javax.swing.Scrollable;
72    import javax.swing.SwingConstants;
73  import javax.swing.Timer;  import javax.swing.Timer;
74  import javax.swing.TransferHandler;  import javax.swing.TransferHandler;
75  import javax.swing.UIManager;  import javax.swing.UIManager;
# Line 1130  public abstract class JTextComponent ext Line 1131  public abstract class JTextComponent ext
1131    
1132    public Dimension getPreferredScrollableViewportSize()    public Dimension getPreferredScrollableViewportSize()
1133    {    {
1134      return null;      return getPreferredSize();
1135    }    }
1136    
1137    public int getScrollableUnitIncrement(Rectangle visible, int orientation,    public int getScrollableUnitIncrement(Rectangle visible, int orientation,
1138                                          int direction)                                          int direction)
1139    {    {
1140      return 0;      // We return 1/10 of the visible area as documented in Sun's API docs.
1141        if (orientation == SwingConstants.HORIZONTAL)
1142          return visible.width / 10;
1143        else if (orientation == SwingConstants.VERTICAL)
1144          return visible.height / 10;
1145        else
1146          throw new IllegalArgumentException("orientation must be either "
1147                                          + "javax.swing.SwingConstants.VERTICAL "
1148                                          + "or "
1149                                          + "javax.swing.SwingConstants.HORIZONTAL"
1150                                             );
1151    }    }
1152    
1153    public int getScrollableBlockIncrement(Rectangle visible, int orientation,    public int getScrollableBlockIncrement(Rectangle visible, int orientation,
1154                                           int direction)                                           int direction)
1155    {    {
1156      return 0;      // We return the whole visible area as documented in Sun's API docs.
1157        if (orientation == SwingConstants.HORIZONTAL)
1158          return visible.width;
1159        else if (orientation == SwingConstants.VERTICAL)
1160          return visible.height;
1161        else
1162          throw new IllegalArgumentException("orientation must be either "
1163                                          + "javax.swing.SwingConstants.VERTICAL "
1164                                          + "or "
1165                                          + "javax.swing.SwingConstants.HORIZONTAL"
1166                                             );
1167    }    }
1168    
1169    /**    /**

Legend:
Removed from v.1.30  
changed lines
  Added in v.1.31

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