2003-03-18 Michael Koch <konqueror@gmx.de>

* java/awt/ScrollPane.java
	(ScrollPane): Rewrote for new ScrollPaneAdjustable.
	(getViewportSize): Likewise.
	(addNotify): Likewise.
	(removeNotify): Likewise.
	* java/awt/ScrollPaneAdjustable.java
	(ScrollPaneAdjustable): No longer extends Scrollbar.
	* java/beans/beancontext/BeanContextServices.java:
	Reformated.
	(getService): Added throws TooManyListenersException;
	* java/beans/beancontext/BeanContextServicesSupport.java:
	Reformated.

From-SVN: r64538
This commit is contained in:
Michael Koch 2003-03-18 18:16:54 +00:00 committed by Michael Koch
parent 8dfa3bb06e
commit 897db4af51
5 changed files with 223 additions and 195 deletions

View file

@ -153,8 +153,8 @@ ScrollPane(int scrollbarDisplayPolicy)
if (scrollbarDisplayPolicy != SCROLLBARS_NEVER)
{
hAdjustable = new ScrollPaneAdjustable(Scrollbar.HORIZONTAL);
vAdjustable = new ScrollPaneAdjustable(Scrollbar.VERTICAL);
hAdjustable = new ScrollPaneAdjustable (this, Scrollbar.HORIZONTAL);
vAdjustable = new ScrollPaneAdjustable (this, Scrollbar.VERTICAL);
}
wheelScrollingEnabled = true;
@ -215,23 +215,17 @@ getVAdjustable()
*
* @return The viewport size.
*/
public Dimension
getViewportSize()
public Dimension getViewportSize ()
{
Dimension viewsize = getSize();
Insets insets = getInsets();
viewsize.width = viewsize.width - (insets.left + insets.right);
viewsize.height = viewsize.height - (insets.top + insets.bottom);
ScrollPaneAdjustable v = (ScrollPaneAdjustable)getVAdjustable();
ScrollPaneAdjustable h = (ScrollPaneAdjustable)getHAdjustable();
if ((v != null) && v.isVisible())
viewsize.width = viewsize.width - v.getSize().width;
if ((h != null) && h.isVisible())
viewsize.height = viewsize.height - v.getSize().height;
return(viewsize);
Dimension viewsize = getSize ();
Insets insets = getInsets ();
viewsize.width = (viewsize.width
- (insets.left + insets.right)
- getVScrollbarWidth ());
viewsize.height = (viewsize.height
- (insets.top + insets.bottom)
- getHScrollbarHeight ());
return viewsize;
}
/*************************************************************************/
@ -347,11 +341,7 @@ addNotify()
return;
setPeer((ComponentPeer)getToolkit().createScrollPane(this));
if (hAdjustable != null)
hAdjustable.addNotify();
if (vAdjustable != null)
vAdjustable.removeNotify();
super.addNotify();
}
/*************************************************************************/
@ -362,11 +352,6 @@ addNotify()
public void
removeNotify()
{
if (hAdjustable != null)
hAdjustable.removeNotify();
if (vAdjustable != null)
vAdjustable.removeNotify();
super.removeNotify();
}

View file

@ -49,7 +49,6 @@ import java.io.Serializable;
* @since 1.4
*/
public class ScrollPaneAdjustable
extends Scrollbar
implements Adjustable, Serializable
{
private static final long serialVersionUID = -3359745691033257079L;
@ -60,13 +59,14 @@ public class ScrollPaneAdjustable
int minimum;
int maximum;
int visibleAmount;
int unitIncrement;
int blockIncrement;
int unitIncrement = 1;
int blockIncrement = 1;
AdjustmentListener adjustmentListener;
ScrollPaneAdjustable (int orientation)
ScrollPaneAdjustable (ScrollPane sp, int orientation)
{
throw new Error ("not implemented");
this.sp = sp;
this.orientation = orientation;
}
ScrollPaneAdjustable (ScrollPane sp, int orientation, int value, int minimum,