The purpose of these wiki pages is to document several aspects of the IntellijEve plugin.
Even though some of the information is targeted at simple users of the software it is mainly meant for people who would like to understand the design of the plugin.
We explain this in detail hoping that it will benefit the further development of the project.
As it can be seen in the source code directories four main packages give structure to the software:
After creating a graph in the editor one can choose the "generate code" option from the context menu.
This will initiate a call to Viewport.generateCode() which itself calls GraphFileEditor.generate().
There with the use of either the RustCodeGen or the RustAsyncCodeGen class a code skeleton is created which is followed by the creation of the graph specific code.
The editor package is by far the most complex one as it is also the one that holds most of the functionality.
It holds the data structure as well as the handling of events on the user interface including the rendering of graph elements.
Hence all that is noted here is a short clustering of the functionality of the contained classes:
elements in the user interface and holder of graph relevant data:
Node (including RootNode)
UIElement (parent class for the above)
handling of UI events:
Actions: actions triggered by keyboard shortcuts
Scene (class name Viewport): provides JPanel object that gets displayed in the IntelliJ tab
UIOperation (classes UIOperation and Operation): encapsulation of operation done by the user and on UI elements
UIElement and it descendants handle rendering themselves
rendering of graphical elements
AWTProxy (class GraphicsProxy): wrapper for AWT Graphics2D class
CubicBezierCurve: render a curved line between two points (used by Edge)
LinearAlgebra: basic classes needed for rendering and handling of 2D objects (based on Double instead of Integer values)
ListDialog: custom dialog that can display list values to choose from
Utils: these are not the methods you are looking for
Graphs that were created by the user can be saved as GraphML files.
It is a file format based on XML which allows for extension.
That was one of the reason we went for that.
There are three classes for handling the files.
One for writing a graph to a file, one for reading a graph from a file and a third one that can be used to validate whether a given file contains valid GraphML.
To integrate our functionality into IntelliJ this package contains four classes from which only two are used in the current state of the project.
Together they allow the following process to happen:
When a new file is added to a project and this file is named something.eve then because of the *.eve file ending our file editor is presented to the user.
The starting point of this is the GraphFileEditorProvider class.
Its accept() method ensures that we only deal with *.eve files.
It then returns an GraphFileEditor object via the createEditor() method.
In a former state of the project there was the ability to create a new graph file through the "New" option of IntelliJs context menu.
This was dropped due to problems with the integration.