90 public int getVScrollbarWidth() { 91 return scrollbarWidth; 92 } 93 private native int _getVScrollbarWidth(); 94 95 public Point getScrollOffset() { 96 int x = getOffset(Adjustable.HORIZONTAL); 97 int y = getOffset(Adjustable.VERTICAL); 98 return new Point(x, y); 99 } 100 101 /** 102 * The child component has been resized. The scrollbars must be 103 * updated with the new sizes. At the native level the sizes of 104 * the actual windows may not have changed yet, so the size 105 * information from the java-level is passed down and used. 106 */ 107 @Override 108 public void childResized(int width, int height) { 109 ScrollPane sp = (ScrollPane)target; 110 Dimension vs = sp.getSize(); 111 setSpans(vs.width, vs.height, width, height); 112 setInsets(); 113 } 114 115 synchronized native void setSpans(int viewWidth, int viewHeight, 116 int childWidth, int childHeight); 117 118 /** 119 * Called by ScrollPane's internal observer of the scrollpane's adjustables. 120 * This is called whenever a scroll position is changed in one 121 * of adjustables, whether it was modified externally or from the 122 * native scrollbars themselves. 123 */ 124 @Override 125 public void setValue(Adjustable adj, int v) { 126 Component c = getScrollChild(); 127 if (c == null) { 128 return; 129 } 130 131 Point p = c.getLocation(); | 90 public int getVScrollbarWidth() { 91 return scrollbarWidth; 92 } 93 private native int _getVScrollbarWidth(); 94 95 public Point getScrollOffset() { 96 int x = getOffset(Adjustable.HORIZONTAL); 97 int y = getOffset(Adjustable.VERTICAL); 98 return new Point(x, y); 99 } 100 101 /** 102 * The child component has been resized. The scrollbars must be 103 * updated with the new sizes. At the native level the sizes of 104 * the actual windows may not have changed yet, so the size 105 * information from the java-level is passed down and used. 106 */ 107 @Override 108 public void childResized(int width, int height) { 109 ScrollPane sp = (ScrollPane)target; 110 if(sp.getScrollbarDisplayPolicy() != ScrollPane.SCROLLBARS_NEVER) { 111 Dimension vs = sp.getSize(); 112 setSpans(vs.width, vs.height, width, height); 113 } 114 setInsets(); 115 } 116 117 synchronized native void setSpans(int viewWidth, int viewHeight, 118 int childWidth, int childHeight); 119 120 /** 121 * Called by ScrollPane's internal observer of the scrollpane's adjustables. 122 * This is called whenever a scroll position is changed in one 123 * of adjustables, whether it was modified externally or from the 124 * native scrollbars themselves. 125 */ 126 @Override 127 public void setValue(Adjustable adj, int v) { 128 Component c = getScrollChild(); 129 if (c == null) { 130 return; 131 } 132 133 Point p = c.getLocation(); |