SDA SE Wiki

Software Engineering for Smart Data Analytics & Smart Data Analytics for Software Engineering

User Tools

Site Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
research:jtransformer:tutorial_old:factbase_inspector [2013/11/15 01:54]
127.0.0.1 external edit
research:jtransformer:tutorial_old:factbase_inspector [2018/05/09 01:59] (current)
Line 1: Line 1:
 +===== Factbase Inspector (FBI) ======
 +
 + ​-> ​ [[#open a factbase inspector]]\\
 + ​-> ​ [[#nodes and folders]]\\
 + ​-> ​ [[#context menu]]\\
 + ​-> ​ [[#factbase inspector options]]\\
 + ​-> ​ [[#button overview]]
 +
 +
 +----
 +
 +==== Open a Factbase Inspector ====
 +
 +There is more then one way to open a new Factbase Inspector. /*In the following we will describe the most important possibilities to open a Factbase Inspector from the Source Code / Package Explorer and the Prolog Consol.*/
 +
 +== Opening the Factbase Inspector from the Package Explorer ==
 +
 + ​Simply right-click on the file you want to open in the Factbase Inspector and choose //"​Open in Factbase Inspector"//​ from the context menu
 +
 +{{:​research:​jtransformer:​fbi_open_from_explorer.png|}}
 +
 +== Opening the Factbase Inspector from the Java Editor (Source Code)  == 
 +
 +Select the part of the source code which you want to inspect in the Factbase Inspector and right-click in the Java Editor to open the context menu. Choose //"​Open in Factbase Inspector"//​.\\ ​
 +The selection doesn'​t need to be exact.A heuristic will find the first element that includes your selection and open the corresponding fact. As you can see in the screenshot below, we selected a method, so our root in the Factbase Inspector is the corresponding methodT fact.
 +
 +{{:​research:​jtransformer:​fbi_open_from_editor.png|}}
 +
 +If you did not select anything, the whole file will be opened in the Factbase Inspector,​so the result will be equal to opening the factbase inspector from the Package Explorer. \\
 +The linking between Factbase Inspector and Java Editor works also the other way around, meaning that you can select the source code corresponding to a Node from the Factbase Inspector. See [[..:#​context menu]] - Show Source Code
 +
 +== Opening the Factbase Inspector from the Prolog Console ==
 +
 +To open a Factbase Inspector from the Prolog Console we first need an ID. For example you can open a Factbase Inspector from the result of a querry. Consider this simple querry:
 +<Code lang-prolog>?​- classT(Id, Pkg, '​B',​ Members).</​Code> ​
 +This querry matches the class with the name //'​B'//​ . The result will be something similar to: 
 +<Code lang-prolog>​
 +Id = 37953,
 +Pkg = 37091,
 +Members = [49394, 49395, 49396, 49397, 49398, 37954, 49399, 49400, 49401|...] ;
 +</​Code>​
 +Note that the precise IDs might be different on your system.
 +
 +Now select the returned as the Id for the class "​B"​ and in the context menu select //"​Open In Factbase Inspector"//:​
 +
 +{{:​research:​jtransformer:​fbi_open_from_console.png|}}
 +
 +====  ====
 +
 +---------------------------
 +
 +==== Nodes and Folders =====
 +
 +{{:​research:​jtransformer:​fbi_nodes.png|}}
 +
 +If we expand a Factbase Inspector we will see different types of Nodes. In the first level of expansion we see (for example as in the screenshot above) 3 folders.((Choose //show groups// in the [[..:#​factbase inspector options]] if you don't see the folders but only the PEFs.)) Folders are used to group nodes of the same type, in this example we have: 
 +
 +  * Comments: Includes the comments documenting this class.
 +  * Defs: Includes all facts that are defined inside this class.
 +  * Relations: Includes the relations which this class is a part of and also the modifier of this class.
 +
 +Depending on the type of the expanded node, there can be other groups (for example, "​block",​ a group that includes all the PEFs inside the block of a loop). ​
 +
 +Each node has a symbol that indicates the state of this node. \\
 +For example, a green block indicates that the element has a piece of corresponding source code. A red block means, that there is no corresponding source code (for example the implicit constructor). The red greater (">"​) and smaller ("<"​) signs in the icon tell you that the shown element has been modified. The following screenshots shows how a Factbase Inspector could look like after a transformation has been applied: ​  
 +
 +{{:​research:​jtransformer:​fbi_changed.png|}}
 +{{:​research:​jtransformer:​fbi_help.png|}}
 +
 +By clicking on the "​Factbase Inspector Help" Icon, which is indicated by the red circle in the upper screenshot, you can see a description for all node status icons used in the Factbase Inspector.
 +
 +=== Deleted nodes ===
 +{{:​research:​jtransformer:​tutorial_old:​fbi_deleted.png|Presentation of deleted nodes in the FBI}}
 +
 +The FBI can also show deleted facts and relations. They are marked with a :-: sign.
 +
 +---------------------------
 +
 +==== Context Menu ====
 +
 +You can bring up the context menu of a node by right-clicking on the node. The Context Menu entries are selection-sensitive -- depending on the selected node some actions will be active, deactivated or replaced by a node-specific variant. The context menu includes the following entries: ​
 +
 +== Show Enclosing ==
 + 
 +A sub menu allowing you to navigate the PEF model "​upwards",​ to an enclosing element of the currently selected node. In our example, a methodT fact is enclosed by a class, a compilation unit and a package.
 +
 +{{:​research:​jtransformer:​fbi_show_enclosing_new.png|}}
 +
 +== Show Source Code ==
 +
 +Opens an editor((or brings it to the front if already open)) and highlights the source code that this fact represents.
 +
 +{{:​research:​jtransformer:​fbi_show_sc.png|}}
 +{{:​research:​jtransformer:​fbi_show_sc2.png?​600px|}}
 +
 +== Show Reverse Engineered Code ==
 +
 +Shows the source code from the selected node, re-engineered from the fact representation.
 +The following screenshot shows a popup with the re-engineered source of a method after an encapsulate Field transformation (see CTs/​Encapsulate Field). Above you can see the original source (without getter and setter calls).
 +
 +|{{:​research:​jtransformer:​fbi_re_engineered_code.png|}}| |{{:​research:​jtransformer:​fbi_re_engineered_code2.png|}}|
 +
 +
 +== Copy Node to Clipboard ==
 +
 +Get a textual representation of the selected node, which you can paste into a Prolog file, as a template for a query or transformation. See [[:​research:​jtransformer:​tutorial_old:​copy_to_clipboard]] for detailed information'​s.
 +
 +== Copy NodeTerm to Clipboard ==
 + 
 +For example in the screenshot above it would copy the NodeTerm "​methodT(17411,​ 17404, myMethod, [], type(basic, void, 0), [], 17412)"​ to your clipboard.
 +
 +== Open Factbase Inspector ==
 + 
 +Displays a dialog for opening a new Factbase Inspector.
 +
 +====  ====
 +
 +
 +------------------------
 +
 +==== Factbase Inspector Options ====
 +
 +The Factbase Inspector Options let you customize your Factbase Inspector behavior and appearance. ​
 +
 +{{:​research:​jtransformer:​fbi_settings.png?​700|}}
 +
 +  * **Show references**:​ Some nodes have cross-references to other nodes. If you choose "​Current window"​ the cross-references will be displayed as children of the current node. Default is "New window",​ which means that a new Factbase Inspector with the cross-referenced node will be opened when explicitly selecting "Show referenced"​ from the context Menu of the referencing node (or by using the corresponding button, see [[..:#​button overview]]). ​
 +
 +  * **Show arguments**:​ Determines how node text should be displayed. Simply click on the possible options and watch the preview box, which displays the effect of the current choice.
 +
 +  * **Show Node-Groups**:​ If you disable this option, Nodes will not be arranged in Folders anymore (see [[..:#nodes and folders]])
 +
 +  * **Tooltip settings**: Determines the appearance of tooltips((Tooltips are additional information about the node over which you hold the mouse cursor.)) should look like. Simply click on the possible options and watch the preview box, which displays the effect of the current choice.
 +
 +  * **Show source localtion settings**: if you enable this option, the information about the source location will be added to the argument. Simply click on the possible options and watch the preview box, which displays the effect of the current choice.
 +
 +  * **Auto-Refresh settings**: Auto-refresh automatically updates your Factbase Inspector view if there are changes in the factbase. But if facts are created with a build-in Prolog predicate (e.g. "​assert"​),​ circumventing JTransformer,​ the Factbase Inspector will not be updated for these changes. In such cases you should call the predicate "​create_derived_facts"​ so that the Factbase Inspector will be notified about the changes. \\ If you check this box, auto-refresh will automatically call "​create_derived_facts"​ ever so often, ensuring consistency of the display. However, this could have some performance issues in larger projects.
 +
 +------------------------
 +
 +==== Button Overview ====
 +
 +{{:​research:​jtransformer:​fbi_buttons.png|}}
 +
 +  * **Black circle**: With these arrows you can browse back and forward through the history of the Factbase Inspector. The Factbase Inspector saves all your selections and expansions and allows you the return to old states of the view.
 +  * **Magenta circle**: This button is equal to //"​Show Referenned"//​ from the [[..:#​context menu|Context Menu]]. This button may be disabled if this action is not available for the selected Node.
 +  * **Orange circle**: This button is equal to //"​Show Source Code"//​ from the [[..:#​context menu|Context Menu]]. This button may be disabled if the selected Node has no source code.
 +  * **Yellow circle**: This button is equal to //"​Open Factbase Inspector"//​ from the [[..:#​context menu|Context Menu]].
 +  * **Blue circle**: This button open the [[..:#​factbase inspector options|Factbase Inspector Options]].
 +  * **Red circle**: This button open the Factbase Help, which shows a short information of the used node-icons in the Factbase Inspector. ​
 +  * **Green circle**: This button refreshes the Factbase Inspector. Normally this is done automatically if there are changes done to the source code or the factbase. But in some cases its necessary to do this refresh manually to be able to continue working with this Factbase Inspector instance.
 +
  
research/jtransformer/tutorial_old/factbase_inspector.txt · Last modified: 2018/05/09 01:59 (external edit)

SEWiki, © 2019