Java Doc for ComponentRecorder.java in  » Testing » abbot-1.0.1 » abbot » editor » recorder » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Testing » abbot 1.0.1 » abbot.editor.recorder 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   abbot.editor.recorder.SemanticRecorder
      abbot.editor.recorder.ComponentRecorder

All known Subclasses:   abbot.editor.recorder.CheckboxRecorder,  abbot.editor.recorder.ButtonRecorder,  abbot.editor.recorder.ContainerRecorder,  abbot.editor.recorder.ChoiceRecorder,
ComponentRecorder
public class ComponentRecorder extends SemanticRecorder (Code)
Record basic semantic events you might find on any component. This class handles the following actions:

  • window actions
  • popup menus
  • click
  • typed keys
  • basic drag and drop
  • InputMethod events (extended character input)
Clicks, popup menus, and drag/drop actions may be based on coordinates or component substructure (cell, row, tab, etc) locations.

Window Actions

While these nominally might be handled in a WindowRecorder, they are so common that it's easier to handle here instead. Currently supports tracking show/hide/activate. TODO: move/resize/iconfify/deiconify.

Popup Menus

Currently only the click/select/click sequence is supported. The press/drag/release version shouldn't be hard to implement, though.

Click

Simple press/release on a component, storing the exact coordinate of the click. Most things with selectability will want to override this. Culling accidental intervening drags would be nice but probably not worth the effort or complexity (better just to be less sloppy with your mouse).

Key Type

Capture only events that result in actual output. No plain modifiers, shortcuts, or mnemonics.

Drag/Drop

Basic drag from one component and drop on another, storing exact coordinates of the press/release actions. Should definitely override this to represent your component's internal objects (e.g. cells in a table). Note that these are two distinct actions, even though they always appear together. The source is responsible for identifying the drag, and the target is responsible for identifying the drop.

InputMethod

Catch extended character input.



Constructor Summary
public  ComponentRecorder(Resolver resolver)
     Create a ComponentRecorder for use in capturing the semantics of a GUI action.

Method Summary
public  booleanaccept(AWTEvent event)
     Returns whether this ComponentRecorder wishes to accept the given event.
protected  booleancanDrag()
     Default to recording a drag if it looks like one.
protected  booleancanMultipleClick()
     Default to waiting for multiple clicks.
protected  StepcreateAWTMenuSelection(Component parent, MenuItem menuItem, boolean isPopup)
    
protected  StepcreateClick(Component target, int x, int y, int mods, int count)
     Create a click event with the given event information.
protected  StepcreateDrag(Component comp, int x, int y)
    
protected  StepcreateDrop(Component comp, int x, int y)
    
protected  StepcreateInputMethod(Component comp, ArrayList codes, String text)
    
protected  StepcreateKey(Component comp, char keychar, int mods)
    
protected  StepcreateMenuSelection(Component menuItem)
    
protected  StepcreatePopupMenuSelection(Component invoker, int x, int y, Component menuItem)
    
protected  StepcreateStep()
     Returns the script step generated from the events recorded so far.
protected  StepcreateWindowEvent(Window window, boolean isClose)
     Create a wait for the window show/hide.
protected  booleandragStarted(Component target, int x, int y, int modifiers, MouseEvent dragEvent)
     Returns whether the first drag motion event should be consumed.
protected  ComponentLocationgetLocation(Component c, int x, int y)
     Obtain a more precise location than the given coordinate, if possible.
protected  StringgetLocationArgument(Component c, int x, int y)
     Obtain the String representation of the Component-specific location.
protected  voidinit(int recordingType)
    
protected  booleanisClick(AWTEvent event)
     Test whether the given event is a trigger for a mouse button click.
protected  booleanisClose(AWTEvent event)
    
protected  booleanisDragDrop(AWTEvent event)
     Test whether the given event precurses a drop.
protected  booleanisKeyTyped(AWTEvent event)
    
protected  booleanisMenuEvent(AWTEvent event)
    
protected  booleanisOpen(AWTEvent event)
    
protected  booleanisToolTip(Object source)
     Return true if the given event source is a tooltip.
protected  booleanisWindowEvent(AWTEvent event)
     Test whether the given event is a trigger for a window event.
public  booleanparse(AWTEvent event)
     Handle an event.
protected  booleanparseClick(AWTEvent event)
     Provide standard parsing of mouse button events.
protected  booleanparseDrop(AWTEvent event)
    
protected  booleanparseInputMethod(AWTEvent event)
    
protected  booleanparseKeyEvent(AWTEvent e)
    
protected  booleanparseMenuSelection(AWTEvent event)
     Base implementation handles context (popup) menus.
protected  booleanparseWindowEvent(AWTEvent event)
    
protected  voidsetFinished(boolean state)
     Invoke when end of the semantic event has been seen.


Constructor Detail
ComponentRecorder
public ComponentRecorder(Resolver resolver)(Code)
Create a ComponentRecorder for use in capturing the semantics of a GUI action.




Method Detail
accept
public boolean accept(AWTEvent event)(Code)
Returns whether this ComponentRecorder wishes to accept the given event. If the event is accepted, the recorder must invoke init() with the appropriate semantic event type.



canDrag
protected boolean canDrag()(Code)
Default to recording a drag if it looks like one.



canMultipleClick
protected boolean canMultipleClick()(Code)
Default to waiting for multiple clicks.



createAWTMenuSelection
protected Step createAWTMenuSelection(Component parent, MenuItem menuItem, boolean isPopup)(Code)



createClick
protected Step createClick(Component target, int x, int y, int mods, int count)(Code)
Create a click event with the given event information.



createDrag
protected Step createDrag(Component comp, int x, int y)(Code)



createDrop
protected Step createDrop(Component comp, int x, int y)(Code)



createInputMethod
protected Step createInputMethod(Component comp, ArrayList codes, String text)(Code)



createKey
protected Step createKey(Component comp, char keychar, int mods)(Code)



createMenuSelection
protected Step createMenuSelection(Component menuItem)(Code)



createPopupMenuSelection
protected Step createPopupMenuSelection(Component invoker, int x, int y, Component menuItem)(Code)



createStep
protected Step createStep()(Code)
Returns the script step generated from the events recorded so far.



createWindowEvent
protected Step createWindowEvent(Window window, boolean isClose)(Code)
Create a wait for the window show/hide. Use an appropriate identifier string, which might be the name, title, or component reference.



dragStarted
protected boolean dragStarted(Component target, int x, int y, int modifiers, MouseEvent dragEvent)(Code)
Returns whether the first drag motion event should be consumed. Derived classes may override this to provide custom drag behavior. Default behavior saves the drag initiation event by itself.



getLocation
protected ComponentLocation getLocation(Component c, int x, int y)(Code)
Obtain a more precise location than the given coordinate, if possible.



getLocationArgument
protected String getLocationArgument(Component c, int x, int y)(Code)
Obtain the String representation of the Component-specific location.



init
protected void init(int recordingType)(Code)



isClick
protected boolean isClick(AWTEvent event)(Code)
Test whether the given event is a trigger for a mouse button click. Allow derived classes to change definition of a click.



isClose
protected boolean isClose(AWTEvent event)(Code)
Does the given event indicate a window was closed?



isDragDrop
protected boolean isDragDrop(AWTEvent event)(Code)
Test whether the given event precurses a drop.



isKeyTyped
protected boolean isKeyTyped(AWTEvent event)(Code)



isMenuEvent
protected boolean isMenuEvent(AWTEvent event)(Code)



isOpen
protected boolean isOpen(AWTEvent event)(Code)
Does the given event indicate a window was shown?



isToolTip
protected boolean isToolTip(Object source)(Code)
Return true if the given event source is a tooltip. Such events look like window events, but we check for them before other kinds of window events so as to be able to filter them out.

TODO: emit steps to confirm value of tooltip?


Parameters:
  source - the object to examine true if this event source is a tooltip




isWindowEvent
protected boolean isWindowEvent(AWTEvent event)(Code)
Test whether the given event is a trigger for a window event. Allow derived classes to change definition of a click.



parse
public boolean parse(AWTEvent event)(Code)
Handle an event. Return whether the event was consumed.



parseClick
protected boolean parseClick(AWTEvent event)(Code)
Provide standard parsing of mouse button events.



parseDrop
protected boolean parseDrop(AWTEvent event)(Code)



parseInputMethod
protected boolean parseInputMethod(AWTEvent event)(Code)



parseKeyEvent
protected boolean parseKeyEvent(AWTEvent e)(Code)



parseMenuSelection
protected boolean parseMenuSelection(AWTEvent event)(Code)
Base implementation handles context (popup) menus.



parseWindowEvent
protected boolean parseWindowEvent(AWTEvent event)(Code)



setFinished
protected void setFinished(boolean state)(Code)
Invoke when end of the semantic event has been seen.



Fields inherited from abbot.editor.recorder.SemanticRecorder
protected ArrayList events(Code)(Java Doc)

Methods inherited from abbot.editor.recorder.SemanticRecorder
abstract public boolean accept(AWTEvent event)(Code)(Java Doc)
public void addActionListener(ActionListener al)(Code)(Java Doc)
abstract protected Step createStep()(Code)(Java Doc)
public int getRecordingType()(Code)(Java Doc)
protected Resolver getResolver()(Code)(Java Doc)
public synchronized Step getStep() throws BugReport(Code)(Java Doc)
protected void init(int recordingType)(Code)(Java Doc)
public synchronized boolean isFinished()(Code)(Java Doc)
abstract public boolean parse(AWTEvent event)(Code)(Java Doc)
final public boolean record(java.awt.AWTEvent event)(Code)(Java Doc)
protected synchronized void setFinished(boolean state)(Code)(Java Doc)
protected void setRecordingType(int type)(Code)(Java Doc)
protected void setStatus(String msg)(Code)(Java Doc)
protected synchronized void setStep(Step newStep)(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.