|
|
|
# Analyzing Java applications
|
|
|
|
|
|
|
|
## Project structure
|
|
|
|
|
|
|
|
Two main directories are important in DEAL:
|
|
|
|
* **src** - contains **source code** of DEAL. When creating any custom handlers, they should be created in this directory.
|
|
|
|
* **examples** - contains examples of **target applications** which can be analysed by DEAL.
|
|
|
|
|
|
|
|
## Introductory examples
|
|
|
|
|
|
|
|
In the DEAL prototype there are a few examples of target applications prepared in the examples directory. The target applications are open source Java applications downloaded from web (*.**jar** files).
|
|
|
|
|
|
|
|
### Person form
|
|
|
|
|
|
|
|
**Person form** is a simple Java application example which was created for the purpose of testing. It is a simple form for inserting information about a person.
|
|
|
|
|
|
|
|
1. To **run** DEAL analysis on the Person form **select the DEALprototype project** in Eclipse.
|
|
|
|
2. Click with the right mouse button and select **Run As -> AspectJ/Java Application**.
|
|
|
|

|
|
|
|
3. The important part of running DEAL analysis on existing applications is, that you have to know **the main class of the application, which you want to analyse**.
|
|
|
|
This you can get by **unzipping the jar of the target application** (rename it first to *.zip) and looking into the **manifest** file located in the unzipped directory. Don't forget to rename the zip file back to *.jar again.
|
|
|
|
4. In the **Select Java Application** dialog write **"Pers"** into the text field. Then select PersonForm_spinner from the list of matching items and click **OK**.
|
|
|
|

|
|
|
|
5. **Person Form** application (on the left) will start along with the DEAL analyser (on the right).
|
|
|
|

|
|
|
|
6. Other examples can be launched exactly in the same way, but it is important to select the main class of the target application which you would like to launch. Please see the next section to know the main classes of the provided examples.
|
|
|
|
|
|
|
|
## Other Examples
|
|
|
|
|
|
|
|
Each of the examples packed in the **example** directory of the DEALprototype project can be started this way. The main task here is only to know the target application main class. Here we list all examples of open source Java applications packed in DEAL and their main classes for the purpose of trying any examples.
|
|
|
|
|
|
|
|
| **Target application name** | **Application description** | **Main class** |
|
|
|
|
|----------------------------|-------------------------------------------------------------------------------------------------|--------------------------------------------|
|
|
|
|
| BaseFormApplication | A testing app - contains different kinds of Java components, which can be tested in DEAL. | `baseformapplication.BaseFormApplication` |
|
|
|
|
| Java Scientific Calculator | A calculator with advanced mathematical functions. | `jscicalc.CalculatorApplet` |
|
|
|
|
| Finanx | Financial calculator. | `view.HP12CStarter` |
|
|
|
|
| Guitar Scale Assistant | A graphical application made for scaling different types of guitars and practising guitar tabs. | `GuitarKey` |
|
|
|
|
| Jars Browser | Browser of jar libraries. | `org.jarsbrowser.JarsBrowser` |
|
|
|
|
| Java NotePad | A simple Java notepad. | `JavaNotePad` |
|
|
|
|
| jEdit | A simple editor for Java programming language. | `org.gjt.sp.jedit.jEdit` |
|
|
|
|
| Person Form | An example of an input form for information about a person. | `PersonForm_spinner` |
|
|
|
|
| SweetHome3D | Application for 3D modelling of houses. | `com.eteks.sweethome3d.SweetHome3DBootstrap` |
|
|
|
|
| TimeSlotTracker | Application to register your time. | `net.sf.timeslottracker.Starter` |
|
|
|
|
|
|
|
|
# Load-time Weaving
|
|
|
|
|
|
|
|
Some applications (such as SweetHome3D) have their own **class loaders** and DEAL can not start them in a regular AspectJ weaving process. They have to be started in a `load-time weaving mode`. Please see a simple example of how to configure Eclipse to run SweetHome3D in the [Load-Time Weaving section](/load-time-weaving).
|
|
|
|
|
|
|
|
# How does it work?
|
|
|
|
|
|
|
|
To see the detailed description of DEAL, see section [How does DEAL work](/how-does-deal-work).
|
|
|
|
|
|
|
|
## Highlighting
|
|
|
|
|
|
|
|
DEAL tool provides highlighting features to be able to find the appropriate component in the target application, the Component tree or in the Term graph. For more information about this feature see section [Highlighting](/highlighting).
|
|
|
|
|
|
|
|
## Recording
|
|
|
|
|
|
|
|
DEAL can record user events performed on the target application. For more information about recording see section [Recording](/recording).
|
|
|
|
|
|
|
|
## Generating Domain-Specific Languages
|
|
|
|
|
|
|
|
With DEAL, it is possible to generate a Domain-Specific Language (DSL) from the GUI of an existing application. For more information see section [Generating DSLs](/generating-dsls).
|
|
|
|
|
|
|
|
## Generating Ontologies
|
|
|
|
|
|
|
|
With DEAL, it is possible to generate an Ontology from the GUI of an existing application. For more information see section [Generating Ontologies](/generating-ontologes).
|
|
|
|
|
|
|
|
## Generating new Graphical User Interfaces
|
|
|
|
|
|
|
|
| under construction
|
|
|
|
|
|
|
|
## Running custom examples
|
|
|
|
|
|
|
|
In case you would like to run DEAL on your own example, you have to have a ***.jar** file of such an application.
|
|
|
|
|
|
|
|
1. Copy the **jar** file of your application into the **examples** directory of the DEALproject (for example Total Commander or Windows Explorer).
|
|
|
|
2. In Eclipse right-click on the DEALproject and select **Refresh**. Your **jar** should appear in the examples folder of the DEALproject in Eclipse.
|
|
|
|
3. Right-click on your **jar** in Eclipse and select **AspectJ Tools -> Add to Inpath**.
|
|
|
|
4. To run DEAL with your application run it according to the tutorial but in the step (4.) select the main class of your **jar** application.
|
|
|
|
|
|
|
|
Applications often contain custom components. Therefore, when running custom examples, creation of custom handlers is needed. For more information about creating custom handlers, see section [Creating custom handlers](/creating-custom-handlers).
|
|
|
|
|
|
|
|
If you experience any issues during analysis, please see section [Troubleshooting](/troubleshooting) or [contact the support](/contact). |
|
|
|
\ No newline at end of file |