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

Mka/elk properties #110

Merged
merged 17 commits into from
Apr 27, 2022
Merged

Mka/elk properties #110

merged 17 commits into from
Apr 27, 2022

Conversation

Eddykasp
Copy link
Contributor

@Eddykasp Eddykasp commented Mar 23, 2022

Server-side changes to support changes proposed in klighd-vscode.
Additionally changes in semantics are necessary.

@@ -98,6 +98,9 @@

/** name of the 'preservedProperties' element. */
private static final String PRESERVED_PROPERTIES = "preservedProperties";
Copy link
Member

Choose a reason for hiding this comment

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

I think the preserved properties are no longer in use now, 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.

They're still used for copying some stuff from the elkgraph to the KGraph apparently.

List<IProperty<?>> propertiesToPreserve = KlighdDataManager.getInstance().getPreservedProperties();

Copy link
Member

Choose a reason for hiding this comment

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

No, I think you removed the only reference to it by introducing the blacklist and copying all other properties such as desiredPostion, layerId, etc...

Copy link
Member

Choose a reason for hiding this comment

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

Again, is this still needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Currently the only remaining reference is in the KGraphMerger. It's used there in conjunction with some property removal process to filter which properties should be copied from an elkgraph to a kgraph. This seems to be a separate thing from where preservedProperties have now been removed from and I'm not sure what the reasoning behind the filtering there is. To me it looks like preservedProperties were overloaded in their purpose before. I don't know what the right way to change KGraphMerger is. If that is solved, then yes preservedProperties and the related classes can be removed.

var properties = kNode.allProperties;
var propertyKeys = properties.keySet;
var blackList = KlighdDataManager.instance.blacklistedProperties;
for (key : propertyKeys) {
Copy link
Member

Choose a reason for hiding this comment

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

For better efficiency here you could just run through the properties instead of only the keys. Removes the need to search through the properties via get(key) for every key

@@ -237,6 +240,9 @@ public static KlighdDataManager getInstance() {

/** the properties that shall be preserved from the layout graph to the kgraph */
private final List<IProperty<?>> preservedProperties = Lists.newArrayList();

/** the properties that are not allowed to be preserved */
Copy link
Member

Choose a reason for hiding this comment

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

Preserved for what? The context is missing here in this generic class

@@ -670,6 +684,18 @@ public KlighdDataManager registerPreservedProperties(Iterable<IProperty<?>> pres
}
return this;
}

public KlighdDataManager registerBlacklistedProperty(IProperty<?> blacklistedProperty) {
Copy link
Member

Choose a reason for hiding this comment

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

Comment public API



/**
* Returns the list of registered properties that have been blacklisted.
Copy link
Member

Choose a reason for hiding this comment

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

Blacklisted for what? The context is missing here in this generic class


for (propertyKVPair : properties.entrySet()) {
if (!containsPropertyWithId(blackList, propertyKVPair.key.id)) {
// TODO: remove this check once https://github.com/kieler/semantics/pull/13 has been merged
Copy link
Member

Choose a reason for hiding this comment

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

I guess we want to remove this before the next release and not after this was merged. (also see cases below)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also in EObjectSerializer

@@ -77,5 +77,12 @@
</provider>

</extension>
<extension
Copy link
Member

Choose a reason for hiding this comment

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

Do we still need extension points @NiklasRentzCAU ?

Copy link
Member

Choose a reason for hiding this comment

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

Yes. If something will be written to this setup (for example actions, syntheses etc. like in semantics) it will only be executed in Eclipse when used as an extension point. That was the main reason why we have this single programmatic extension mechanism now, that needs to be registered once as a Java Service and Eclipse extension point

@@ -98,6 +98,9 @@

/** name of the 'preservedProperties' element. */
private static final String PRESERVED_PROPERTIES = "preservedProperties";
Copy link
Member

Choose a reason for hiding this comment

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

Again, is this still needed?

Eddykasp added a commit to kieler/klighd-vscode that referenced this pull request Mar 30, 2022
@Eddykasp Eddykasp merged commit ee48b05 into master Apr 27, 2022
@Eddykasp Eddykasp deleted the mka/elk-properties branch September 12, 2023 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants