Sometimes when pressing a GUI button (subclass of
javax.swing.Jbutton) with the mouse (using the left
mouse key), the xmlrecorder does not record anything.
Mouse events (java.awt.AWTEvent) show the problem
occurs when mouse drag events are created. So the
problem occurs when JFCEventManager.processEventData
receives a MOUSE_PRESSED followed by one or more
MOUSE_DRAGGED, followed by a MOUSE_RELEASED.
In JFCEventManager the code that seems to be causing
the problem is the JFCEventManager.convertDrag method
execution: On the MOUSE_DRAGGED,
JFCEventManager.processEventData calls
JFCEventManager.convertDrag which replaces the good
m_pendingEvent with a new DragEventData.
Here is an example of mouse events input into
JFCEventManager.processEventData that caused the problem:
1.
java.awt.event.MouseEvent[MOUSE_PRESSED,(34,26),button=1,modifiers=Button1,extModifiers=Button1,clickCount=1]
on
org.zink.apps.ConfirmPanel$DialogButton[,60,5,50x30,layout=javax.swing.OverlayLayout,alignmentX=0.0,alignmentY=0.5,border=javax.swing.plaf.BorderUIResource$CompoundBorderUIResource@6c137c,flags=416,maximumSize=,minimumSize=,preferredSize=,defaultIcon=file:/C:/dev/abtex/aspects/lib/org/zink/images/Ok24.gif,disabledIcon=,disabledSelectedIcon=,margin=java.awt.Insets[top=0,left=10,bottom=0,right=10],paintBorder=true,paintFocus=true,pressedIcon=,rolloverEnabled=false,rolloverIcon=,rolloverSelectedIcon=,selectedIcon=,text=null,defaultCapable=true]
2.
java.awt.event.MouseEvent[MOUSE_DRAGGED,(34,25),button=0,modifiers=Button1,extModifiers=Button1,clickCount=0]
on
org.zink.apps.ConfirmPanel$DialogButton[,60,5,50x30,layout=javax.swing.OverlayLayout,alignmentX=0.0,alignmentY=0.5,border=javax.swing.plaf.BorderUIResource$CompoundBorderUIResource@6c137c,flags=416,maximumSize=,minimumSize=,preferredSize=,defaultIcon=file:/C:/dev/abtex/aspects/lib/org/zink/images/Ok24.gif,disabledIcon=,disabledSelectedIcon=,margin=java.awt.Insets[top=0,left=10,bottom=0,right=10],paintBorder=true,paintFocus=true,pressedIcon=,rolloverEnabled=false,rolloverIcon=,rolloverSelectedIcon=,selectedIcon=,text=null,defaultCapable=true]
3.
java.awt.event.MouseEvent[MOUSE_RELEASED,(34,25),button=1,modifiers=Button1,clickCount=1]
on
org.zink.apps.ConfirmPanel$DialogButton[,60,5,50x30,layout=javax.swing.OverlayLayout,alignmentX=0.0,alignmentY=0.5,border=javax.swing.plaf.BorderUIResource$CompoundBorderUIResource@6c137c,flags=416,maximumSize=,minimumSize=,preferredSize=,defaultIcon=file:/C:/dev/abtex/aspects/lib/org/zink/images/Ok24.gif,disabledIcon=,disabledSelectedIcon=,margin=java.awt.Insets[top=0,left=10,bottom=0,right=10],paintBorder=true,paintFocus=true,pressedIcon=,rolloverEnabled=false,rolloverIcon=,rolloverSelectedIcon=,selectedIcon=,text=null,defaultCapable=true]
There is no problem when the mouse events are clean of
MOUSE_DRAGGED events. In this case XMLRecorder goes
ahead and produces the xml of the click on the GUI
button as expected.
This is a list of button presses that sometimes do not
get recorded:
1. A shaky button press. This is where you jerk the
mouse as you are pressing the mouse key.
2. Sliding button press. This is where you slide to the
GUI button and continue sliding as you press the mouse key.
If someone is trying to produce recordings quickly,
this rapidly becomes problematic. I loose the button
click about 50% of the time.
To recreate the problem: Turn on recording in the xml
file. Place the mouse pointer on a GUI button, press
the left mouse button, quickly move the mouse over the
GUI button a little ways and release the left mouse
button. Check the output xml file. The click element
may be missing be missing. Try it a few times till it
is missing.
Environment Windows XP, Jdk 1.4.2,
Thanks for all your help.