-
Enhancement
-
Resolution: Won't Fix
-
P5
-
None
-
6
-
x86
-
linux
A DESCRIPTION OF THE REQUEST :
The current "javax.swing.SwingUtilities.isLeftMouseButton" method is implemented as below:
public static boolean isLeftMouseButton(MouseEvent anEvent) {
return ((anEvent.getModifiers() & InputEvent.BUTTON1_MASK) != 0);
}
Proposed "MouseEvent/isLeftButton" method:
public boolean isLeftButton() {
return ((getModifiers() & BUTTON1_MASK) != 0);
}
JUSTIFICATION :
- "MouseEvent/isLeftButton" is more convenient than SwingUtilities.isLeftMouseButton
- e.isLeftButton() is more natural than SwingUtilities.isLeftMouseButton(e)
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
CODE:
if (e.isLeftButton())...
ACTUAL -
CODE:
import javax.swing.SwingUtilities;
...
if (SwingUtilities.isLeftMouseButton(e))...
The current "javax.swing.SwingUtilities.isLeftMouseButton" method is implemented as below:
public static boolean isLeftMouseButton(MouseEvent anEvent) {
return ((anEvent.getModifiers() & InputEvent.BUTTON1_MASK) != 0);
}
Proposed "MouseEvent/isLeftButton" method:
public boolean isLeftButton() {
return ((getModifiers() & BUTTON1_MASK) != 0);
}
JUSTIFICATION :
- "MouseEvent/isLeftButton" is more convenient than SwingUtilities.isLeftMouseButton
- e.isLeftButton() is more natural than SwingUtilities.isLeftMouseButton(e)
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
CODE:
if (e.isLeftButton())...
ACTUAL -
CODE:
import javax.swing.SwingUtilities;
...
if (SwingUtilities.isLeftMouseButton(e))...