|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object abbot.editor.recorder.SemanticRecorder abbot.editor.recorder.ComponentRecorder
public class ComponentRecorder
Record basic semantic events you might find on any component. This class handles the following actions:
Field Summary |
---|
Fields inherited from class abbot.editor.recorder.SemanticRecorder |
---|
events |
Fields inherited from interface abbot.editor.recorder.SemanticEvents |
---|
SE_ANY, SE_CLICK, SE_DRAG, SE_DROP, SE_IM, SE_KEY, SE_MENU, SE_NONE, SE_TEXT, SE_WINDOW |
Constructor Summary | |
---|---|
ComponentRecorder(Resolver resolver)
Create a ComponentRecorder for use in capturing the semantics of a GUI action. |
Method Summary | |
---|---|
boolean |
accept(AWTEvent event)
Returns whether this ComponentRecorder wishes to accept the given event. |
protected boolean |
canDrag()
Default to recording a drag if it looks like one. |
protected boolean |
canMultipleClick()
Default to waiting for multiple clicks. |
protected Step |
createAWTMenuSelection(Component parent,
MenuItem menuItem,
boolean isPopup)
|
protected Step |
createClick(Component target,
int x,
int y,
int mods,
int count)
Create a click event with the given event information. |
protected Step |
createDrag(Component comp,
int x,
int y)
|
protected Step |
createDrop(Component comp,
int x,
int y)
|
protected Step |
createInputMethod(Component comp,
ArrayList codes,
String text)
|
protected Step |
createKey(Component comp,
char keychar,
int mods)
|
protected Step |
createMenuSelection(Component menuItem)
|
protected Step |
createPopupMenuSelection(Component invoker,
int x,
int y,
Component menuItem)
|
protected Step |
createStep()
Returns the script step generated from the events recorded so far. |
protected Step |
createWindowEvent(Window window,
boolean isClose)
Create a wait for the window show/hide. |
protected boolean |
dragStarted(Component target,
int x,
int y,
int modifiers,
MouseEvent dragEvent)
Returns whether the first drag motion event should be consumed. |
protected ComponentLocation |
getLocation(Component c,
int x,
int y)
Obtain a more precise location than the given coordinate, if possible. |
protected String |
getLocationArgument(Component c,
int x,
int y)
Obtain the String representation of the Component-specific location. |
protected void |
init(int recordingType)
|
protected boolean |
isClick(AWTEvent event)
Test whether the given event is a trigger for a mouse button click. |
protected boolean |
isClose(AWTEvent event)
Does the given event indicate a window was closed? |
protected boolean |
isDragDrop(AWTEvent event)
Test whether the given event precurses a drop. |
protected boolean |
isKeyTyped(AWTEvent event)
|
protected boolean |
isMenuEvent(AWTEvent event)
|
protected boolean |
isOpen(AWTEvent event)
Does the given event indicate a window was shown? |
protected boolean |
isToolTip(Object source)
Return true if the given event source is a tooltip. |
protected boolean |
isWindowEvent(AWTEvent event)
Test whether the given event is a trigger for a window event. |
boolean |
parse(AWTEvent event)
Handle an event. |
protected boolean |
parseClick(AWTEvent event)
Provide standard parsing of mouse button events. |
protected boolean |
parseDrop(AWTEvent event)
|
protected boolean |
parseInputMethod(AWTEvent event)
|
protected boolean |
parseKeyEvent(AWTEvent e)
|
protected boolean |
parseMenuSelection(AWTEvent event)
Base implementation handles context (popup) menus. |
protected boolean |
parseWindowEvent(AWTEvent event)
|
protected void |
setFinished(boolean state)
Invoke when end of the semantic event has been seen. |
Methods inherited from class abbot.editor.recorder.SemanticRecorder |
---|
addActionListener, getRecordingType, getResolver, getStep, isFinished, record, setRecordingType, setStatus, setStep |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ComponentRecorder(Resolver resolver)
Method Detail |
---|
protected boolean isOpen(AWTEvent event)
protected boolean isClose(AWTEvent event)
public boolean accept(AWTEvent event)
accept
in class SemanticRecorder
protected boolean isWindowEvent(AWTEvent event)
protected boolean isToolTip(Object source)
TODO: emit steps to confirm value of tooltip?
source
- the object to examine
protected boolean isMenuEvent(AWTEvent event)
protected boolean isKeyTyped(AWTEvent event)
protected boolean isClick(AWTEvent event)
protected boolean isDragDrop(AWTEvent event)
protected boolean canDrag()
protected boolean canMultipleClick()
protected boolean parseClick(AWTEvent event)
protected boolean parseWindowEvent(AWTEvent event)
protected boolean parseKeyEvent(AWTEvent e)
protected boolean parseMenuSelection(AWTEvent event)
protected boolean parseDrop(AWTEvent event)
protected boolean parseInputMethod(AWTEvent event)
public boolean parse(AWTEvent event)
parse
in class SemanticRecorder
protected boolean dragStarted(Component target, int x, int y, int modifiers, MouseEvent dragEvent)
protected Step createStep()
createStep
in class SemanticRecorder
protected Step createWindowEvent(Window window, boolean isClose)
protected Step createMenuSelection(Component menuItem)
protected Step createAWTMenuSelection(Component parent, MenuItem menuItem, boolean isPopup)
protected Step createPopupMenuSelection(Component invoker, int x, int y, Component menuItem)
protected Step createKey(Component comp, char keychar, int mods)
protected Step createDrop(Component comp, int x, int y)
protected Step createDrag(Component comp, int x, int y)
protected Step createClick(Component target, int x, int y, int mods, int count)
protected Step createInputMethod(Component comp, ArrayList codes, String text)
protected void init(int recordingType)
init
in class SemanticRecorder
protected void setFinished(boolean state)
setFinished
in class SemanticRecorder
protected String getLocationArgument(Component c, int x, int y)
protected ComponentLocation getLocation(Component c, int x, int y)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |