203 visibleAmount = Math.max(visibleAmount, 1); 204 blockIncrement = Math.max((int)(visible * .90), 1); 205 setValue(value); 206 } 207 208 /** 209 * Returns the orientation of this scrollbar. 210 * @return the orientation of this scrollbar, either 211 * <code>Adjustable.HORIZONTAL</code> or 212 * <code>Adjustable.VERTICAL</code> 213 */ 214 public int getOrientation() { 215 return orientation; 216 } 217 218 /** 219 * This method should <strong>NOT</strong> be called by user code. 220 * This method is public for this class to properly implement 221 * <code>Adjustable</code> interface. 222 * 223 * @throws <code>AWTError</code> Always throws an error when called. 224 */ 225 public void setMinimum(int min) { 226 throw new AWTError(SCROLLPANE_ONLY); 227 } 228 229 public int getMinimum() { 230 // XXX: This relies on setSpan always being called with 0 for 231 // the minimum (which is currently true). 232 return 0; 233 } 234 235 /** 236 * This method should <strong>NOT</strong> be called by user code. 237 * This method is public for this class to properly implement 238 * <code>Adjustable</code> interface. 239 * 240 * @throws <code>AWTError</code> Always throws an error when called. 241 */ 242 public void setMaximum(int max) { 243 throw new AWTError(SCROLLPANE_ONLY); 244 } 245 246 public int getMaximum() { 247 return maximum; 248 } 249 250 public synchronized void setUnitIncrement(int u) { 251 if (u != unitIncrement) { 252 unitIncrement = u; 253 if (sp.peer != null) { 254 ScrollPanePeer peer = (ScrollPanePeer) sp.peer; 255 peer.setUnitIncrement(this, u); 256 } 257 } 258 } 259 260 public int getUnitIncrement() { 261 return unitIncrement; 262 } 263 264 public synchronized void setBlockIncrement(int b) { 265 blockIncrement = b; 266 } 267 268 public int getBlockIncrement() { 269 return blockIncrement; 270 } 271 272 /** 273 * This method should <strong>NOT</strong> be called by user code. 274 * This method is public for this class to properly implement 275 * <code>Adjustable</code> interface. 276 * 277 * @throws <code>AWTError</code> Always throws an error when called. 278 */ 279 public void setVisibleAmount(int v) { 280 throw new AWTError(SCROLLPANE_ONLY); 281 } 282 283 public int getVisibleAmount() { 284 return visibleAmount; 285 } 286 287 288 /** 289 * Sets the <code>valueIsAdjusting</code> property. 290 * 291 * @param b new adjustment-in-progress status 292 * @see #getValueIsAdjusting 293 * @since 1.4 294 */ 295 public void setValueIsAdjusting(boolean b) { 296 if (isAdjusting != b) { 297 isAdjusting = b; | 203 visibleAmount = Math.max(visibleAmount, 1); 204 blockIncrement = Math.max((int)(visible * .90), 1); 205 setValue(value); 206 } 207 208 /** 209 * Returns the orientation of this scrollbar. 210 * @return the orientation of this scrollbar, either 211 * <code>Adjustable.HORIZONTAL</code> or 212 * <code>Adjustable.VERTICAL</code> 213 */ 214 public int getOrientation() { 215 return orientation; 216 } 217 218 /** 219 * This method should <strong>NOT</strong> be called by user code. 220 * This method is public for this class to properly implement 221 * <code>Adjustable</code> interface. 222 * 223 * @throws AWTError Always throws an error when called. 224 */ 225 public void setMinimum(int min) { 226 throw new AWTError(SCROLLPANE_ONLY); 227 } 228 229 public int getMinimum() { 230 // XXX: This relies on setSpan always being called with 0 for 231 // the minimum (which is currently true). 232 return 0; 233 } 234 235 /** 236 * This method should <strong>NOT</strong> be called by user code. 237 * This method is public for this class to properly implement 238 * <code>Adjustable</code> interface. 239 * 240 * @throws AWTError Always throws an error when called. 241 */ 242 public void setMaximum(int max) { 243 throw new AWTError(SCROLLPANE_ONLY); 244 } 245 246 public int getMaximum() { 247 return maximum; 248 } 249 250 public synchronized void setUnitIncrement(int u) { 251 if (u != unitIncrement) { 252 unitIncrement = u; 253 if (sp.peer != null) { 254 ScrollPanePeer peer = (ScrollPanePeer) sp.peer; 255 peer.setUnitIncrement(this, u); 256 } 257 } 258 } 259 260 public int getUnitIncrement() { 261 return unitIncrement; 262 } 263 264 public synchronized void setBlockIncrement(int b) { 265 blockIncrement = b; 266 } 267 268 public int getBlockIncrement() { 269 return blockIncrement; 270 } 271 272 /** 273 * This method should <strong>NOT</strong> be called by user code. 274 * This method is public for this class to properly implement 275 * <code>Adjustable</code> interface. 276 * 277 * @throws AWTError Always throws an error when called. 278 */ 279 public void setVisibleAmount(int v) { 280 throw new AWTError(SCROLLPANE_ONLY); 281 } 282 283 public int getVisibleAmount() { 284 return visibleAmount; 285 } 286 287 288 /** 289 * Sets the <code>valueIsAdjusting</code> property. 290 * 291 * @param b new adjustment-in-progress status 292 * @see #getValueIsAdjusting 293 * @since 1.4 294 */ 295 public void setValueIsAdjusting(boolean b) { 296 if (isAdjusting != b) { 297 isAdjusting = b; |