-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More documentation for the new ripping methods
- Loading branch information
1 parent
677b70f
commit 5273415
Showing
2 changed files
with
79 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,10 +38,12 @@ | |
import edu.umd.cs.guitar.util.GUITARLog; | ||
|
||
/** | ||
* Executing class for SWTRipper | ||
* Adapts a {@link Ripper} for use with SWT GUIs. | ||
* | ||
* @author Gabe Gorelick | ||
* @author <a href="mailto:[email protected]"> Matt Kirn </a> | ||
* @author <a href="mailto:[email protected]"> Alex Loeb </a> | ||
* | ||
*/ | ||
public class SWTRipper extends SWTGuitarExecutor { | ||
|
||
|
@@ -50,25 +52,38 @@ public class SWTRipper extends SWTGuitarExecutor { | |
private final Ripper ripper; | ||
|
||
/** | ||
* Constructs a new <code>SWTRipper</code>. This constructor is equivalent | ||
* to <code>SWTRipper(config, Thread.currentThread())</code>. Consequently, | ||
* this constructor must be called on the same thread that the application | ||
* under test is running on (usually the <code>main</code> thread). | ||
* Constructs a new <code>SWTRipper</code>. This constructor is equivalent | ||
* to | ||
* | ||
* <pre> | ||
* SWTRipper(config, Thread.currentThread()) | ||
* </pre> | ||
* | ||
* Consequently, this constructor must be called on the same thread that the | ||
* application under test is running on (usually the <code>main</code> | ||
* thread). | ||
* | ||
* @param config | ||
* @param appThread thread the application under test runs on | ||
* configuration | ||
* | ||
* @see SWTApplicationRunner | ||
*/ | ||
public SWTRipper(SWTRipperConfiguration config) { | ||
this(config, Thread.currentThread()); | ||
} | ||
|
||
/** | ||
* Constructs a new <code>SWTRipper</code>. The thread passed in is the | ||
* thread on which the SWT application under test runs. This is almost | ||
* always the main thread and actually must be the main thread on Cocoa. | ||
* thread on which the SWT application under test runs. This is almost | ||
* always the <code>main</code> thread (and actually must be the | ||
* <code>main</code> thread on Cocoa). | ||
* | ||
* @param config | ||
* @param guiThread thread the GUI runs on | ||
* configuration | ||
* @param guiThread | ||
* thread the GUI runs on | ||
* | ||
* @see SWTApplicationRunner | ||
*/ | ||
public SWTRipper(SWTRipperConfiguration config, Thread guiThread) { | ||
super(config, guiThread); | ||
|
@@ -97,8 +112,11 @@ private Ripper initRipper() { | |
} | ||
|
||
/** | ||
* Execute the SWT ripper. | ||
* Execute the ripper. | ||
* | ||
* @see Ripper#execute() | ||
*/ | ||
@Override | ||
protected void onExecute() { | ||
try { | ||
ripper.execute(); | ||
|
@@ -107,6 +125,10 @@ protected void onExecute() { | |
} | ||
} | ||
|
||
/** | ||
* Log the results of ripping. | ||
*/ | ||
@Override | ||
protected void onAfterExecute() { | ||
GUIStructure dGUIStructure = ripper.getResult(); | ||
IO.writeObjToFile(dGUIStructure, config.getGuiFile()); | ||
|