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

Fix model loader crash and animation layer activation #199

Merged
merged 3 commits into from
Aug 10, 2021

Conversation

dvojtise
Copy link
Contributor

@dvojtise dvojtise commented Aug 4, 2021

Description

  • Add support to load Sirius models containing representations other than diagrams (ie. Table, ...)
    (Actually, ignore other representations as we don't know how to animate them)
  • Fix animation layer activation on startup. The layer was not correctly detected as activated ( need to consider both diagram.getActivatedLayers() and diagram.getActivatedTransientLayers() )

Contribution to issues

Fixes #197

contributes to
#197



Signed-off-by: Didier Vojtisek <didier.vojtisek@inria.fr>
consider both ActivatedLayers and ActivatedTransientLayers

Signed-off-by: Didier Vojtisek <didier.vojtisek@inria.fr>
@dvojtise dvojtise added the bug label Aug 4, 2021
openEditorSubMonitor.newChild(1));
ToolManagement toolManagement = DiagramPlugin.getDefault().getToolManagement(diagram);
toolManagement.addToolFilter(new ToolFilter() {
if(representation instanceof DSemanticDiagram) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is in fact almost the only real change introduced in the PR, correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right for item 1 of the description
for item 2 see my second comment

|| layerName.equalsIgnoreCase("Animation");
boolean mustBeActive = mustBeActiveForAnimation || mustBeActiveForDebug;
hasADebugLayer = hasADebugLayer || mustBeActiveForDebug;
if (mustBeActive && !diagram.getActivatedLayers().contains(l) && !diagram.getActivatedTransientLayers().contains(l)) {
Copy link
Contributor Author

@dvojtise dvojtise Aug 4, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the second line that has changed (most other changes are due to the new indentation)
(added && !diagram.getActivatedTransientLayers().contains(l))

@dvojtise dvojtise merged commit 17a9fef into master Aug 10, 2021
@dvojtise dvojtise deleted the fix-model-loader-crash branch August 17, 2021 12:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DefaultModelLoader crash when loading models with some representations
2 participants