View Javadoc

1   /***
2    * 
3    */
4   package org.telscenter.pas.common.ui.panel;
5   
6   import java.awt.Dimension;
7   import java.awt.Rectangle;
8   
9   import javax.swing.JPanel;
10  import javax.swing.Scrollable;
11  
12  /***
13   * @author aperritano
14   *
15   */
16  public class ScrollablePanel extends JPanel implements Scrollable {
17  
18  	/* (non-Javadoc)
19  	 * @see javax.swing.Scrollable#getPreferredScrollableViewportSize()
20  	 */
21  	public Dimension getPreferredScrollableViewportSize() {
22  		// TODO Auto-generated method stub
23  		return this.getPreferredSize();
24  	}
25  
26  	/* (non-Javadoc)
27  	 * @see javax.swing.Scrollable#getScrollableBlockIncrement(java.awt.Rectangle, int, int)
28  	 */
29  	public int getScrollableBlockIncrement(Rectangle visibleRect,
30  			int orientation, int direction) {
31  		// TODO Auto-generated method stub
32  		return 10;
33  	}
34  
35  	/* (non-Javadoc)
36  	 * @see javax.swing.Scrollable#getScrollableTracksViewportHeight()
37  	 */
38  	public boolean getScrollableTracksViewportHeight() {
39  		// TODO Auto-generated method stub
40  		return false;
41  	}
42  
43  	/* (non-Javadoc)
44  	 * @see javax.swing.Scrollable#getScrollableTracksViewportWidth()
45  	 */
46  	public boolean getScrollableTracksViewportWidth() {
47  		// TODO Auto-generated method stub
48  		return true;
49  	}
50  
51  	/* (non-Javadoc)
52  	 * @see javax.swing.Scrollable#getScrollableUnitIncrement(java.awt.Rectangle, int, int)
53  	 */
54  	public int getScrollableUnitIncrement(Rectangle visibleRect,
55  			int orientation, int direction) {
56  		// TODO Auto-generated method stub
57  		return 10;
58  	}
59  
60  }