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

* java/awt/Component.java
	(eventTypeEnabled): New method.
	(dispatchEventImpl): Moved checks for event to eventTypeEnabled.
	* java/awt/Container.java
	(changeSupport): New member variable.
	(addPropertyChangeListener): New methods.
	* java/awt/ContainerOrderFocusTraversalPolicy.java
	(ContainerOrderFocusTraversalPolicy): Added comment.
	(getComponentAfter): Throw exception, documentation added.
	(getComponentBefore): Throw exception, documentation added.
	(getFirstComponent): Throw exception, documentation added.
	(getLastComponent): Throw exception, documentation added.
	(getDefaultComponent): Throw exception, documentation added.
	* java/awt/EventQueue.java: Reindented.
	* java/awt/FocusTraversalPolicy.java:
	(FocusTraversalPolicy): Added comment.
	(getComponentAfter): Documentation added.
	(getComponentBefore): Documentation added.
	(getFirstComponent): Documentation added.
	(getLastComponent): Documentation added.
	(getDefaultComponent): Documentation added.
	(getInitialComponent): Documentation added.
	* java/awt/ScrollPane.java
	(wheelScrollingEnabled): New member variable.
	(ScrollPane): Initialize wheelScollingEnabled.
	(eventTypeEnabled): New method.
	(isWheelScrollingEnabled): New method.
	(setWheelScrollingEnabled): New method.

From-SVN: r63663
This commit is contained in:
Michael Koch 2003-03-02 14:01:40 +00:00 committed by Michael Koch
parent 37db829b93
commit e589ede6fd
6 changed files with 258 additions and 100 deletions

View file

@ -38,6 +38,7 @@ exception statement from your version. */
package java.awt;
import java.awt.event.MouseEvent;
import java.awt.peer.ScrollPanePeer;
import java.awt.peer.ContainerPeer;
import java.awt.peer.ComponentPeer;
@ -105,6 +106,8 @@ private int scrollbarDisplayPolicy;
// Current scroll position
private Point scrollPosition = new Point(0, 0);
private boolean wheelScrollingEnabled;
/*************************************************************************/
/*
@ -153,6 +156,8 @@ ScrollPane(int scrollbarDisplayPolicy)
hAdjustable = new ScrollPaneAdjustable(Scrollbar.HORIZONTAL);
vAdjustable = new ScrollPaneAdjustable(Scrollbar.VERTICAL);
}
wheelScrollingEnabled = true;
}
/*************************************************************************/
@ -470,5 +475,37 @@ paramString()
return(getClass().getName());
}
/**
* Tells wether or not an event is enabled.
*
* @since 1.4
*/
public boolean eventTypeEnabled (int type)
{
if (type == MouseEvent.MOUSE_WHEEL)
return wheelScrollingEnabled;
return super.eventTypeEnabled (type);
}
/**
* Tells wether or not wheel scrolling is enabled.
*
* @since 1.4
*/
public boolean isWheelScrollingEnabled ()
{
return wheelScrollingEnabled;
}
/**
* Enables/disables wheel scrolling.
*
* @since 1.4
*/
public void setWheelScrollingEnabled (boolean enable)
{
wheelScrollingEnabled = enable;
}
} // class ScrollPane