United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
JDK-4421515 : Need changes to new InputEvent modifier APIs

Details
Type:
Bug
Submit Date:
2001-03-04
Status:
Resolved
Updated Date:
2001-08-08
Project Name:
JDK
Resolved Date:
2001-08-08
Component:
client-libs
OS:
generic,windows_2000
Sub-Component:
java.awt
CPU:
x86,generic
Priority:
P2
Resolution:
Fixed
Affected Versions:
1.2.0,1.3.1,1.4.0
Fixed Versions:
1.4.0 (beta2)

Related Reports
Duplicate:
Duplicate:
Relates:

Sub Tasks

Description
Based on  a Design Review meeting held between Swing and AWT, the 
following changes were recommended:  

The CHANGED mask values should be removed.  

A new modifer, ALT_GRAPH_DOWN should be added.  

Extensive documentation should be added to explain how to use the new APIs, 
with examples.  

Here is a list of places where the CHANGED mask is used.  


echawkes@jano:/net/jano/export/disk03/awt/echawkes/jdk14-52/src( 99 )% findref -skipdir SCCS BUTTON | grep CHANGED
./share/classes/java/awt/event/InputEvent.java(125):     public static final int BUTTON1_CHANGED_MASK = 1 << 13;
./share/classes/java/awt/event/InputEvent.java(130):     public static final int BUTTON2_CHANGED_MASK = 1 << 14;
./share/classes/java/awt/event/InputEvent.java(135):     public static final int BUTTON3_CHANGED_MASK = 1 << 15;
./share/classes/java/awt/event/MouseEvent.java(345):    if ((modifiers & BUTTON1_CHANGED_MASK) != 0) {
./share/classes/java/awt/event/MouseEvent.java(347):    } else if ((modifiers & BUTTON2_CHANGED_MASK) != 0) {
./share/classes/java/awt/event/MouseEvent.java(349):    } else if ((modifiers & BUTTON3_CHANGED_MASK) != 0) {
./share/classes/java/awt/event/MouseEvent.java(431):            modifiers |= BUTTON1_CHANGED_MASK;
./share/classes/java/awt/event/MouseEvent.java(437):            modifiers |= BUTTON2_CHANGED_MASK;
./share/classes/java/awt/event/MouseEvent.java(443):            modifiers |= BUTTON3_CHANGED_MASK;

./solaris/native/sun/awt/canvas.c(755):         return java_awt_event_InputEvent_BUTTON1_CHANGED_MASK
./solaris/native/sun/awt/canvas.c(758):         return java_awt_event_InputEvent_BUTTON2_CHANGED_MASK
./solaris/native/sun/awt/canvas.c(761):         return java_awt_event_InputEvent_BUTTON3_CHANGED_MASK
./solaris/classes/sun/awt/motif/MMouseDragGestureRecognizer.java(73):         InputEvent.BUTTON1_CHANGED_MASK | 
./solaris/classes/sun/awt/motif/MMouseDragGestureRecognizer.java(74):         InputEvent.BUTTON2_CHANGED_MASK | 
./solaris/classes/sun/awt/motif/MMouseDragGestureRecognizer.java(75):         InputEvent.BUTTON3_CHANGED_MASK |
./win32/native/sun/windows/awt_Choice.cpp(190):     if (id == java_awt_event_MouseEvent_MOUSE_PRESSED && !(modifiers & java_awt_event_InputEvent_BUTTON1_CHANGED_MASK)) {
./win32/native/sun/windows/awt_Choice.cpp(194):     if (id == java_awt_event_MouseEvent_MOUSE_RELEASED && !(modifiers & java_awt_event_InputEvent_BUTTON1_CHANGED_MASK)) {
./win32/native/sun/windows/awt_Component.cpp(1958):         modifiers |= java_awt_event_InputEvent_BUTTON1_CHANGED_MASK;
./win32/native/sun/windows/awt_Component.cpp(1961):         modifiers |= java_awt_event_InputEvent_BUTTON3_CHANGED_MASK;
./win32/native/sun/windows/awt_Component.cpp(1964):         modifiers |= java_awt_event_InputEvent_BUTTON2_CHANGED_MASK;
./win32/classes/sun/awt/windows/WMouseDragGestureRecognizer.java(69):         InputEvent.BUTTON1_CHANGED_MASK |


                                    

Comments
CONVERTED DATA

BugTraq+ Release Management Values

COMMIT TO FIX:
merlin-beta2

FIXED IN:
merlin-beta2

INTEGRATED IN:
merlin-beta2


                                     
2004-06-14
EVALUATION

Commit to fix in Merlin-beta (need to finalize new merlin APIs before 
beta is released).  
eric.hawkes@eng 2001-03-04

See Comments for a long email containing my summary of the issue.  
It sounds as though the solution people want is a new constructor 
for MouseEvent with a new field: button.  
Fortunately, we already have an excellent getter method for this field: 
MouseEvent.getButton() 

eric.hawkes@eng 2001-04-11

We decided to add a new ctor to InputEvent, MouseEvent, and KeyEvent 
containing a field for the DOWN modifers.  The MouseEvent ctor will also need 
a field for the button that initiated the event (replaces the CHANGED masks).  

We'll also need a getter method for the new field that carries the DOWN  modifers.  
 
When we do this, we'll need to update the docs about the new and old modifiers. 
The docs should also warn developers that not all mice have three buttons, 
and that they should write code that provides an alternate way of emulating 
three button mice.  (This task is for Sharon, with help from us.)

eric.hawkes@eng 2001-04-13
                                     
2001-04-13



Hardware and Software, Engineered to Work Together