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

Views for instance-filtering and information-abstracting views #289

Draft
wants to merge 64 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 33 commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
1d660ec
Initial commit of half-working modified code
niklas5810 Dec 1, 2023
0256297
Added more complex UML model creation and first simple filter methods
niklas5810 Dec 6, 2023
4186195
forgot some files
niklas5810 Dec 6, 2023
ad150e8
Added large model to viewtest
niklas5810 Dec 15, 2023
e63f488
Merge branch 'main' of github.com:niklas5810/Vitruv-CaseStudies into …
niklas5810 Dec 15, 2023
da538ce
- some further approaches for filtering
niklas5810 Dec 25, 2023
d51f4ea
- Introduced functionality to FilterSupportingViewElementSelector to …
niklas5810 Dec 28, 2023
b082263
It is now possible to create a view with just the selected UML objects
niklas5810 Dec 29, 2023
2d8b646
Structural changes to make update of view possible
niklas5810 Dec 30, 2023
f828e70
- Translated FirstTest.xtend into BasicViewTest.java, minor fixes
niklas5810 Jan 4, 2024
eaa780a
improved selection of individual elements as preparation
niklas5810 Jan 4, 2024
1618324
Filtering View is now updated in case the underlying model is modified
niklas5810 Jan 4, 2024
270d94e
- First steps for pcm support
niklas5810 Jan 12, 2024
5f481f8
Save progress to make update and informationView work
niklas5810 Jan 20, 2024
7246f81
Fixed update-mechanism for BasicFilterView
niklas5810 Jan 26, 2024
941e31f
Some code clean ups
niklas5810 Jan 26, 2024
f4530c5
Added some infrastructure for testing
niklas5810 Jan 27, 2024
433ec21
Adjusted information view to fix of filtering views
niklas5810 Jan 29, 2024
4842901
Fixed getRoot() for BasicFilterView and BasicInformationFilterView
niklas5810 Feb 2, 2024
395431d
Added regression tests for instance filtering
niklas5810 Feb 2, 2024
1e7525c
Added test for correct informationView behaviour
niklas5810 Feb 2, 2024
cad4f2d
Added JavaDoc and some minor code quality improvements
niklas5810 Feb 2, 2024
e6064c0
Added tests for view modification
niklas5810 Feb 2, 2024
45bae4d
Made InformationView implementation more generic
niklas5810 Feb 2, 2024
1d83e1a
Current state
niklas5810 Feb 27, 2024
eed9f64
- Implemented transformation from FilterResourceSet to ViewResourceSet
niklas5810 Feb 28, 2024
7627175
Added new regression test for modification of filter view
niklas5810 Feb 28, 2024
c13eb53
Refactor: More distinctive names for methods of FilteredView
niklas5810 Mar 2, 2024
56da547
Introduced AbstractBasicView and corresponding interface
niklas5810 Mar 2, 2024
d2f21c4
Renamed modules
niklas5810 Mar 2, 2024
29e7bb5
Merge branch 'vitruv-tools:main' into main
niklas5810 Mar 2, 2024
5062b2e
Code quality improvements, refactor of informationView
niklas5810 Mar 2, 2024
342f5a3
- Renamed some methods to improve understandability
niklas5810 Mar 2, 2024
b4e7158
Some code cleanups, reverted accidental modification in cbs.testutils
niklas5810 Mar 6, 2024
3f6e0f0
- removed local files from git
niklas5810 Mar 6, 2024
8ac4574
- updated InstanceFilterTest to match new functionality removed file
niklas5810 Mar 6, 2024
c7899f9
- removed unnecessary if clause
niklas5810 Mar 6, 2024
4be9d78
Changed name of informationStructureModel package and added it to repo
niklas5810 Mar 6, 2024
906d432
minor code improvements, removed InformationView interface
niklas5810 Mar 7, 2024
28254a7
Removed Marker-Interfaces:
niklas5810 Mar 7, 2024
9e5f9f8
Organized imports for tools.vitruv.applications.viewtest
niklas5810 Mar 7, 2024
1bcf17b
Organized imports for tools.vitruv.applications.viewfilter.tests
niklas5810 Mar 7, 2024
d525bc0
- Removed old class used for playground testing
niklas5810 Mar 7, 2024
62889a5
- Fulfilled some TODOs, added JavaDoc
niklas5810 Mar 8, 2024
ff82f11
moved plugin to correct directory. Updated .gitignore
niklas5810 Mar 9, 2024
1f58dcb
Resolved some TODOs. Added JavaDoc
niklas5810 Mar 9, 2024
5100b9e
- Some minor code cleanups
niklas5810 Mar 9, 2024
45ec52e
Replaced System.out.prints for errors by Exceptions
niklas5810 Mar 9, 2024
3914d89
added .classpath files to repo
niklas5810 Mar 12, 2024
0ba7116
Added old classpath files
niklas5810 Mar 12, 2024
63f1731
added missing classpath files
niklas5810 Mar 12, 2024
b6f9563
Renamed viewtest plugin to viewfilter plugin
niklas5810 Mar 12, 2024
ad3d0f4
Removed unnecessary export of test-project
niklas5810 Mar 12, 2024
c9aa4a1
Removed copied test resources
niklas5810 Mar 12, 2024
0fe57a3
Removed BasicViewFilterTest and renamed ViewTestFactory
niklas5810 Mar 12, 2024
174c630
reverted some temporary changes
niklas5810 Mar 12, 2024
097b8ed
added temporary deleted file
niklas5810 Mar 12, 2024
c1deeb4
Removed unnecessary interfaces
niklas5810 Mar 12, 2024
b761b2a
Removed "niklas" from code, removed unnecessary class
niklas5810 Mar 12, 2024
7d940a4
Added javadoc, resolved todos
niklas5810 Mar 12, 2024
cc1bb80
Some cleanups, some javadoc
niklas5810 Mar 12, 2024
52adcd5
- Removed an unnecessary dependency in pcmumlclass.tests
niklas5810 Mar 18, 2024
7a34582
- Some automatic change in generated files of infostructure meta-model
niklas5810 Mar 18, 2024
2988a87
- Removed slf4j dependency in umljava-test plugin
niklas5810 Mar 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@ target/
EvaluationData
*.DS_Store
*.polyglot
*.pom.tycho
*.pom.tycho
*.classpath
niklas5810 marked this conversation as resolved.
Show resolved Hide resolved
tests/tools.vitruv.applications.umljava.tests/src/tools/vitruv/applications/umljava/tests/java2uml/constructionsimulationtest/JavaSourceOrClassFileResourceWithArraysDefaultFactoryImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -57,23 +57,23 @@ package class EquivalenceTestExecutable implements Executable, AutoCloseable {
val EquivalenceTestExtensionContext extensionContext

override execute() throws Throwable {
try (
val testView = setupTestView();
val referenceView = setupReferenceView();
val printerChange = installViewDirectoryUriReplacement(testView, referenceView)
) {
checkNotNull(printerChange) // Suppress warning for variable not being used
executeDependencies(testView, referenceView)

testStep.executeIn(testView)
referenceSteps.values.forEach[executeIn(referenceView)]
verifyTestViewResults()
} catch (Throwable t) {
extensionContext.executionException = Optional.of(t)
throw t
} finally {
close()
}
// try (
niklas5810 marked this conversation as resolved.
Show resolved Hide resolved
// val testView = setupTestView();
// val referenceView = setupReferenceView();
// val printerChange = installViewDirectoryUriReplacement(testView, referenceView)
// ) {
// checkNotNull(printerChange) // Suppress warning for variable not being used
// executeDependencies(testView, referenceView)
//
// testStep.executeIn(testView)
// referenceSteps.values.forEach[executeIn(referenceView)]
// verifyTestViewResults()
// } catch (Throwable t) {
// extensionContext.executionException = Optional.of(t)
// throw t
// } finally {
// close()
// }
}

def private DirectoryTestView setupTestView() {
Expand Down
18 changes: 18 additions & 0 deletions bundles/tools.vitruv.applications.pcmumlclass/.polyglot.META-INF
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
niklas5810 marked this conversation as resolved.
Show resolved Hide resolved
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>tools.vitruv</groupId>
<artifactId>bundles</artifactId>
<version>3.0.1-SNAPSHOT</version>
<relativePath>..\.polyglot.pom.tycho</relativePath>
</parent>
<artifactId>tools.vitruv.applications.pcmumlclass</artifactId>
<version>3.0.1-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<name>[bundle] Vitruv PCM-UML Class Application</name>
<organization>
<name>vitruv.tools</name>
</organization>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
eclipse.preferences.version=1
niklas5810 marked this conversation as resolved.
Show resolved Hide resolved
org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
org.eclipse.jdt.core.compiler.compliance=17
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=17
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
org.eclipse.jdt.core.compiler.compliance=17
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=17
24 changes: 24 additions & 0 deletions bundles/tools.vitruv.applications.viewtest/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17">
<attributes>
<attribute name="module" value="true"/>
</attributes>
<accessrules>
<accessrule kind="accessible" pattern="tools.vitruv.change.atomic"/>
</accessrules>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="src-gen">
<attributes>
<attribute name="ignore_optional_problems" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" path="xtend-gen">
<attributes>
<attribute name="ignore_optional_problems" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
Empty file.
18 changes: 18 additions & 0 deletions bundles/tools.vitruv.applications.viewtest/.polyglot.META-INF
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>tools.vitruv</groupId>
<artifactId>bundles</artifactId>
<version>3.0.1-SNAPSHOT</version>
<relativePath>..\.polyglot.pom.tycho</relativePath>
</parent>
<artifactId>tools.vitruv.applications.viewfilter</artifactId>
<version>3.0.1-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
<name>[bundle] Vitruv Viewfilter Application</name>
<organization>
<name>vitruv.tools</name>
</organization>
</project>
34 changes: 34 additions & 0 deletions bundles/tools.vitruv.applications.viewtest/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>tools.vitruv.views.viewfilter</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.pde.PluginNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
</natures>
</projectDescription>
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
eclipse.preferences.version=1
encoding/<project>=UTF-8
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=17
org.eclipse.jdt.core.compiler.compliance=17
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
org.eclipse.jdt.core.compiler.release=enabled
org.eclipse.jdt.core.compiler.source=17
24 changes: 24 additions & 0 deletions bundles/tools.vitruv.applications.viewtest/META-INF/MANIFEST.MF
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Vitruv Viewfilter Application
Bundle-SymbolicName: tools.vitruv.views.viewfilter;singleton:=true
Bundle-Version: 3.0.1.qualifier
Automatic-Module-Name: tools.vitruv.applications.viewfilter
Bundle-RequiredExecutionEnvironment: JavaSE-17
Eclipse-ExtensibleAPI: true
Require-Bundle: org.eclipse.uml2.uml;visibility:=reexport,
org.palladiosimulator.pcm;visibility:=reexport,
edu.kit.ipd.sdq.activextendannotations,
edu.kit.ipd.sdq.commons.util.emf,
edu.kit.ipd.sdq.commons.util.java,
tools.vitruv.framework.applications,
tools.vitruv.dsls.reactions.runtime,
tools.vitruv.applications.util.temporary,
tools.vitruv.framework.views;bundle-version="3.0.1",
tools.vitruv.change.atomic,
tools.vitruv.change.composite
Bundle-Vendor: vitruv.tools
Export-Package: tools.vitruv.applications.viewfilter.util.framework,
niklas5810 marked this conversation as resolved.
Show resolved Hide resolved
tools.vitruv.applications.viewfilter.util.framework.impl,
tools.vitruv.applications.viewfilter.util.framework.selectors
Import-Package: com.niklas.niklasproject.niklasdomain
7 changes: 7 additions & 0 deletions bundles/tools.vitruv.applications.viewtest/build.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
source.. = src/,\
src-gen/,\
xtend-gen/
output.. = target/classes/
bin.includes = META-INF/,\
plugin.xml,\
.
16 changes: 16 additions & 0 deletions bundles/tools.vitruv.applications.viewtest/plugin.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<?eclipse version="3.0"?>

<!--
-->

<plugin>
<extension
id="viewfilterApplication"
name="Viewfilter Application"
point="tools.vitruv.framework.applications.application">
<application
class="tools.vitruv.applications.viewfilter.viewfilterApplication"></application>
</extension>

</plugin>
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
package tools.vitruv.application.viewfilter.informationview.internal;

import com.niklas.niklasproject.niklasdomain.NiklasdomainFactory;
import com.niklas.niklasproject.niklasdomain.SingleInformation;

import tools.vitruv.applications.viewfilter.helpers.ViewFilterHelper;

import java.util.List;
import java.util.function.Function;

import org.eclipse.emf.ecore.EObject;
import org.eclipse.uml2.uml.Model;

//TODO nbr add javadoc
public abstract class CountElementsTransformator implements InformationViewTransformator {


public SingleInformation transform(EObject root) {
if (!(root instanceof Model)) {
//not an Uml model
return null;
}
//TODO nbruening hier noch generischer machen
SingleInformation createSingleInformation = NiklasdomainFactory.eINSTANCE.createSingleInformation();
createSingleInformation.setTitle(getTitle());

List<EObject> allElements = ViewFilterHelper.convertTreeIterator2List(root.eAllContents());

int count = 0;

for (EObject element : allElements) {
if (takeElementIntoAccount(element)) {
count++;
}
}

createSingleInformation.setValue(count);
return createSingleInformation;
}


protected abstract boolean takeElementIntoAccount(EObject object);

protected abstract String getTitle();


}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package tools.vitruv.application.viewfilter.informationview.internal;

import org.eclipse.emf.ecore.EObject;

public class CountUmlClassesTransformator extends CountElementsTransformator {

private static final String ANZAHL_ELEMENTE = "Anzahl Elemente";
niklas5810 marked this conversation as resolved.
Show resolved Hide resolved

@Override
protected boolean takeElementIntoAccount(EObject object) {
if (object instanceof org.eclipse.uml2.uml.Class) {
return true;
} else {
return false;
}
}

@Override
protected String getTitle() {
return ANZAHL_ELEMENTE;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package tools.vitruv.application.viewfilter.informationview.internal;

import org.eclipse.emf.ecore.EObject;

import com.niklas.niklasproject.niklasdomain.SingleInformation;

/**
* Transforms a given model into a {@link SingleInformation}. A transformation could be
* counting the elements of a certain type in the given model for instance.
* The actual transformation depends on the overwriting implementation.}
*/
public interface InformationViewTransformator {

/**
* Method transforms the given model (represented by its root) into a {@link SingleInformation}.
* The transformation corresponds to the calculation of the actual information, which will than
* be represented by the {@link SingleInformation} instance which the method returns.
* A transformation could be counting the elements of a certain type in the given model for instance.
* The actual transformation depends on the actual implementation of this method
*
* @param root The root element of the model which is supposed to be transformed
* @return The information which has been extracted from the given model
*/
public abstract SingleInformation transform(EObject root);

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package tools.vitruv.applications.viewfilter.helpers;

import java.util.LinkedList;
import java.util.List;

import org.eclipse.emf.common.util.TreeIterator;
import org.eclipse.emf.ecore.EObject;

public class ViewFilterHelper {

private ViewFilterHelper() {
//static helper class - should not be instantiated
}

public static List<EObject> convertTreeIterator2List(TreeIterator<EObject> content) {
List<EObject> list = new LinkedList<EObject>();
while(content.hasNext()) {
list.add(content.next());
}
return list;
}

}
Loading
Loading