Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Visualization refactoring #587

Merged
merged 21 commits into from
May 3, 2018
Merged

Visualization refactoring #587

merged 21 commits into from
May 3, 2018

Conversation

szokolai-mate
Copy link
Collaborator

Refactoring of the visualization elements, please see commit messages for full details.

Solves:

Packages affected:

  • hu.elte.txtuml.export.papyrus
  • hu.elte.txtuml.export.javascript
  • hu.elte.txtuml.layout.export
  • hu.elte.txtuml.visualizer

New packages:

  • hu.elte.txtuml.wizards

jtamas96 and others added 19 commits February 24, 2018 10:33
Sequence diagrams now can be generated separately from other diagrams, in
a new dialog window.
Related to #536 and #560.
Diagram visualizer dialogs now have an option to show diagrams, which
extend diagram superclasses indirectly.
- Extracted static method for creating *PapyrusVisualizer* from *TxtUMLExporter*, as it would violate function separation.

- Extracted cleanup operation from *TxtUMLExporter* to abstract method in *TxtUMLVisualizeWizard*, as it has to be different for different visualization methods anyway.

- Removed `outputFolder` property from *TxtUMLExporter*.

- **moved classes to packages**:
	- hu.elte.txtuml.export.papyrus.layout.txtuml.TxtUMLExporter
		- to: *hu.elte.txtuml.layout.export*
	- hu.elte.txtuml.export.papyrus.layout.txtuml.TxtUMLLayoutDescriptor
		- to: *hu.elte.txtuml.layout.export*
	- hu.elte.txtuml.export.papyrus.layout.txtuml.LayoutExportException
		- to: *hu.elte.txtuml.layout.export*
	- hu.elte.txtuml.export.papyrus.utils.LayoutUtils
		- to: *hu.elte.txtuml.layout.export.utils*
	- hu.elte.txtuml.export.papyrus.elementsarrangers.txtumllayout.LayoutVisualizerManager
		- to: *hu.elte.txtuml.visualizer*
	- hu.elte.txtuml.export.papyrus.elementsarrangers.ArrangeException
		- to: *hu.elte.txtuml.visualizer.exceptions*
If a diagram had `Spacing` as it's first annotation, visualization failed.

Solved by removing an unnecessary check.

The modified `hu.elte.txtuml.utils.eclipse.WizardUtils.getModelByAnnotations()` checked all annotations, and discarded those not containing any class properties.
But then for some reason, if one annotation did not contain any class properties, it threw an exception instead of checking all other annotations. And throwing the exception was unnecessary anyway, since the method returns an `Optional` object, which was checked by the caller anyway.

For the above reasons I just removed the check altogether.
 - removed parameter `txtUMLLayout` from `TxtUMLVisualizeWizard.exportDiagrams()` because the first argument contained it already
 - CRUCIAL NOTE: introduced a cycle into the build path that is currently unresolved
    - you have to set this error type to warning in eclipse to compile the code
 - Removed all code duplication in the visualization process
    - introduced a new abstract class, `UML2VisualizeWizard` which represents all wizards which have a worlkflow which contains exporting to UML2, making a `TxtUMLLayoutDescriptor` and then exporting.
    - the progress monitors and the different async execution methods behaved very weirdly - Papyrus used `Job`, JS an `IProgressService. I couldn't bring both into one method
        - if I used `Job` for both, Firefox opened instead of Chrome upon JS visualization
        - if I used `IProgressService` for both, Papyrus never stopped loading
 - fixed the Papyrus visualization failure when there is already a "gen" folder present
    - the problem was solved by refreshing the folder after cleanup
 - reduced cleanup code duplication in `TxtUMLVisualizeWizard` and it's children (#582)
 - removed plug-in dependency for `export.papyrus` from `export.javascript`
 - extraced `utils.eclipse.wizards` package to `wizards` project
 - adjusted plug-in dependencies accordingly in all necessary projects
 - renamed `utils.eclipse.SaveUtils` to `utils.eclipse.EditorUtils`
    - added static method `closeEditorByPath`, which closes the editor containing the file in path, if an editor is open for the file
 - this was to fix a bug in papyrus visualization
    - if the diagrams were open in editors, upon regeneration they would be corrupted
    - now the cleanup procedure for `PapyrusVisualizeWizard` includes closing the open editors
@szokolai-mate szokolai-mate added this to the 0.7.0 milestone Apr 26, 2018
@szokolai-mate szokolai-mate removed this from the 0.7.0 milestone Apr 26, 2018
@djnemeth djnemeth self-assigned this May 2, 2018
@djnemeth
Copy link
Member

djnemeth commented May 2, 2018

Do not merge this before #574.

@djnemeth djnemeth changed the base branch from sequence-diagram-visualization-and-execution to master May 2, 2018 17:45
@djnemeth
Copy link
Member

djnemeth commented May 2, 2018

Jenkins, retest this, please.

@djnemeth
Copy link
Member

djnemeth commented May 3, 2018

@szokolai-mate, please resolve the conflicts below.

@szokolai-mate szokolai-mate merged commit b78b9e9 into master May 3, 2018
@djnemeth
Copy link
Member

djnemeth commented May 3, 2018

This pull request has been accidentally merged and should be reverted immediately.

@djnemeth djnemeth removed their request for review August 14, 2018 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants