diff --git a/.github/workflows/buildAndTest.yml b/.github/workflows/buildAndTest.yml index 98a4b65de..ed1ffaed0 100644 --- a/.github/workflows/buildAndTest.yml +++ b/.github/workflows/buildAndTest.yml @@ -20,15 +20,15 @@ jobs: # this provides some extremly helpful insight into the meta data of the current execution, see also https://docs.github.com/en/actions/learn-github-actions/contexts#github-context and https://stackoverflow.com/questions/70104600/complete-list-of-github-actions-contexts # - name: Dump GitHub context # run: echo '${{ toJSON(github) }}' - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - uses: nelonoel/branch-name@v1.0.1 - name: Set up JDK - uses: actions/setup-java@v2 + uses: actions/setup-java@v4 with: java-version: 17 - distribution: adopt + distribution: temurin - name: Cache Maven packages - uses: actions/cache@v2 + uses: actions/cache@v4 with: path: .m2 key: ${{ runner.os }}-m2-${{ hashFiles('.github/workflows/**/*.*', '**/pom.xml', '**/META-INF/MANIFEST.MF', 'build/de.cau.cs.kieler.klighd.targetplatform/de.cau.cs.kieler.klighd.targetplatform.target') }} @@ -43,19 +43,28 @@ jobs: #print the folder structure up to depth 2 on the console as we have no other option of getting an inside into workspace folder find . -maxdepth 2 - name: Archive P2 Repository - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: KLighD P2 Repository path: build/de.cau.cs.kieler.klighd.repository/target/repository/**/* retention-days: 14 if-no-files-found: error - name: Archive MVN Repository - uses: actions/upload-artifact@v2 + if: ${{ !contains(github.ref, 'releases-') }} + uses: actions/upload-artifact@v4 with: name: KLighD MVN Repository path: klighd-snapshots/**/* retention-days: 14 if-no-files-found: error + - name: Archive MVN Release Repository + if: ${{ contains(github.ref, 'releases-') }} + uses: actions/upload-artifact@v4 + with: + name: KLighD MVN Repository + path: klighd/**/* + retention-days: 14 + if-no-files-found: error - name: Publish Test Report id: test_report if: ${{ !cancelled() }} diff --git a/.gitignore b/.gitignore index 77c5793af..585203ce5 100644 --- a/.gitignore +++ b/.gitignore @@ -3,6 +3,7 @@ xtend-gen/ target/ localM2/ klighd-snapshots/ +klighd/ .svn/ .DS_Store *.class diff --git a/build/de.cau.cs.kieler.klighd.repository/.settings/org.eclipse.core.resources.prefs b/build/de.cau.cs.kieler.klighd.repository/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 000000000..99f26c020 --- /dev/null +++ b/build/de.cau.cs.kieler.klighd.repository/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/build/de.cau.cs.kieler.klighd.repository/category.xml b/build/de.cau.cs.kieler.klighd.repository/category.xml index ce72249af..edfb4b245 100644 --- a/build/de.cau.cs.kieler.klighd.repository/category.xml +++ b/build/de.cau.cs.kieler.klighd.repository/category.xml @@ -11,10 +11,10 @@ - + - + @@ -25,49 +25,47 @@ --> - + - + - + - + - + - + - + - + - + - + - - - + + - + - - + + - - + diff --git a/build/de.cau.cs.kieler.klighd.repository/pom.xml b/build/de.cau.cs.kieler.klighd.repository/pom.xml index 3c96be4a1..3e55dc956 100644 --- a/build/de.cau.cs.kieler.klighd.repository/pom.xml +++ b/build/de.cau.cs.kieler.klighd.repository/pom.xml @@ -10,7 +10,7 @@ de.cau.cs.kieler.klighd parent - 2.3.1-SNAPSHOT + 3.0.3-SNAPSHOT ../../pom.xml @@ -52,19 +52,17 @@ - https://download.eclipse.org/releases/2022-09/ + https://download.eclipse.org/releases/2023-12/ https://download.eclipse.org/modeling/mdt/uml2/updates/5.4/ - https://download.eclipse.org/elk/updates/releases/0.8.1/> + https://download.eclipse.org/elk/updates/releases/0.9.1/> - https://download.eclipse.org/modeling/tmf/xtext/updates/releases/2.28.0/> + https://download.eclipse.org/modeling/tmf/xtext/updates/releases/2.33.0/> https://xtext.github.io/download/updates/releases/2.1.1/> - https://download.eclipse.org/tools/orbit/downloads/drops/R20220830213456/repository/ - - https://rtsys.informatik.uni-kiel.de/~kieler/updatesite/sprotty/0.9.0/ + https://download.eclipse.org/tools/orbit/simrel/orbit-aggregation/release/4.30.0 siteTemplate diff --git a/build/de.cau.cs.kieler.klighd.targetplatform/de.cau.cs.kieler.klighd.targetplatform-elkNightly.target b/build/de.cau.cs.kieler.klighd.targetplatform/de.cau.cs.kieler.klighd.targetplatform-elkNightly.target index 7c913547e..2a3c0eccd 100644 --- a/build/de.cau.cs.kieler.klighd.targetplatform/de.cau.cs.kieler.klighd.targetplatform-elkNightly.target +++ b/build/de.cau.cs.kieler.klighd.targetplatform/de.cau.cs.kieler.klighd.targetplatform-elkNightly.target @@ -8,7 +8,7 @@ - + @@ -25,22 +25,23 @@ - + - - - - - + + + - - + + + + + \ No newline at end of file diff --git a/build/de.cau.cs.kieler.klighd.targetplatform/de.cau.cs.kieler.klighd.targetplatform-piccolo-elkNightly.target b/build/de.cau.cs.kieler.klighd.targetplatform/de.cau.cs.kieler.klighd.targetplatform-piccolo-elkNightly.target index 9fd6a5984..fc4b1e392 100644 --- a/build/de.cau.cs.kieler.klighd.targetplatform/de.cau.cs.kieler.klighd.targetplatform-piccolo-elkNightly.target +++ b/build/de.cau.cs.kieler.klighd.targetplatform/de.cau.cs.kieler.klighd.targetplatform-piccolo-elkNightly.target @@ -8,7 +8,7 @@ - + @@ -25,7 +25,7 @@ - + @@ -36,15 +36,16 @@ - - - - - + + + - - + + + + + \ No newline at end of file diff --git a/build/de.cau.cs.kieler.klighd.targetplatform/de.cau.cs.kieler.klighd.targetplatform-piccolo.target b/build/de.cau.cs.kieler.klighd.targetplatform/de.cau.cs.kieler.klighd.targetplatform-piccolo.target index 5c4d0fff2..ac0e28f68 100644 --- a/build/de.cau.cs.kieler.klighd.targetplatform/de.cau.cs.kieler.klighd.targetplatform-piccolo.target +++ b/build/de.cau.cs.kieler.klighd.targetplatform/de.cau.cs.kieler.klighd.targetplatform-piccolo.target @@ -8,7 +8,7 @@ - + @@ -21,11 +21,11 @@ - + - + @@ -36,15 +36,16 @@ - - - - - + + + - - + + + + + \ No newline at end of file diff --git a/build/de.cau.cs.kieler.klighd.targetplatform/de.cau.cs.kieler.klighd.targetplatform.target b/build/de.cau.cs.kieler.klighd.targetplatform/de.cau.cs.kieler.klighd.targetplatform.target index 9d4a9872d..b4200b6f0 100644 --- a/build/de.cau.cs.kieler.klighd.targetplatform/de.cau.cs.kieler.klighd.targetplatform.target +++ b/build/de.cau.cs.kieler.klighd.targetplatform/de.cau.cs.kieler.klighd.targetplatform.target @@ -8,7 +8,7 @@ - + @@ -21,26 +21,27 @@ - + - + - - - - - + + + - - + + + + + \ No newline at end of file diff --git a/build/de.cau.cs.kieler.klighd.targetplatform/pom.xml b/build/de.cau.cs.kieler.klighd.targetplatform/pom.xml index 099422a6c..09d6f87c2 100644 --- a/build/de.cau.cs.kieler.klighd.targetplatform/pom.xml +++ b/build/de.cau.cs.kieler.klighd.targetplatform/pom.xml @@ -10,7 +10,7 @@ de.cau.cs.kieler.klighd parent - 2.3.1-SNAPSHOT + 3.0.3-SNAPSHOT ../../pom.xml diff --git a/features/de.cau.cs.kieler.klighd.batik.feature/.settings/org.eclipse.core.resources.prefs b/features/de.cau.cs.kieler.klighd.batik.feature/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 000000000..99f26c020 --- /dev/null +++ b/features/de.cau.cs.kieler.klighd.batik.feature/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/features/de.cau.cs.kieler.klighd.batik.feature/feature.xml b/features/de.cau.cs.kieler.klighd.batik.feature/feature.xml index 9dd04cf56..721ac958e 100644 --- a/features/de.cau.cs.kieler.klighd.batik.feature/feature.xml +++ b/features/de.cau.cs.kieler.klighd.batik.feature/feature.xml @@ -2,7 +2,7 @@ @@ -205,10 +205,6 @@ of Computer Science, Kiel University + version="0.0.0"/> diff --git a/features/de.cau.cs.kieler.klighd.batik.feature/pom.xml b/features/de.cau.cs.kieler.klighd.batik.feature/pom.xml index f3809224d..4d9a8c5a3 100644 --- a/features/de.cau.cs.kieler.klighd.batik.feature/pom.xml +++ b/features/de.cau.cs.kieler.klighd.batik.feature/pom.xml @@ -5,11 +5,10 @@ de.cau.cs.kieler.klighd features - 2.2.1-SNAPSHOT + 3.0.3-SNAPSHOT - de.cau.cs.kieler.klighd + de.cau.cs.kieler.klighd.batik.feature - 2.2.1-SNAPSHOT eclipse-feature diff --git a/features/de.cau.cs.kieler.klighd.draw2d.feature/.settings/org.eclipse.core.resources.prefs b/features/de.cau.cs.kieler.klighd.draw2d.feature/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 000000000..99f26c020 --- /dev/null +++ b/features/de.cau.cs.kieler.klighd.draw2d.feature/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/features/de.cau.cs.kieler.klighd.draw2d.feature/feature.xml b/features/de.cau.cs.kieler.klighd.draw2d.feature/feature.xml index 80769d408..b634876bf 100644 --- a/features/de.cau.cs.kieler.klighd.draw2d.feature/feature.xml +++ b/features/de.cau.cs.kieler.klighd.draw2d.feature/feature.xml @@ -2,7 +2,7 @@ diff --git a/features/de.cau.cs.kieler.klighd.draw2d.feature/pom.xml b/features/de.cau.cs.kieler.klighd.draw2d.feature/pom.xml index 628041024..884e3d6d5 100644 --- a/features/de.cau.cs.kieler.klighd.draw2d.feature/pom.xml +++ b/features/de.cau.cs.kieler.klighd.draw2d.feature/pom.xml @@ -5,11 +5,10 @@ de.cau.cs.kieler.klighd features - 2.3.1-SNAPSHOT + 3.0.3-SNAPSHOT - de.cau.cs.kieler.klighd + de.cau.cs.kieler.klighd.draw2d.feature - 2.3.1-SNAPSHOT eclipse-feature diff --git a/features/de.cau.cs.kieler.klighd.feature/.settings/org.eclipse.core.resources.prefs b/features/de.cau.cs.kieler.klighd.feature/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 000000000..99f26c020 --- /dev/null +++ b/features/de.cau.cs.kieler.klighd.feature/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/features/de.cau.cs.kieler.klighd.feature/feature.xml b/features/de.cau.cs.kieler.klighd.feature/feature.xml index ae57c2232..8e656a4cb 100644 --- a/features/de.cau.cs.kieler.klighd.feature/feature.xml +++ b/features/de.cau.cs.kieler.klighd.feature/feature.xml @@ -2,7 +2,7 @@ diff --git a/features/de.cau.cs.kieler.klighd.feature/pom.xml b/features/de.cau.cs.kieler.klighd.feature/pom.xml index 1a17d3c80..d4699d063 100644 --- a/features/de.cau.cs.kieler.klighd.feature/pom.xml +++ b/features/de.cau.cs.kieler.klighd.feature/pom.xml @@ -5,11 +5,10 @@ de.cau.cs.kieler.klighd features - 2.3.1-SNAPSHOT + 3.0.3-SNAPSHOT - de.cau.cs.kieler.klighd + de.cau.cs.kieler.klighd.feature - 2.3.1-SNAPSHOT eclipse-feature diff --git a/features/de.cau.cs.kieler.klighd.freehep.feature/.settings/org.eclipse.core.resources.prefs b/features/de.cau.cs.kieler.klighd.freehep.feature/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 000000000..99f26c020 --- /dev/null +++ b/features/de.cau.cs.kieler.klighd.freehep.feature/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/features/de.cau.cs.kieler.klighd.freehep.feature/feature.xml b/features/de.cau.cs.kieler.klighd.freehep.feature/feature.xml index 2d968f29e..1f1be56e6 100644 --- a/features/de.cau.cs.kieler.klighd.freehep.feature/feature.xml +++ b/features/de.cau.cs.kieler.klighd.freehep.feature/feature.xml @@ -2,7 +2,7 @@ diff --git a/features/de.cau.cs.kieler.klighd.freehep.feature/pom.xml b/features/de.cau.cs.kieler.klighd.freehep.feature/pom.xml index dac9f9b4d..05fce98ee 100644 --- a/features/de.cau.cs.kieler.klighd.freehep.feature/pom.xml +++ b/features/de.cau.cs.kieler.klighd.freehep.feature/pom.xml @@ -5,11 +5,10 @@ de.cau.cs.kieler.klighd features - 2.3.1-SNAPSHOT + 3.0.3-SNAPSHOT - de.cau.cs.kieler.klighd + de.cau.cs.kieler.klighd.freehep.feature - 2.3.1-SNAPSHOT eclipse-feature diff --git a/features/de.cau.cs.kieler.klighd.ide.feature/.settings/org.eclipse.core.resources.prefs b/features/de.cau.cs.kieler.klighd.ide.feature/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 000000000..99f26c020 --- /dev/null +++ b/features/de.cau.cs.kieler.klighd.ide.feature/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/features/de.cau.cs.kieler.klighd.ide.feature/feature.xml b/features/de.cau.cs.kieler.klighd.ide.feature/feature.xml index 6c8b8e1fb..367717bd4 100644 --- a/features/de.cau.cs.kieler.klighd.ide.feature/feature.xml +++ b/features/de.cau.cs.kieler.klighd.ide.feature/feature.xml @@ -2,7 +2,7 @@ diff --git a/features/de.cau.cs.kieler.klighd.ide.feature/pom.xml b/features/de.cau.cs.kieler.klighd.ide.feature/pom.xml index 47d8b48ce..5dcac0926 100644 --- a/features/de.cau.cs.kieler.klighd.ide.feature/pom.xml +++ b/features/de.cau.cs.kieler.klighd.ide.feature/pom.xml @@ -5,11 +5,10 @@ de.cau.cs.kieler.klighd features - 2.3.1-SNAPSHOT + 3.0.3-SNAPSHOT - de.cau.cs.kieler.klighd + de.cau.cs.kieler.klighd.ide.feature - 2.3.1-SNAPSHOT eclipse-feature diff --git a/features/de.cau.cs.kieler.klighd.sdk.feature/.settings/org.eclipse.core.resources.prefs b/features/de.cau.cs.kieler.klighd.sdk.feature/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 000000000..99f26c020 --- /dev/null +++ b/features/de.cau.cs.kieler.klighd.sdk.feature/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/features/de.cau.cs.kieler.klighd.sdk.feature/feature.xml b/features/de.cau.cs.kieler.klighd.sdk.feature/feature.xml index 900cf8856..4ba9f2ed5 100644 --- a/features/de.cau.cs.kieler.klighd.sdk.feature/feature.xml +++ b/features/de.cau.cs.kieler.klighd.sdk.feature/feature.xml @@ -2,7 +2,7 @@ diff --git a/features/de.cau.cs.kieler.klighd.sdk.feature/pom.xml b/features/de.cau.cs.kieler.klighd.sdk.feature/pom.xml index 2d9fdc1bf..56afcc5f2 100644 --- a/features/de.cau.cs.kieler.klighd.sdk.feature/pom.xml +++ b/features/de.cau.cs.kieler.klighd.sdk.feature/pom.xml @@ -5,11 +5,10 @@ de.cau.cs.kieler.klighd features - 2.3.1-SNAPSHOT + 3.0.3-SNAPSHOT - de.cau.cs.kieler.klighd + de.cau.cs.kieler.klighd.sdk.feature - 2.3.1-SNAPSHOT eclipse-feature diff --git a/features/de.cau.cs.kieler.klighd.view.feature/.settings/org.eclipse.core.resources.prefs b/features/de.cau.cs.kieler.klighd.view.feature/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 000000000..99f26c020 --- /dev/null +++ b/features/de.cau.cs.kieler.klighd.view.feature/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/features/de.cau.cs.kieler.klighd.view.feature/feature.xml b/features/de.cau.cs.kieler.klighd.view.feature/feature.xml index f8dc8d7eb..a5b61c504 100644 --- a/features/de.cau.cs.kieler.klighd.view.feature/feature.xml +++ b/features/de.cau.cs.kieler.klighd.view.feature/feature.xml @@ -2,7 +2,7 @@ @@ -302,7 +302,7 @@ version(s), and exceptions or additional permissions here}." - + diff --git a/features/de.cau.cs.kieler.klighd.view.feature/pom.xml b/features/de.cau.cs.kieler.klighd.view.feature/pom.xml index e35335f26..091d7feed 100644 --- a/features/de.cau.cs.kieler.klighd.view.feature/pom.xml +++ b/features/de.cau.cs.kieler.klighd.view.feature/pom.xml @@ -5,11 +5,10 @@ de.cau.cs.kieler.klighd features - 2.3.1-SNAPSHOT + 3.0.3-SNAPSHOT - de.cau.cs.kieler.klighd + de.cau.cs.kieler.klighd.view.feature - 2.3.1-SNAPSHOT eclipse-feature diff --git a/features/pom.xml b/features/pom.xml index 56e99b3a9..c7b666222 100644 --- a/features/pom.xml +++ b/features/pom.xml @@ -9,7 +9,7 @@ de.cau.cs.kieler.klighd parent - 2.3.1-SNAPSHOT + 3.0.3-SNAPSHOT diff --git a/plugins-dev/de.cau.cs.kieler.klighd.kgx/.classpath b/plugins-dev/de.cau.cs.kieler.klighd.kgx/.classpath index eca7bdba8..e801ebfb4 100644 --- a/plugins-dev/de.cau.cs.kieler.klighd.kgx/.classpath +++ b/plugins-dev/de.cau.cs.kieler.klighd.kgx/.classpath @@ -1,6 +1,6 @@ - + diff --git a/plugins-dev/de.cau.cs.kieler.klighd.kgx/.settings/org.eclipse.core.resources.prefs b/plugins-dev/de.cau.cs.kieler.klighd.kgx/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 000000000..99f26c020 --- /dev/null +++ b/plugins-dev/de.cau.cs.kieler.klighd.kgx/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/plugins-dev/de.cau.cs.kieler.klighd.kgx/META-INF/MANIFEST.MF b/plugins-dev/de.cau.cs.kieler.klighd.kgx/META-INF/MANIFEST.MF index 5e41d7e6e..a36267692 100644 --- a/plugins-dev/de.cau.cs.kieler.klighd.kgx/META-INF/MANIFEST.MF +++ b/plugins-dev/de.cau.cs.kieler.klighd.kgx/META-INF/MANIFEST.MF @@ -4,7 +4,7 @@ Bundle-Name: KIELER Lightweight Diagrams Custom XMI Resource Factory Implementat Bundle-SymbolicName: de.cau.cs.kieler.klighd.kgx;singleton:=true Bundle-Version: 1.0.0.qualifier Automatic-Module-Name: de.cau.cs.kieler.klighd.kgx -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Bundle-RequiredExecutionEnvironment: JavaSE-11 Bundle-Vendor: Kiel University Fragment-Host: de.cau.cs.kieler.klighd Require-Bundle: org.eclipse.emf.ecore.xmi diff --git a/plugins-dev/de.cau.cs.kieler.klighd.offscreen.application/.classpath b/plugins-dev/de.cau.cs.kieler.klighd.offscreen.application/.classpath index eca7bdba8..e801ebfb4 100644 --- a/plugins-dev/de.cau.cs.kieler.klighd.offscreen.application/.classpath +++ b/plugins-dev/de.cau.cs.kieler.klighd.offscreen.application/.classpath @@ -1,6 +1,6 @@ - + diff --git a/plugins-dev/de.cau.cs.kieler.klighd.offscreen.application/.settings/org.eclipse.core.resources.prefs b/plugins-dev/de.cau.cs.kieler.klighd.offscreen.application/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 000000000..99f26c020 --- /dev/null +++ b/plugins-dev/de.cau.cs.kieler.klighd.offscreen.application/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/plugins-dev/de.cau.cs.kieler.klighd.offscreen.application/META-INF/MANIFEST.MF b/plugins-dev/de.cau.cs.kieler.klighd.offscreen.application/META-INF/MANIFEST.MF index 4c239448d..21e770e0e 100644 --- a/plugins-dev/de.cau.cs.kieler.klighd.offscreen.application/META-INF/MANIFEST.MF +++ b/plugins-dev/de.cau.cs.kieler.klighd.offscreen.application/META-INF/MANIFEST.MF @@ -4,7 +4,7 @@ Bundle-Name: KLighD Offscreen Rendering Application Bundle-SymbolicName: de.cau.cs.kieler.klighd.offscreen.application;singleton:=true Bundle-Version: 0.45.0.qualifier Bundle-Vendor: Kiel University -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Bundle-RequiredExecutionEnvironment: JavaSE-11 Require-Bundle: org.eclipse.emf.ecore, org.eclipse.emf.ecore.xmi, de.cau.cs.kieler.klighd, diff --git a/plugins/de.cau.cs.kieler.kgraph.text.ide/.classpath b/plugins/de.cau.cs.kieler.kgraph.text.ide/.classpath index ad52d9d4d..0a3b82d4d 100644 --- a/plugins/de.cau.cs.kieler.kgraph.text.ide/.classpath +++ b/plugins/de.cau.cs.kieler.kgraph.text.ide/.classpath @@ -1,6 +1,6 @@ - + diff --git a/plugins/de.cau.cs.kieler.kgraph.text.ide/.settings/org.eclipse.jdt.core.prefs b/plugins/de.cau.cs.kieler.kgraph.text.ide/.settings/org.eclipse.jdt.core.prefs index 5dddc113e..a978652d6 100644 --- a/plugins/de.cau.cs.kieler.kgraph.text.ide/.settings/org.eclipse.jdt.core.prefs +++ b/plugins/de.cau.cs.kieler.kgraph.text.ide/.settings/org.eclipse.jdt.core.prefs @@ -1,11 +1,13 @@ eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 -org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=11 +org.eclipse.jdt.core.compiler.compliance=11 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.release=disabled -org.eclipse.jdt.core.compiler.source=1.8 +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 diff --git a/plugins/de.cau.cs.kieler.kgraph.text.ide/META-INF/MANIFEST.MF b/plugins/de.cau.cs.kieler.kgraph.text.ide/META-INF/MANIFEST.MF index 89f145d46..a32f34f48 100644 --- a/plugins/de.cau.cs.kieler.kgraph.text.ide/META-INF/MANIFEST.MF +++ b/plugins/de.cau.cs.kieler.kgraph.text.ide/META-INF/MANIFEST.MF @@ -2,9 +2,9 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: KIELER KGraph Text Ide Bundle-SymbolicName: de.cau.cs.kieler.kgraph.text.ide -Bundle-Version: 2.3.1.qualifier +Bundle-Version: 3.0.3.qualifier Bundle-Vendor: Kiel University -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Bundle-RequiredExecutionEnvironment: JavaSE-11 Require-Bundle: de.cau.cs.kieler.kgraph.text, org.eclipse.xtext.ide, com.google.guava, diff --git a/plugins/de.cau.cs.kieler.kgraph.text.ide/build.properties b/plugins/de.cau.cs.kieler.kgraph.text.ide/build.properties index 6b74f11c3..d7ab75e9c 100644 --- a/plugins/de.cau.cs.kieler.kgraph.text.ide/build.properties +++ b/plugins/de.cau.cs.kieler.kgraph.text.ide/build.properties @@ -4,3 +4,5 @@ source.. = src-gen/,\ output.. = bin/ bin.includes = META-INF/,\ . +bin.excludes = **/*.xtend,\ + **/*.java._trace diff --git a/plugins/de.cau.cs.kieler.kgraph.text.ide/pom.xml b/plugins/de.cau.cs.kieler.kgraph.text.ide/pom.xml index eccab3beb..b4bd6aff0 100644 --- a/plugins/de.cau.cs.kieler.kgraph.text.ide/pom.xml +++ b/plugins/de.cau.cs.kieler.kgraph.text.ide/pom.xml @@ -5,13 +5,11 @@ de.cau.cs.kieler.klighd parent - 2.3.1-SNAPSHOT + 3.0.3-SNAPSHOT ../../pom.xml - de.cau.cs.kieler.klighd de.cau.cs.kieler.kgraph.text.ide - 2.3.1-SNAPSHOT eclipse-plugin KIELER KGraph Text Ide diff --git a/plugins/de.cau.cs.kieler.kgraph.text.ui/.classpath b/plugins/de.cau.cs.kieler.kgraph.text.ui/.classpath index 0377d772d..9891e0694 100644 --- a/plugins/de.cau.cs.kieler.kgraph.text.ui/.classpath +++ b/plugins/de.cau.cs.kieler.kgraph.text.ui/.classpath @@ -1,6 +1,6 @@ - + diff --git a/plugins/de.cau.cs.kieler.kgraph.text.ui/.settings/org.eclipse.jdt.core.prefs b/plugins/de.cau.cs.kieler.kgraph.text.ui/.settings/org.eclipse.jdt.core.prefs index 5dddc113e..e6ef504f6 100644 --- a/plugins/de.cau.cs.kieler.kgraph.text.ui/.settings/org.eclipse.jdt.core.prefs +++ b/plugins/de.cau.cs.kieler.kgraph.text.ui/.settings/org.eclipse.jdt.core.prefs @@ -1,11 +1,18 @@ eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 -org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate +org.eclipse.jdt.core.compiler.codegen.targetPlatform=11 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=11 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate 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.release=disabled -org.eclipse.jdt.core.compiler.source=1.8 +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 diff --git a/plugins/de.cau.cs.kieler.kgraph.text.ui/META-INF/MANIFEST.MF b/plugins/de.cau.cs.kieler.kgraph.text.ui/META-INF/MANIFEST.MF index 19cf491b9..2c6816b07 100644 --- a/plugins/de.cau.cs.kieler.kgraph.text.ui/META-INF/MANIFEST.MF +++ b/plugins/de.cau.cs.kieler.kgraph.text.ui/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: KIELER Textual KGraph Language UI Bundle-Vendor: Kiel University -Bundle-Version: 2.3.1.qualifier +Bundle-Version: 3.0.3.qualifier Bundle-SymbolicName: de.cau.cs.kieler.kgraph.text.ui; singleton:=true Bundle-ActivationPolicy: lazy Require-Bundle: org.eclipse.xtext.ui, @@ -21,7 +21,7 @@ Require-Bundle: org.eclipse.xtext.ui, de.cau.cs.kieler.klighd.kgraph Import-Package: org.apache.log4j DynamicImport-Package: de.cau.cs.kieler.klighd.test -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Bundle-RequiredExecutionEnvironment: JavaSE-11 Export-Package: de.cau.cs.kieler.kgraph.text.ui, de.cau.cs.kieler.kgraph.text.ui.contentassist, de.cau.cs.kieler.kgraph.text.ui.internal, diff --git a/plugins/de.cau.cs.kieler.kgraph.text.ui/build.properties b/plugins/de.cau.cs.kieler.kgraph.text.ui/build.properties index e86a412e6..1a12796b4 100644 --- a/plugins/de.cau.cs.kieler.kgraph.text.ui/build.properties +++ b/plugins/de.cau.cs.kieler.kgraph.text.ui/build.properties @@ -6,4 +6,6 @@ bin.includes = META-INF/,\ about.html,\ icons/,\ plugin.xml +bin.excludes = **/*.xtend,\ + **/*.java._trace diff --git a/plugins/de.cau.cs.kieler.kgraph.text.ui/pom.xml b/plugins/de.cau.cs.kieler.kgraph.text.ui/pom.xml index b9f5789c4..85a89dc0b 100644 --- a/plugins/de.cau.cs.kieler.kgraph.text.ui/pom.xml +++ b/plugins/de.cau.cs.kieler.kgraph.text.ui/pom.xml @@ -5,13 +5,11 @@ de.cau.cs.kieler.klighd parent - 2.3.1-SNAPSHOT + 3.0.3-SNAPSHOT ../../pom.xml - de.cau.cs.kieler.klighd de.cau.cs.kieler.kgraph.text.ui - 2.3.1-SNAPSHOT eclipse-plugin KIELER Textual KGraph Language UI diff --git a/plugins/de.cau.cs.kieler.kgraph.text.ui/src-gen/de/cau/cs/kieler/kgraph/text/ui/internal/TextActivator.java b/plugins/de.cau.cs.kieler.kgraph.text.ui/src-gen/de/cau/cs/kieler/kgraph/text/ui/internal/TextActivator.java index 0a41903c9..ef12d2e1c 100644 --- a/plugins/de.cau.cs.kieler.kgraph.text.ui/src-gen/de/cau/cs/kieler/kgraph/text/ui/internal/TextActivator.java +++ b/plugins/de.cau.cs.kieler.kgraph.text.ui/src-gen/de/cau/cs/kieler/kgraph/text/ui/internal/TextActivator.java @@ -3,7 +3,6 @@ */ package de.cau.cs.kieler.kgraph.text.ui.internal; -import com.google.common.collect.Maps; import com.google.inject.Guice; import com.google.inject.Injector; import com.google.inject.Module; @@ -12,6 +11,7 @@ import de.cau.cs.kieler.kgraph.text.ui.GRandomUiModule; import de.cau.cs.kieler.kgraph.text.ui.KGraphUiModule; import java.util.Collections; +import java.util.HashMap; import java.util.Map; import org.apache.log4j.Logger; import org.eclipse.ui.plugin.AbstractUIPlugin; @@ -32,7 +32,7 @@ public class TextActivator extends AbstractUIPlugin { private static TextActivator INSTANCE; - private Map injectors = Collections.synchronizedMap(Maps. newHashMapWithExpectedSize(1)); + private Map injectors = Collections.synchronizedMap(new HashMap<>(2)); @Override public void start(BundleContext context) throws Exception { diff --git a/plugins/de.cau.cs.kieler.kgraph.text.ui/src/de/cau/cs/kieler/kgraph/text/ui/contentassist/KGraphProposalProvider.java b/plugins/de.cau.cs.kieler.kgraph.text.ui/src/de/cau/cs/kieler/kgraph/text/ui/contentassist/KGraphProposalProvider.java index 9bee4845b..fdf9c1c73 100644 --- a/plugins/de.cau.cs.kieler.kgraph.text.ui/src/de/cau/cs/kieler/kgraph/text/ui/contentassist/KGraphProposalProvider.java +++ b/plugins/de.cau.cs.kieler.kgraph.text.ui/src/de/cau/cs/kieler/kgraph/text/ui/contentassist/KGraphProposalProvider.java @@ -20,8 +20,6 @@ import java.lang.reflect.InvocationTargetException; import java.util.Arrays; -import javax.inject.Inject; - import org.eclipse.elk.core.data.LayoutAlgorithmData; import org.eclipse.elk.core.data.LayoutMetaDataService; import org.eclipse.elk.core.data.LayoutOptionData; @@ -46,6 +44,8 @@ import org.eclipse.xtext.ui.editor.contentassist.ICompletionProposalAcceptor; import org.eclipse.xtext.util.Strings; +import com.google.inject.Inject; + import de.cau.cs.kieler.kgraph.text.KGraphResource; import de.cau.cs.kieler.kgraph.text.services.KGraphGrammarAccess; import de.cau.cs.kieler.klighd.kgraph.PersistentEntry; diff --git a/plugins/de.cau.cs.kieler.kgraph.text/.classpath b/plugins/de.cau.cs.kieler.kgraph.text/.classpath index 0377d772d..9891e0694 100644 --- a/plugins/de.cau.cs.kieler.kgraph.text/.classpath +++ b/plugins/de.cau.cs.kieler.kgraph.text/.classpath @@ -1,6 +1,6 @@ - + diff --git a/plugins/de.cau.cs.kieler.kgraph.text/.settings/org.eclipse.jdt.core.prefs b/plugins/de.cau.cs.kieler.kgraph.text/.settings/org.eclipse.jdt.core.prefs index 5dddc113e..e6ef504f6 100644 --- a/plugins/de.cau.cs.kieler.kgraph.text/.settings/org.eclipse.jdt.core.prefs +++ b/plugins/de.cau.cs.kieler.kgraph.text/.settings/org.eclipse.jdt.core.prefs @@ -1,11 +1,18 @@ eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 -org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate +org.eclipse.jdt.core.compiler.codegen.targetPlatform=11 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=11 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate 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.release=disabled -org.eclipse.jdt.core.compiler.source=1.8 +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 diff --git a/plugins/de.cau.cs.kieler.kgraph.text/META-INF/MANIFEST.MF b/plugins/de.cau.cs.kieler.kgraph.text/META-INF/MANIFEST.MF index 48bb9cdd0..2018d203f 100644 --- a/plugins/de.cau.cs.kieler.kgraph.text/META-INF/MANIFEST.MF +++ b/plugins/de.cau.cs.kieler.kgraph.text/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: KIELER Textual ELK KGraph Language Bundle-Vendor: Kiel University -Bundle-Version: 2.3.1.qualifier +Bundle-Version: 3.0.3.qualifier Bundle-SymbolicName: de.cau.cs.kieler.kgraph.text; singleton:=true Bundle-ActivationPolicy: lazy Require-Bundle: org.eclipse.xtext;visibility:=reexport, @@ -23,7 +23,7 @@ Require-Bundle: org.eclipse.xtext;visibility:=reexport, de.cau.cs.kieler.klighd;resolution:=optional Import-Package: org.apache.log4j DynamicImport-Package: de.cau.cs.kieler.klighd.test -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Bundle-RequiredExecutionEnvironment: JavaSE-11 Export-Package: de.cau.cs.kieler.kgraph.text, de.cau.cs.kieler.kgraph.text.formatting, de.cau.cs.kieler.kgraph.text.generator, diff --git a/plugins/de.cau.cs.kieler.kgraph.text/build.properties b/plugins/de.cau.cs.kieler.kgraph.text/build.properties index 160c5b09a..56e82316d 100644 --- a/plugins/de.cau.cs.kieler.kgraph.text/build.properties +++ b/plugins/de.cau.cs.kieler.kgraph.text/build.properties @@ -6,3 +6,7 @@ bin.includes = model/generated/,\ about.html,\ .,\ plugin.xml +bin.excludes = **/*.xtend,\ + **/*.mwe2,\ + **/*.xtext,\ + **/*.java._trace diff --git a/plugins/de.cau.cs.kieler.kgraph.text/pom.xml b/plugins/de.cau.cs.kieler.kgraph.text/pom.xml index 95678b8ce..6c5880b1d 100644 --- a/plugins/de.cau.cs.kieler.kgraph.text/pom.xml +++ b/plugins/de.cau.cs.kieler.kgraph.text/pom.xml @@ -5,13 +5,11 @@ de.cau.cs.kieler.klighd parent - 2.3.1-SNAPSHOT + 3.0.3-SNAPSHOT ../../pom.xml - de.cau.cs.kieler.klighd de.cau.cs.kieler.kgraph.text - 2.3.1-SNAPSHOT eclipse-plugin KIELER Textual KGraph Language diff --git a/plugins/de.cau.cs.kieler.kgraph.text/src-gen/de/cau/cs/kieler/kgraph/text/services/GRandomGrammarAccess.java b/plugins/de.cau.cs.kieler.kgraph.text/src-gen/de/cau/cs/kieler/kgraph/text/services/GRandomGrammarAccess.java index a385e06f7..8763a1ffb 100644 --- a/plugins/de.cau.cs.kieler.kgraph.text/src-gen/de/cau/cs/kieler/kgraph/text/services/GRandomGrammarAccess.java +++ b/plugins/de.cau.cs.kieler.kgraph.text/src-gen/de/cau/cs/kieler/kgraph/text/services/GRandomGrammarAccess.java @@ -3,9 +3,8 @@ */ package de.cau.cs.kieler.kgraph.text.services; -import com.google.inject.Inject; -import com.google.inject.Singleton; import java.util.List; + import org.eclipse.xtext.Action; import org.eclipse.xtext.Alternatives; import org.eclipse.xtext.Assignment; @@ -20,10 +19,12 @@ import org.eclipse.xtext.TerminalRule; import org.eclipse.xtext.UnorderedGroup; import org.eclipse.xtext.common.services.TerminalsGrammarAccess; -import org.eclipse.xtext.service.AbstractElementFinder.AbstractEnumRuleElementFinder; import org.eclipse.xtext.service.AbstractElementFinder.AbstractGrammarElementFinder; import org.eclipse.xtext.service.GrammarProvider; +import com.google.inject.Inject; +import com.google.inject.Singleton; + @Singleton public class GRandomGrammarAccess extends AbstractGrammarElementFinder { diff --git a/plugins/de.cau.cs.kieler.kgraph.text/src-gen/de/cau/cs/kieler/kgraph/text/services/KGraphGrammarAccess.java b/plugins/de.cau.cs.kieler.kgraph.text/src-gen/de/cau/cs/kieler/kgraph/text/services/KGraphGrammarAccess.java index 1ddd22839..3a89216e4 100644 --- a/plugins/de.cau.cs.kieler.kgraph.text/src-gen/de/cau/cs/kieler/kgraph/text/services/KGraphGrammarAccess.java +++ b/plugins/de.cau.cs.kieler.kgraph.text/src-gen/de/cau/cs/kieler/kgraph/text/services/KGraphGrammarAccess.java @@ -3,9 +3,8 @@ */ package de.cau.cs.kieler.kgraph.text.services; -import com.google.inject.Inject; -import com.google.inject.Singleton; import java.util.List; + import org.eclipse.xtext.Action; import org.eclipse.xtext.Alternatives; import org.eclipse.xtext.Assignment; @@ -20,10 +19,12 @@ import org.eclipse.xtext.RuleCall; import org.eclipse.xtext.TerminalRule; import org.eclipse.xtext.UnorderedGroup; -import org.eclipse.xtext.service.AbstractElementFinder.AbstractEnumRuleElementFinder; import org.eclipse.xtext.service.AbstractElementFinder.AbstractGrammarElementFinder; import org.eclipse.xtext.service.GrammarProvider; +import com.google.inject.Inject; +import com.google.inject.Singleton; + @Singleton public class KGraphGrammarAccess extends AbstractGrammarElementFinder { diff --git a/plugins/de.cau.cs.kieler.kgraph.text/src/de/cau/cs/kieler/kgraph/text/KGraphValueConverters.java b/plugins/de.cau.cs.kieler.kgraph.text/src/de/cau/cs/kieler/kgraph/text/KGraphValueConverters.java index b072dd450..17e29a109 100644 --- a/plugins/de.cau.cs.kieler.kgraph.text/src/de/cau/cs/kieler/kgraph/text/KGraphValueConverters.java +++ b/plugins/de.cau.cs.kieler.kgraph.text/src/de/cau/cs/kieler/kgraph/text/KGraphValueConverters.java @@ -18,8 +18,6 @@ import java.util.regex.Pattern; -import javax.inject.Inject; - import org.eclipse.xtext.conversion.IValueConverter; import org.eclipse.xtext.conversion.ValueConverter; import org.eclipse.xtext.conversion.ValueConverterException; @@ -32,6 +30,8 @@ import org.eclipse.xtext.nodemodel.INode; import org.eclipse.xtext.util.Strings; +import com.google.inject.Inject; + /** * Value converter for the KGraph grammar. diff --git a/plugins/de.cau.cs.kieler.kgraph.text/src/de/cau/cs/kieler/kgraph/text/grandom/RandomGraphGenerator.java b/plugins/de.cau.cs.kieler.kgraph.text/src/de/cau/cs/kieler/kgraph/text/grandom/RandomGraphGenerator.java index a6c2f191c..d58e1ee5a 100644 --- a/plugins/de.cau.cs.kieler.kgraph.text/src/de/cau/cs/kieler/kgraph/text/grandom/RandomGraphGenerator.java +++ b/plugins/de.cau.cs.kieler.kgraph.text/src/de/cau/cs/kieler/kgraph/text/grandom/RandomGraphGenerator.java @@ -22,6 +22,7 @@ import java.util.Collections; import java.util.Comparator; import java.util.Deque; +import java.util.HashSet; import java.util.LinkedList; import java.util.List; import java.util.ListIterator; @@ -36,9 +37,6 @@ import org.eclipse.elk.core.util.Pair; import org.eclipse.elk.graph.properties.IProperty; -import com.google.common.collect.Lists; -import com.google.common.collect.Sets; - import de.cau.cs.kieler.kgraph.text.grandom.GeneratorOptions.RandVal; import de.cau.cs.kieler.klighd.kgraph.KEdge; import de.cau.cs.kieler.klighd.kgraph.KGraphFactory; @@ -132,7 +130,7 @@ private List> addHierarchicalNodes(final KNode parent) { private void connectAtomicNodesOnDifferentLevels(final List> atomicNodes) { int numCrossHier; if (get(EXACT_RELATIVE_HIER) != null) { - Set newHashSet = Sets.newHashSet(); + Set newHashSet = new HashSet<>(); for (List level : atomicNodes) { for (KNode node : level) { newHashSet.addAll(node.getIncomingEdges()); @@ -1208,7 +1206,7 @@ private KPort retrievePort(final KNode node, final boolean source) { float reusePortsChance = get(USE_EXISTING_PORTS_CHANCE).floatVal(random); if (reusePortsChance > 0.0f && random.nextFloat() < reusePortsChance) { // Collect candidate ports for reuse - List reuseCandidates = Lists.newLinkedList(); + List reuseCandidates = new ArrayList<>(); for (KPort port : node.getPorts()) { // Two flags indicating whether the port already has edges pointing in the right diff --git a/plugins/de.cau.cs.kieler.klighd.ide/.classpath b/plugins/de.cau.cs.kieler.klighd.ide/.classpath index 2f5ffb21d..e769fecbe 100644 --- a/plugins/de.cau.cs.kieler.klighd.ide/.classpath +++ b/plugins/de.cau.cs.kieler.klighd.ide/.classpath @@ -1,6 +1,6 @@ - + diff --git a/plugins/de.cau.cs.kieler.klighd.ide/.settings/org.eclipse.jdt.core.prefs b/plugins/de.cau.cs.kieler.klighd.ide/.settings/org.eclipse.jdt.core.prefs index 5dddc113e..e6ef504f6 100644 --- a/plugins/de.cau.cs.kieler.klighd.ide/.settings/org.eclipse.jdt.core.prefs +++ b/plugins/de.cau.cs.kieler.klighd.ide/.settings/org.eclipse.jdt.core.prefs @@ -1,11 +1,18 @@ eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 -org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate +org.eclipse.jdt.core.compiler.codegen.targetPlatform=11 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=11 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate 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.release=disabled -org.eclipse.jdt.core.compiler.source=1.8 +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 diff --git a/plugins/de.cau.cs.kieler.klighd.ide/META-INF/MANIFEST.MF b/plugins/de.cau.cs.kieler.klighd.ide/META-INF/MANIFEST.MF index 5dfed97ed..8c2c8f6e2 100644 --- a/plugins/de.cau.cs.kieler.klighd.ide/META-INF/MANIFEST.MF +++ b/plugins/de.cau.cs.kieler.klighd.ide/META-INF/MANIFEST.MF @@ -2,16 +2,17 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: KIELER Lightweight Diagrams Ide Components Bundle-SymbolicName: de.cau.cs.kieler.klighd.ide;singleton:=true -Bundle-Version: 2.3.1.qualifier +Bundle-Version: 3.0.3.qualifier Automatic-Module-Name: de.cau.cs.kieler.klighd.ide -Require-Bundle: de.cau.cs.kieler.klighd;visibility:=reexport, +Require-Bundle: com.google.inject, + de.cau.cs.kieler.klighd;visibility:=reexport, de.cau.cs.kieler.klighd.kgraph, org.eclipse.xtext.xbase, de.cau.cs.kieler.klighd.krendering.extensions, org.eclipse.elk.alg.layered, org.eclipse.elk.core Bundle-ActivationPolicy: lazy -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Bundle-RequiredExecutionEnvironment: JavaSE-11 Bundle-Vendor: Kiel University Export-Package: de.cau.cs.kieler.klighd.ide, de.cau.cs.kieler.klighd.ide.model, diff --git a/plugins/de.cau.cs.kieler.klighd.ide/build.properties b/plugins/de.cau.cs.kieler.klighd.ide/build.properties index 74b70cb95..ba5f2edfe 100644 --- a/plugins/de.cau.cs.kieler.klighd.ide/build.properties +++ b/plugins/de.cau.cs.kieler.klighd.ide/build.properties @@ -6,3 +6,5 @@ bin.includes = META-INF/,\ plugin.xml,\ about.html,\ icons/ +bin.excludes = **/*.xtend,\ + **/*.java._trace diff --git a/plugins/de.cau.cs.kieler.klighd.ide/pom.xml b/plugins/de.cau.cs.kieler.klighd.ide/pom.xml index 6612f8570..5d2c48988 100644 --- a/plugins/de.cau.cs.kieler.klighd.ide/pom.xml +++ b/plugins/de.cau.cs.kieler.klighd.ide/pom.xml @@ -5,13 +5,11 @@ de.cau.cs.kieler.klighd parent - 2.3.1-SNAPSHOT + 3.0.3-SNAPSHOT ../../pom.xml - de.cau.cs.kieler.klighd de.cau.cs.kieler.klighd.ide - 2.3.1-SNAPSHOT eclipse-plugin KIELER Lightweight Diagrams Ide Components @@ -19,6 +17,11 @@ https://github.com/kieler/KLighD + + com.google.inject + guice + ${guice-version} + ${project.groupId} de.cau.cs.kieler.klighd diff --git a/plugins/de.cau.cs.kieler.klighd.ide/src/de/cau/cs/kieler/klighd/ide/syntheses/EObjectFallbackSynthesis.xtend b/plugins/de.cau.cs.kieler.klighd.ide/src/de/cau/cs/kieler/klighd/ide/syntheses/EObjectFallbackSynthesis.xtend index ffd778b4a..43e1890ae 100644 --- a/plugins/de.cau.cs.kieler.klighd.ide/src/de/cau/cs/kieler/klighd/ide/syntheses/EObjectFallbackSynthesis.xtend +++ b/plugins/de.cau.cs.kieler.klighd.ide/src/de/cau/cs/kieler/klighd/ide/syntheses/EObjectFallbackSynthesis.xtend @@ -18,6 +18,7 @@ package de.cau.cs.kieler.klighd.ide.syntheses import com.google.common.collect.HashBasedTable import com.google.common.collect.Table +import com.google.inject.Inject import de.cau.cs.kieler.klighd.KlighdConstants import de.cau.cs.kieler.klighd.SynthesisOption import de.cau.cs.kieler.klighd.ide.syntheses.action.EcoreModelExpandDetailsAction @@ -40,7 +41,6 @@ import de.cau.cs.kieler.klighd.util.KlighdProperties import java.awt.Color import java.util.List import java.util.Map -import javax.inject.Inject import org.eclipse.elk.alg.layered.options.EdgeStraighteningStrategy import org.eclipse.elk.alg.layered.options.FixedAlignment import org.eclipse.elk.alg.layered.options.LayeredOptions diff --git a/plugins/de.cau.cs.kieler.klighd.ide/src/de/cau/cs/kieler/klighd/ide/syntheses/ErrorModelSynthesis.xtend b/plugins/de.cau.cs.kieler.klighd.ide/src/de/cau/cs/kieler/klighd/ide/syntheses/ErrorModelSynthesis.xtend index 9f97b4bbd..dd5fb7a13 100644 --- a/plugins/de.cau.cs.kieler.klighd.ide/src/de/cau/cs/kieler/klighd/ide/syntheses/ErrorModelSynthesis.xtend +++ b/plugins/de.cau.cs.kieler.klighd.ide/src/de/cau/cs/kieler/klighd/ide/syntheses/ErrorModelSynthesis.xtend @@ -16,6 +16,7 @@ */ package de.cau.cs.kieler.klighd.ide.syntheses +import com.google.inject.Inject import de.cau.cs.kieler.klighd.ide.model.MessageModel import de.cau.cs.kieler.klighd.ide.syntheses.MessageModelSynthesis import de.cau.cs.kieler.klighd.kgraph.KNode @@ -27,7 +28,6 @@ import de.cau.cs.kieler.klighd.krendering.extensions.KRenderingExtensions import de.cau.cs.kieler.klighd.syntheses.AbstractDiagramSynthesis import de.cau.cs.kieler.klighd.ide.model.ErrorModel import de.cau.cs.kieler.klighd.ide.syntheses.action.AbstractErrorModelShowExceptionAction -import javax.inject.Inject /** * Diagram synthesis for a {@link MessageModel}. diff --git a/plugins/de.cau.cs.kieler.klighd.ide/src/de/cau/cs/kieler/klighd/ide/syntheses/MessageModelSynthesis.xtend b/plugins/de.cau.cs.kieler.klighd.ide/src/de/cau/cs/kieler/klighd/ide/syntheses/MessageModelSynthesis.xtend index 9c875f7fc..ec614bf7b 100644 --- a/plugins/de.cau.cs.kieler.klighd.ide/src/de/cau/cs/kieler/klighd/ide/syntheses/MessageModelSynthesis.xtend +++ b/plugins/de.cau.cs.kieler.klighd.ide/src/de/cau/cs/kieler/klighd/ide/syntheses/MessageModelSynthesis.xtend @@ -16,6 +16,7 @@ */ package de.cau.cs.kieler.klighd.ide.syntheses +import com.google.inject.Inject import de.cau.cs.kieler.klighd.ide.model.MessageModel import de.cau.cs.kieler.klighd.kgraph.KNode import de.cau.cs.kieler.klighd.krendering.extensions.KColorExtensions @@ -24,7 +25,6 @@ import de.cau.cs.kieler.klighd.krendering.extensions.KNodeExtensions import de.cau.cs.kieler.klighd.krendering.extensions.KRenderingExtensions import de.cau.cs.kieler.klighd.syntheses.AbstractDiagramSynthesis import de.cau.cs.kieler.klighd.util.KlighdProperties -import javax.inject.Inject import static extension de.cau.cs.kieler.klighd.syntheses.DiagramSyntheses.* import static extension org.eclipse.emf.ecore.util.EcoreUtil.copy diff --git a/plugins/de.cau.cs.kieler.klighd.incremental/.classpath b/plugins/de.cau.cs.kieler.klighd.incremental/.classpath index 43b986286..1db08c6b4 100644 --- a/plugins/de.cau.cs.kieler.klighd.incremental/.classpath +++ b/plugins/de.cau.cs.kieler.klighd.incremental/.classpath @@ -1,6 +1,6 @@ - + diff --git a/plugins/de.cau.cs.kieler.klighd.incremental/.settings/org.eclipse.jdt.core.prefs b/plugins/de.cau.cs.kieler.klighd.incremental/.settings/org.eclipse.jdt.core.prefs index d89fda210..b4ce202f6 100644 --- a/plugins/de.cau.cs.kieler.klighd.incremental/.settings/org.eclipse.jdt.core.prefs +++ b/plugins/de.cau.cs.kieler.klighd.incremental/.settings/org.eclipse.jdt.core.prefs @@ -1,11 +1,13 @@ eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 -org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=11 +org.eclipse.jdt.core.compiler.compliance=11 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.release=disabled -org.eclipse.jdt.core.compiler.source=1.8 +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 org.eclipse.jdt.core.formatter.align_fields_grouping_blank_lines=2147483647 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16 diff --git a/plugins/de.cau.cs.kieler.klighd.incremental/META-INF/MANIFEST.MF b/plugins/de.cau.cs.kieler.klighd.incremental/META-INF/MANIFEST.MF index 4ffbed71e..5aae25dbd 100644 --- a/plugins/de.cau.cs.kieler.klighd.incremental/META-INF/MANIFEST.MF +++ b/plugins/de.cau.cs.kieler.klighd.incremental/META-INF/MANIFEST.MF @@ -2,9 +2,9 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: KlighD incremental update extension Bundle-SymbolicName: de.cau.cs.kieler.klighd.incremental;singleton:=true -Bundle-Version: 2.3.1.qualifier +Bundle-Version: 3.0.3.qualifier Bundle-Vendor: Kiel University -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Bundle-RequiredExecutionEnvironment: JavaSE-11 Require-Bundle: de.cau.cs.kieler.klighd, de.cau.cs.kieler.klighd.kgraph, com.google.guava diff --git a/plugins/de.cau.cs.kieler.klighd.incremental/pom.xml b/plugins/de.cau.cs.kieler.klighd.incremental/pom.xml index 1e5bf7d01..aca6e7002 100644 --- a/plugins/de.cau.cs.kieler.klighd.incremental/pom.xml +++ b/plugins/de.cau.cs.kieler.klighd.incremental/pom.xml @@ -5,12 +5,11 @@ de.cau.cs.kieler.klighd parent - 2.3.1-SNAPSHOT + 3.0.3-SNAPSHOT ../../pom.xml - de.cau.cs.kieler.klighd + de.cau.cs.kieler.klighd.incremental - 2.3.1-SNAPSHOT eclipse-plugin KlighD incremental update extension diff --git a/plugins/de.cau.cs.kieler.klighd.incremental/src/de/cau/cs/kieler/klighd/incremental/diff/KComparison.java b/plugins/de.cau.cs.kieler.klighd.incremental/src/de/cau/cs/kieler/klighd/incremental/diff/KComparison.java index 08ea83d2c..3bdd57e32 100644 --- a/plugins/de.cau.cs.kieler.klighd.incremental/src/de/cau/cs/kieler/klighd/incremental/diff/KComparison.java +++ b/plugins/de.cau.cs.kieler.klighd.incremental/src/de/cau/cs/kieler/klighd/incremental/diff/KComparison.java @@ -38,6 +38,7 @@ public class KComparison { private UIDAdapter baseAdapter; private UIDAdapter newAdapter; private MapDifference nodeDifference; + private MapDifference edgeDifference; /** * Create new comparison. @@ -51,6 +52,7 @@ public KComparison(final UIDAdapter baseAdapter, final UIDAdapter newAdapter) { this.baseAdapter = baseAdapter; this.newAdapter = newAdapter; nodeDifference = Maps.difference(baseAdapter.getNodeMap(), newAdapter.getNodeMap()); + edgeDifference = Maps.difference(baseAdapter.getEdgeMap(), newAdapter.getEdgeMap()); } /** @@ -185,5 +187,32 @@ public Collection getRemovedNodes() { public Collection> getMatchedNodes() { return nodeDifference.entriesDiffering().values(); } + + /** + * Get newly added edges. + * + * @return the newly added edges. + */ + public Collection getAddedEdges() { + return edgeDifference.entriesOnlyOnRight().values(); + } + + /** + * Get removed edges. + * + * @return removed edges. + */ + public Collection getRemovedEdges() { + return edgeDifference.entriesOnlyOnLeft().values(); + } + + /** + * Get matched edges, that are present in both models. + * + * @return pairs of matched edges. + */ + public Collection> getMatchedEdges() { + return edgeDifference.entriesDiffering().values(); + } } diff --git a/plugins/de.cau.cs.kieler.klighd.incremental/src/de/cau/cs/kieler/klighd/incremental/merge/KGraphMerger.java b/plugins/de.cau.cs.kieler.klighd.incremental/src/de/cau/cs/kieler/klighd/incremental/merge/KGraphMerger.java index 55a877af2..d3f044688 100644 --- a/plugins/de.cau.cs.kieler.klighd.incremental/src/de/cau/cs/kieler/klighd/incremental/merge/KGraphMerger.java +++ b/plugins/de.cau.cs.kieler.klighd.incremental/src/de/cau/cs/kieler/klighd/incremental/merge/KGraphMerger.java @@ -3,7 +3,7 @@ * * http://rtsys.informatik.uni-kiel.de/kieler * - * Copyright 2016,2020 by + * Copyright 2016-2023 by * + Kiel University * + Department of Computer Science * + Real-Time and Embedded Systems Group @@ -19,7 +19,6 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; -import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Map.Entry; @@ -32,11 +31,9 @@ import org.eclipse.emf.common.util.EMap; import org.eclipse.emf.ecore.util.EcoreUtil; -import com.google.common.collect.Lists; import com.google.common.collect.MapDifference.ValueDifference; import com.google.common.collect.Sets; -import de.cau.cs.kieler.klighd.KlighdDataManager; import de.cau.cs.kieler.klighd.incremental.diff.KComparison; import de.cau.cs.kieler.klighd.kgraph.KEdge; import de.cau.cs.kieler.klighd.kgraph.KGraphData; @@ -88,9 +85,54 @@ public void merge() { handleRemovedNodes(); handleAddedNodes(); handleMatchedNodes(); + + // handle edges after everything else is done, because they are contained in their source, therefore we can't be + // sure the target exists until we have gone through the entire model + handleRemovedEdges(); + handleAddedEdges(); + handleMatchedEdges(); + updatePositions(); } + + /** + * Removes edges from the base model. + */ + private void handleRemovedEdges() { + for (KEdge edge : comparison.getRemovedEdges()) { + removeEdge(edge); + } + } + + /** + * Removes the edge from the graph it is contained in. + */ + private void removeEdge(KEdge edge) { + edge.setSource(null); + edge.setTarget(null); + edge.setSourcePort(null); + edge.setTargetPort(null); + } + /** + * Adds edges from the new model to the base model. + */ + private void handleAddedEdges() { + Stream newEdges = comparison.getAddedEdges().stream(); + newEdges.forEach( + (KEdge edge) -> handleAddedEdge(edge) + ); + } + + /** + * Handles edges that are present in both the base model and the new model. + */ + private void handleMatchedEdges() { + for (ValueDifference diff : comparison.getMatchedEdges()) { + handleMatchedEdge(diff.rightValue()); + } + } + /** * Remove nodes from the base model that are not longer present in the new model. */ @@ -142,10 +184,6 @@ private void handleAddedNodes() { )).forEachOrdered( (KNode node) -> addNode(node) ); - // Add edges after adding the nodes to ensure that all targets are available. - for (KNode node : comparison.getAddedNodes()) { - handleEdges(comparison.lookupBaseNode(node), node); - } } /** @@ -161,7 +199,10 @@ private void addNode(final KNode node) { // and just copy the node and add it to the base adapter, without putting it into the base model directly. if (comparison.lookupBaseNode(node) == null) { KNode copiedNode = EcoreUtil.copy(node); - comparison.getBaseAdapter().generateIDs(copiedNode); + // Edges from this node are handled later individually when the target is guaranteed to be added already, + // remove them for now. + allNewEdgesForCopiedNode(copiedNode).forEach(edge -> removeEdge(edge)); + comparison.getBaseAdapter().generateIDs(copiedNode, true, -1); } return; } @@ -180,11 +221,35 @@ private void addNode(final KNode node) { if (comparison.lookupBaseNode(node) == null) { int oldPosition = node.getParent().getChildren().indexOf(node); KNode copiedNode = EcoreUtil.copy(node); + // Edges from this node are handled later individually when the target is guaranteed to be added already, + // remove them for now. + allNewEdgesForCopiedNode(copiedNode).forEach(edge -> removeEdge(edge)); baseParent.getChildren().add(oldPosition, copiedNode); - comparison.getBaseAdapter().generateIDs(copiedNode); + comparison.getBaseAdapter().generateIDs(copiedNode, true, oldPosition); } } } + + /** + * Returns all edges of this copied node, that are copied alongside it. Includes all outgoing edges, also of potential + * children of this node. + */ + private List allNewEdgesForCopiedNode(KNode node) { + List allEdges = new ArrayList(); + allNewEdgesForCopiedNode(node, allEdges); + return allEdges; + } + + /** + * Adds all edges of this copied node, that are copied alongside it to the {@code allEdges} list. + * Includes all outgoing edges, also of potential children of this node. Adds the result to the given list. + */ + private void allNewEdgesForCopiedNode(KNode node, List allEdges) { + allEdges.addAll(node.getOutgoingEdges()); + for (KNode childNode : node.getChildren()) { + allNewEdgesForCopiedNode(childNode, allEdges); + } + } /** * Update nodes that are present in both the base and new model. @@ -194,28 +259,6 @@ private void handleMatchedNodes() { updateKnode(diff.leftValue(), diff.rightValue()); } } - - /** - * Updates the positions of all nodes, edges, ports and labels in their containment and reference lists to match the - * new model. - */ - private void updatePositions() { - for (Entry entry : updatedElements.entrySet()) { - if (entry.getKey() instanceof KNode) { - updatePosition((KNode) entry.getKey(), (KNode) entry.getValue()); - } - if (entry.getKey() instanceof KEdge) { - updatePosition((KEdge) entry.getKey(), (KEdge) entry.getValue()); - } - if (entry.getKey() instanceof KPort) { - updatePosition((KPort) entry.getKey(), (KPort) entry.getValue()); - } - if (entry.getKey() instanceof KLabel) { - updatePosition((KLabel) entry.getKey(), (KLabel) entry.getValue()); - } - } - updatedElements.clear(); - } /** * Update the given node pair. @@ -231,43 +274,32 @@ private void updateKnode(final KNode baseNode, final KNode newNode) { copyInsets(newNode.getInsets(), baseNode.getInsets()); handleLabels(baseNode, newNode); handlePorts(baseNode, newNode); - handleEdges(baseNode, newNode); + // edges are handled after all possible sources and targets have been handled updatedElements.put(baseNode, newNode); } /** - * Update all outgoing edges of the given node pair. Edges are removed, copied from the new - * model or updated. + * Update the matched edge. * - * @param baseNode - * the node to update to. - * @param newNode - * the node to update from. + * @param matchedEdge the matched edge. */ - private void handleEdges(final KNode baseNode, final KNode newNode) { - Set oldEdges = null; - if (baseNode != null) { - oldEdges = new HashSet(baseNode.getOutgoingEdges()); - } - for (KEdge newEdge : Lists.newLinkedList(newNode.getOutgoingEdges())) { - KEdge baseEdge = comparison.lookupBaseEdge(newEdge); - if (baseEdge == null || baseEdge.getTarget() == null) { - baseEdge = EcoreUtil.copy(newEdge); - updateEdge(baseEdge, newEdge); - } else { - if (oldEdges != null) { - oldEdges.remove(baseEdge); - } - updateEdge(baseEdge, newEdge); - } + private void handleMatchedEdge(final KEdge matchedEdge) { + KEdge baseEdge = comparison.lookupBaseEdge(matchedEdge); + if (baseEdge != null && baseEdge.getTarget() != null) { + updateEdge(baseEdge, matchedEdge); } - if (baseNode != null) { - for (KEdge oldEdge : oldEdges) { - oldEdge.setSource(null); - oldEdge.setTarget(null); - oldEdge.setSourcePort(null); - oldEdge.setTargetPort(null); - } + } + + /** + * Update the added edge. + * + * @param newEdge the added edge. + */ + private void handleAddedEdge(final KEdge newEdge) { + KEdge baseEdge = comparison.lookupBaseEdge(newEdge); + if (baseEdge == null || baseEdge.getTarget() == null) { + baseEdge = EcoreUtil.copy(newEdge); + updateEdge(baseEdge, newEdge); } } @@ -328,9 +360,9 @@ private void handleLabels(final KLabeledGraphElement baseElement, final KLabeledGraphElement newElement) { Set oldLabels = null; if (baseElement != null) { - oldLabels = new HashSet(baseElement.getLabels()); + oldLabels = new HashSet<>(baseElement.getLabels()); } - for (KLabel newLabel : Lists.newLinkedList(newElement.getLabels())) { + for (KLabel newLabel : new ArrayList<>(newElement.getLabels())) { KLabel baseLabel = comparison.lookupBaseLabel(newLabel); if (baseLabel == null) { baseLabel = EcoreUtil.copy(newLabel); @@ -374,7 +406,8 @@ private void updateLabel(final KLabel baseLabel, final KLabel newLabel) { updateShapeLayout(baseLabel, newLabel); baseLabel.setText(newLabel.getText()); copyInsets(newLabel.getInsets(), baseLabel.getInsets()); - comparison.getBaseAdapter().generateIDs(baseLabel); + int newPosition = newLabel.getParent().getLabels().indexOf(newLabel); + comparison.getBaseAdapter().generateIDs(baseLabel, newPosition); updatedElements.put(baseLabel, newLabel); } @@ -390,9 +423,9 @@ private void updateLabel(final KLabel baseLabel, final KLabel newLabel) { private void handlePorts(final KNode baseNode, final KNode newNode) { Set oldPorts = null; if (baseNode != null) { - oldPorts = new HashSet(baseNode.getPorts()); + oldPorts = new HashSet<>(baseNode.getPorts()); } - for (KPort newPort : Lists.newLinkedList(newNode.getPorts())) { + for (KPort newPort : new ArrayList<>(newNode.getPorts())) { KPort basePort = comparison.lookupBasePort(newPort); if (basePort == null) { basePort = EcoreUtil.copy(newPort); @@ -428,7 +461,8 @@ private void updatePort(final KPort basePort, final KPort newPort) { updateGraphElement(basePort, newPort); updateShapeLayout(basePort, newPort); copyInsets(newPort.getInsets(), basePort.getInsets()); - comparison.getBaseAdapter().generateIDs(basePort); + int newPosition = newPort.getNode().getPorts().indexOf(newPort); + comparison.getBaseAdapter().generateIDs(basePort, newPosition); handleLabels(basePort, newPort); updatedElements.put(basePort, newPort); } @@ -451,13 +485,35 @@ private void updateGraphElement(final KGraphElement baseElement, baseData.addAll(newData); baseElement.copyProperties(newElement); EMap, Object> baseProperties = baseElement.getProperties(); - LinkedList> removedProperties = Lists.newLinkedList( + List> removedProperties = new ArrayList<>( Sets.difference(baseProperties.keySet(), newElement.getProperties().keySet())); for (IProperty property : removedProperties) { baseProperties.removeKey(property); } } + + /** + * Updates the positions of all nodes, edges, ports and labels in their containment and reference lists to match the + * new model. + */ + private void updatePositions() { + for (Entry entry : updatedElements.entrySet()) { + if (entry.getKey() instanceof KNode) { + updatePosition((KNode) entry.getKey(), (KNode) entry.getValue()); + } + if (entry.getKey() instanceof KEdge) { + updatePosition((KEdge) entry.getKey(), (KEdge) entry.getValue()); + } + if (entry.getKey() instanceof KPort) { + updatePosition((KPort) entry.getKey(), (KPort) entry.getValue()); + } + if (entry.getKey() instanceof KLabel) { + updatePosition((KLabel) entry.getKey(), (KLabel) entry.getValue()); + } + } + updatedElements.clear(); + } /** * Updates the position of this node in the child list of its parent. diff --git a/plugins/de.cau.cs.kieler.klighd.incremental/src/de/cau/cs/kieler/klighd/incremental/util/UIDAdapter.java b/plugins/de.cau.cs.kieler.klighd.incremental/src/de/cau/cs/kieler/klighd/incremental/util/UIDAdapter.java index 0f926ca3b..684087979 100644 --- a/plugins/de.cau.cs.kieler.klighd.incremental/src/de/cau/cs/kieler/klighd/incremental/util/UIDAdapter.java +++ b/plugins/de.cau.cs.kieler.klighd.incremental/src/de/cau/cs/kieler/klighd/incremental/util/UIDAdapter.java @@ -320,9 +320,11 @@ protected void handleContainment(final Notification notification) { * * @param node * the node to add. + * @param position the position in its parent reference list where this element will be placed. + * Used for creating a consistent and unique ID if the element has no identifier. * @return the new or existing id, or {@code null} if the id is already taken. */ - private String addId(final KNode node) { + private String addId(final KNode node, int position) { String id = getId(node); if (id != null) { return id; @@ -334,7 +336,7 @@ private String addId(final KNode node) { parentId = ""; localId = "root"; } else { - parentId = addId(parent); + parentId = addId(parent, -1); // parent should already be generated. KIdentifier identifier = node.getData(KIdentifier.class); if (identifier != null) { localId = identifier.getId(); @@ -343,7 +345,7 @@ private String addId(final KNode node) { localId += label.getText(); } } else { - localId = "N" + parent.getChildren().indexOf(node); + localId = "N" + position; } } id = parentId + ID_SEPARATOR + localId; @@ -383,19 +385,19 @@ private String addId(final KEdge edge) { localId = "E"; KPort sourcePort = edge.getSourcePort(); if (sourcePort != null) { - localId += addId(sourcePort); + localId += addId(sourcePort, -1); // port should already be generated. } localId += "->"; KNode targetNode = edge.getTargetPort() == null ? edge.getTarget() : edge.getTargetPort().getNode(); if (targetNode != null) { - localId += addId(targetNode); + localId += addId(targetNode, -1); // node should already be generated. } localId += ":"; KPort targetPort = edge.getTargetPort(); if (targetPort != null) { - localId += addId(targetPort); + localId += addId(targetPort, -1); // port should already be generated. } } id = parentId + ID_SEPARATOR + localId; @@ -411,9 +413,11 @@ private String addId(final KEdge edge) { * * @param label * the label to add. + * @param position the position in its parent reference list where this element will be placed. + * Used for creating a consistent and unique ID if the element has no identifier. * @return the new or existing id, or {@code null} if the id is already taken. */ - private String addId(final KLabel label) { + private String addId(final KLabel label, int position) { String id = getId(label); if (id != null) { return id; @@ -436,7 +440,7 @@ private String addId(final KLabel label) { if (identifier != null) { localId = identifier.getId(); } else { - localId = "L" + parent.getLabels().indexOf(label); + localId = "L" + position; } id = parentId + ID_SEPARATOR + localId; } @@ -451,9 +455,11 @@ private String addId(final KLabel label) { * * @param port * the port to add. + * @param position the position in its parent reference list where this element will be placed. + * Used for creating a consistent and unique ID if the element has no identifier. * @return the new or existing id, or {@code null} if the id is already taken. */ - private String addId(final KPort port) { + private String addId(final KPort port, int position) { String id = getId(port); if (id != null) { return id; @@ -463,13 +469,13 @@ private String addId(final KPort port) { // This is a dangling element and should not be included in the graph. Give it a unique ID anyway. id = DANGLING_ELEMENT + port.hashCode(); } else { - String parentId = addId(parent); + String parentId = addId(parent, -1); // parent should already be generated. String localId = ""; KIdentifier identifier = port.getData(KIdentifier.class); if (identifier != null) { localId = identifier.getId(); } else { - localId = "P" + parent.getPorts().indexOf(port); + localId = "P" + position; } id = parentId + ID_SEPARATOR + localId; } @@ -543,21 +549,34 @@ private void removeId(final KPort port) { * Generate IDs recursively for this {@link KNode} and all its child {@link KGraphElement}s. * * @param node the node to start generating IDs from. + * @param skipEdges if the ID generation of the edges should be skipped. + * @param position the position in its parent reference list where this element will be placed. + * Used for creating a consistent and unique ID if the element has no identifier. */ - public void generateIDs(final KNode node) { - addId(node); + public void generateIDs(final KNode node, boolean skipEdges, int position) { + internalGenerateIDs(node, true, position); + // Make sure that the edges are always generated last after all connected elements are ready. + if (!skipEdges) { + internalGenerateIDs(node, false, position); + } + } + + private void internalGenerateIDs(final KNode node, boolean skipEdges, int position) { + addId(node, position); - for (KNode childNode : node.getChildren()) { - generateIDs(childNode); + for (int i = 0; i < node.getChildren().size(); ++i) { + internalGenerateIDs(node.getChildren().get(i), skipEdges, i); } - for (KPort port : node.getPorts()) { - generateIDs(port); + for (int i = 0; i < node.getPorts().size(); ++i) { + generateIDs(node.getPorts().get(i), i); } - for (KLabel label : node.getLabels()) { - generateIDs(label); + for (int i = 0; i < node.getLabels().size(); ++i) { + generateIDs(node.getLabels().get(i), i); } - for (KEdge edge : node.getOutgoingEdges()) { - generateIDs(edge); + if (!skipEdges) { + for (KEdge edge : node.getOutgoingEdges()) { + generateIDs(edge); + } } } @@ -565,12 +584,14 @@ public void generateIDs(final KNode node) { * Generate IDs recursively for this {@link KPort} and all its child {@link KGraphElement}s. * * @param port the port to start generating IDs from. + * @param position the position in its parent reference list where this element will be placed. + * Used for creating a consistent and unique ID if the element has no identifier. */ - public void generateIDs(final KPort port) { - addId(port); - - for (KLabel label : port.getLabels()) { - generateIDs(label); + public void generateIDs(final KPort port, int position) { + addId(port, position); + + for (int i = 0; i < port.getLabels().size(); ++i) { + generateIDs(port.getLabels().get(i), i); } } @@ -578,9 +599,11 @@ public void generateIDs(final KPort port) { * Generate IDs recursively for this {@link KLabel} and all its child {@link KGraphElement}s. * * @param label the label to start generating IDs from. + * @param position the position in its parent reference list where this element will be placed. + * Used for creating a consistent and unique ID if the element has no identifier. */ - public void generateIDs(final KLabel label) { - addId(label); + public void generateIDs(final KLabel label, int position) { + addId(label, position); } /** @@ -590,9 +613,9 @@ public void generateIDs(final KLabel label) { */ public void generateIDs(final KEdge edge) { addId(edge); - - for (KLabel label : edge.getLabels()) { - generateIDs(label); + + for (int i = 0; i < edge.getLabels().size(); ++i) { + generateIDs(edge.getLabels().get(i), i); } } diff --git a/plugins/de.cau.cs.kieler.klighd.incremental/src/de/cau/cs/kieler/klighd/incremental/util/UIDAdapters.java b/plugins/de.cau.cs.kieler.klighd.incremental/src/de/cau/cs/kieler/klighd/incremental/util/UIDAdapters.java index 867777397..718850fa4 100644 --- a/plugins/de.cau.cs.kieler.klighd.incremental/src/de/cau/cs/kieler/klighd/incremental/util/UIDAdapters.java +++ b/plugins/de.cau.cs.kieler.klighd.incremental/src/de/cau/cs/kieler/klighd/incremental/util/UIDAdapters.java @@ -58,7 +58,7 @@ public static UIDAdapter retrieveAdapter(final KNode node) { UIDAdapter newAdapter = new UIDAdapter(); node.eAdapters().add(newAdapter); adapters.put(node, new WeakReference(newAdapter)); - newAdapter.generateIDs(node); + newAdapter.generateIDs(node, false, 0); return newAdapter; } diff --git a/plugins/de.cau.cs.kieler.klighd.kgraph/.classpath b/plugins/de.cau.cs.kieler.klighd.kgraph/.classpath index cf36b5611..bc57d2383 100644 --- a/plugins/de.cau.cs.kieler.klighd.kgraph/.classpath +++ b/plugins/de.cau.cs.kieler.klighd.kgraph/.classpath @@ -1,6 +1,6 @@ - + diff --git a/plugins/de.cau.cs.kieler.klighd.kgraph/.settings/org.eclipse.jdt.core.prefs b/plugins/de.cau.cs.kieler.klighd.kgraph/.settings/org.eclipse.jdt.core.prefs index 5dddc113e..e6ef504f6 100644 --- a/plugins/de.cau.cs.kieler.klighd.kgraph/.settings/org.eclipse.jdt.core.prefs +++ b/plugins/de.cau.cs.kieler.klighd.kgraph/.settings/org.eclipse.jdt.core.prefs @@ -1,11 +1,18 @@ eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 -org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate +org.eclipse.jdt.core.compiler.codegen.targetPlatform=11 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=11 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate 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.release=disabled -org.eclipse.jdt.core.compiler.source=1.8 +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 diff --git a/plugins/de.cau.cs.kieler.klighd.kgraph/META-INF/MANIFEST.MF b/plugins/de.cau.cs.kieler.klighd.kgraph/META-INF/MANIFEST.MF index c4aa8b08d..db0dd8b99 100644 --- a/plugins/de.cau.cs.kieler.klighd.kgraph/META-INF/MANIFEST.MF +++ b/plugins/de.cau.cs.kieler.klighd.kgraph/META-INF/MANIFEST.MF @@ -2,9 +2,9 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: KIELER Lightweight Diagrams Graph Model Bundle-SymbolicName: de.cau.cs.kieler.klighd.kgraph;singleton:=true -Bundle-Version: 2.3.1.qualifier +Bundle-Version: 3.0.3.qualifier Bundle-ClassPath: . -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Bundle-RequiredExecutionEnvironment: JavaSE-11 Export-Package: de.cau.cs.kieler.klighd.kgraph, de.cau.cs.kieler.klighd.kgraph.impl, de.cau.cs.kieler.klighd.kgraph.util diff --git a/plugins/de.cau.cs.kieler.klighd.kgraph/pom.xml b/plugins/de.cau.cs.kieler.klighd.kgraph/pom.xml index 5f3bed2b4..a6d4f7a50 100644 --- a/plugins/de.cau.cs.kieler.klighd.kgraph/pom.xml +++ b/plugins/de.cau.cs.kieler.klighd.kgraph/pom.xml @@ -5,13 +5,11 @@ de.cau.cs.kieler.klighd parent - 2.3.1-SNAPSHOT + 3.0.3-SNAPSHOT ../../pom.xml - de.cau.cs.kieler.klighd de.cau.cs.kieler.klighd.kgraph - 2.3.1-SNAPSHOT eclipse-plugin KIELER Lightweight Diagrams Graph Model diff --git a/plugins/de.cau.cs.kieler.klighd.kgraph/src/de/cau/cs/kieler/klighd/kgraph/util/DefaultSelectionIterator.java b/plugins/de.cau.cs.kieler.klighd.kgraph/src/de/cau/cs/kieler/klighd/kgraph/util/DefaultSelectionIterator.java index fed530941..3428114eb 100644 --- a/plugins/de.cau.cs.kieler.klighd.kgraph/src/de/cau/cs/kieler/klighd/kgraph/util/DefaultSelectionIterator.java +++ b/plugins/de.cau.cs.kieler.klighd.kgraph/src/de/cau/cs/kieler/klighd/kgraph/util/DefaultSelectionIterator.java @@ -17,12 +17,11 @@ package de.cau.cs.kieler.klighd.kgraph.util; import java.util.Collections; +import java.util.HashSet; import java.util.Iterator; import com.google.common.base.Predicate; import com.google.common.collect.Iterators; -import com.google.common.collect.Sets; - import de.cau.cs.kieler.klighd.kgraph.KEdge; import de.cau.cs.kieler.klighd.kgraph.KGraphElement; import de.cau.cs.kieler.klighd.kgraph.KPort; @@ -67,7 +66,7 @@ public DefaultSelectionIterator(final KEdge edge, final boolean addPorts, protected Iterator getChildren(final Object object) { // Ensure that the visited set is properly initialized if (visited == null) { - visited = Sets.newHashSet(); + visited = new HashSet<>(); } if (object instanceof KEdge) { diff --git a/plugins/de.cau.cs.kieler.klighd.kgraph/src/de/cau/cs/kieler/klighd/kgraph/util/KGraphDataUtil.java b/plugins/de.cau.cs.kieler.klighd.kgraph/src/de/cau/cs/kieler/klighd/kgraph/util/KGraphDataUtil.java index 9fb16c27b..966926f08 100644 --- a/plugins/de.cau.cs.kieler.klighd.kgraph/src/de/cau/cs/kieler/klighd/kgraph/util/KGraphDataUtil.java +++ b/plugins/de.cau.cs.kieler.klighd.kgraph/src/de/cau/cs/kieler/klighd/kgraph/util/KGraphDataUtil.java @@ -17,6 +17,7 @@ package de.cau.cs.kieler.klighd.kgraph.util; import java.util.Collections; +import java.util.HashMap; import java.util.Iterator; import java.util.Map; @@ -33,8 +34,6 @@ import org.eclipse.emf.ecore.util.EContentsEList.FeatureIteratorImpl; import com.google.common.base.Predicate; -import com.google.common.collect.Maps; - import de.cau.cs.kieler.klighd.kgraph.EMapPropertyHolder; import de.cau.cs.kieler.klighd.kgraph.KGraphPackage; import de.cau.cs.kieler.klighd.kgraph.KLayoutData; @@ -207,7 +206,7 @@ public static KNode loadDataElements(final KNode graph, final Predicate handledTypes, final boolean clearProperties, final IProperty... knownProps) { - Map> knowPropsMap = Maps.newHashMap(); + Map> knowPropsMap = new HashMap<>(); for (IProperty p : knownProps) { knowPropsMap.put(p.getId(), p); } @@ -299,9 +298,13 @@ public static void loadDataElement(final LayoutMetaDataService dataService, // if we have a valid layout option, parse its value. if (layoutOptionData != null) { - Object layoutOptionValue = layoutOptionData.parseValue(value); - if (layoutOptionValue != null) { - propertyHolder.setProperty(layoutOptionData, layoutOptionValue); + try { + Object layoutOptionValue = layoutOptionData.parseValue(value); + if (layoutOptionValue != null) { + propertyHolder.setProperty(layoutOptionData, layoutOptionValue); + } + } catch (IllegalStateException e) { + // Some options cannot be parsed, skip these. } } else { diff --git a/plugins/de.cau.cs.kieler.klighd.kgraph/src/de/cau/cs/kieler/klighd/kgraph/util/KGraphUtil.java b/plugins/de.cau.cs.kieler.klighd.kgraph/src/de/cau/cs/kieler/klighd/kgraph/util/KGraphUtil.java index 022c8479e..d32a15e0e 100644 --- a/plugins/de.cau.cs.kieler.klighd.kgraph/src/de/cau/cs/kieler/klighd/kgraph/util/KGraphUtil.java +++ b/plugins/de.cau.cs.kieler.klighd.kgraph/src/de/cau/cs/kieler/klighd/kgraph/util/KGraphUtil.java @@ -17,6 +17,7 @@ package de.cau.cs.kieler.klighd.kgraph.util; import java.util.ArrayList; +import java.util.HashSet; import java.util.Iterator; import java.util.List; import java.util.Set; @@ -31,7 +32,6 @@ import org.eclipse.elk.graph.ElkEdge; import org.eclipse.elk.graph.ElkGraphElement; import org.eclipse.elk.graph.ElkNode; -import org.eclipse.elk.graph.ElkPort; import org.eclipse.elk.graph.util.ElkGraphUtil; import org.eclipse.emf.common.util.AbstractTreeIterator; import org.eclipse.emf.common.util.TreeIterator; @@ -44,8 +44,6 @@ import com.google.common.base.Strings; import com.google.common.collect.Iterators; import com.google.common.collect.Lists; -import com.google.common.collect.Sets; - import de.cau.cs.kieler.klighd.kgraph.EMapPropertyHolder; import de.cau.cs.kieler.klighd.kgraph.KEdge; import de.cau.cs.kieler.klighd.kgraph.KGraphElement; @@ -711,7 +709,7 @@ public static Iterator getConnectedElements(final KEdge kedge, // get a singleton iterator offering 'kedge' final Iterator kedgeIt = Iterators.singletonIterator((KGraphElement) kedge); // Keep a set of visited elements for the tree iterators - final Set visited = Sets.newHashSet(); + final Set visited = new HashSet<>(); // Grab source iterator if edge has a source final SelectionIterator sourceSideIt = diff --git a/plugins/de.cau.cs.kieler.klighd.krendering.extensions/.classpath b/plugins/de.cau.cs.kieler.klighd.krendering.extensions/.classpath index 2f5ffb21d..e769fecbe 100644 --- a/plugins/de.cau.cs.kieler.klighd.krendering.extensions/.classpath +++ b/plugins/de.cau.cs.kieler.klighd.krendering.extensions/.classpath @@ -1,6 +1,6 @@ - + diff --git a/plugins/de.cau.cs.kieler.klighd.krendering.extensions/.settings/org.eclipse.jdt.core.prefs b/plugins/de.cau.cs.kieler.klighd.krendering.extensions/.settings/org.eclipse.jdt.core.prefs index 5dddc113e..e6ef504f6 100644 --- a/plugins/de.cau.cs.kieler.klighd.krendering.extensions/.settings/org.eclipse.jdt.core.prefs +++ b/plugins/de.cau.cs.kieler.klighd.krendering.extensions/.settings/org.eclipse.jdt.core.prefs @@ -1,11 +1,18 @@ eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 -org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate +org.eclipse.jdt.core.compiler.codegen.targetPlatform=11 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=11 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate 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.release=disabled -org.eclipse.jdt.core.compiler.source=1.8 +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 diff --git a/plugins/de.cau.cs.kieler.klighd.krendering.extensions/META-INF/MANIFEST.MF b/plugins/de.cau.cs.kieler.klighd.krendering.extensions/META-INF/MANIFEST.MF index d4cbf9620..a45740700 100644 --- a/plugins/de.cau.cs.kieler.klighd.krendering.extensions/META-INF/MANIFEST.MF +++ b/plugins/de.cau.cs.kieler.klighd.krendering.extensions/META-INF/MANIFEST.MF @@ -2,17 +2,16 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: KIELER Lightweight Diagrams Xtend-based Extension Library Bundle-SymbolicName: de.cau.cs.kieler.klighd.krendering.extensions -Bundle-Version: 2.3.1.qualifier +Bundle-Version: 3.0.3.qualifier Bundle-Activator: de.cau.cs.kieler.klighd.krendering.extensions.KRenderingExtensionsPlugin Bundle-Vendor: Kiel University Require-Bundle: org.eclipse.core.runtime, - javax.inject;bundle-version="1.0.0", com.google.inject;bundle-version="3.0.0", org.eclipse.xtext.xbase.lib;bundle-version="2.4.0", org.eclipse.elk.core;bundle-version="0.1.0", de.cau.cs.kieler.klighd.krendering, de.cau.cs.kieler.klighd.kgraph -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Bundle-RequiredExecutionEnvironment: JavaSE-11 Bundle-ActivationPolicy: lazy Export-Package: de.cau.cs.kieler.klighd.krendering.extensions Automatic-Module-Name: de.cau.cs.kieler.klighd.krendering.extensions diff --git a/plugins/de.cau.cs.kieler.klighd.krendering.extensions/build.properties b/plugins/de.cau.cs.kieler.klighd.krendering.extensions/build.properties index 2a2eb15f7..4069920ae 100644 --- a/plugins/de.cau.cs.kieler.klighd.krendering.extensions/build.properties +++ b/plugins/de.cau.cs.kieler.klighd.krendering.extensions/build.properties @@ -4,3 +4,5 @@ output.. = bin/ bin.includes = META-INF/,\ about.html,\ . +bin.excludes = **/*.xtend,\ + **/*.java._trace diff --git a/plugins/de.cau.cs.kieler.klighd.krendering.extensions/pom.xml b/plugins/de.cau.cs.kieler.klighd.krendering.extensions/pom.xml index e9abc6ae6..1d1ebb9a3 100644 --- a/plugins/de.cau.cs.kieler.klighd.krendering.extensions/pom.xml +++ b/plugins/de.cau.cs.kieler.klighd.krendering.extensions/pom.xml @@ -5,13 +5,11 @@ de.cau.cs.kieler.klighd parent - 2.3.1-SNAPSHOT + 3.0.3-SNAPSHOT ../../pom.xml - de.cau.cs.kieler.klighd de.cau.cs.kieler.klighd.krendering.extensions - 2.3.1-SNAPSHOT eclipse-plugin KIELER Lightweight Diagrams Xtend-based Extension Library diff --git a/plugins/de.cau.cs.kieler.klighd.krendering/.classpath b/plugins/de.cau.cs.kieler.klighd.krendering/.classpath index 8d0c758d4..bd4b424b6 100644 --- a/plugins/de.cau.cs.kieler.klighd.krendering/.classpath +++ b/plugins/de.cau.cs.kieler.klighd.krendering/.classpath @@ -1,6 +1,6 @@ - + diff --git a/plugins/de.cau.cs.kieler.klighd.krendering/.settings/org.eclipse.jdt.core.prefs b/plugins/de.cau.cs.kieler.klighd.krendering/.settings/org.eclipse.jdt.core.prefs index 5dddc113e..a978652d6 100644 --- a/plugins/de.cau.cs.kieler.klighd.krendering/.settings/org.eclipse.jdt.core.prefs +++ b/plugins/de.cau.cs.kieler.klighd.krendering/.settings/org.eclipse.jdt.core.prefs @@ -1,11 +1,13 @@ eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 -org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=11 +org.eclipse.jdt.core.compiler.compliance=11 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.release=disabled -org.eclipse.jdt.core.compiler.source=1.8 +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 diff --git a/plugins/de.cau.cs.kieler.klighd.krendering/META-INF/MANIFEST.MF b/plugins/de.cau.cs.kieler.klighd.krendering/META-INF/MANIFEST.MF index c707850ae..09e1accba 100644 --- a/plugins/de.cau.cs.kieler.klighd.krendering/META-INF/MANIFEST.MF +++ b/plugins/de.cau.cs.kieler.klighd.krendering/META-INF/MANIFEST.MF @@ -3,10 +3,10 @@ Bundle-ManifestVersion: 2 Bundle-Name: KIELER Transient Diagram Format Definition Bundle-SymbolicName: de.cau.cs.kieler.klighd.krendering;singleton:=true Automatic-Module-Name: de.cau.cs.kieler.klighd.krendering -Bundle-Version: 2.3.1.qualifier +Bundle-Version: 3.0.3.qualifier Bundle-ClassPath: . Bundle-Vendor: Kiel University -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Bundle-RequiredExecutionEnvironment: JavaSE-11 Export-Package: de.cau.cs.kieler.klighd.krendering, de.cau.cs.kieler.klighd.krendering.impl, de.cau.cs.kieler.klighd.krendering.util diff --git a/plugins/de.cau.cs.kieler.klighd.krendering/pom.xml b/plugins/de.cau.cs.kieler.klighd.krendering/pom.xml index 342a7f3bd..e74211634 100644 --- a/plugins/de.cau.cs.kieler.klighd.krendering/pom.xml +++ b/plugins/de.cau.cs.kieler.klighd.krendering/pom.xml @@ -5,13 +5,11 @@ de.cau.cs.kieler.klighd parent - 2.3.1-SNAPSHOT + 3.0.3-SNAPSHOT ../../pom.xml - de.cau.cs.kieler.klighd de.cau.cs.kieler.klighd.krendering - 2.3.1-SNAPSHOT eclipse-plugin KIELER Transient Diagram Format Definition diff --git a/plugins/de.cau.cs.kieler.klighd.krendering/src-custom/de/cau/cs/kieler/klighd/krendering/Colors.java b/plugins/de.cau.cs.kieler.klighd.krendering/src-custom/de/cau/cs/kieler/klighd/krendering/Colors.java index 8098a4ce3..c9ac5f4cc 100644 --- a/plugins/de.cau.cs.kieler.klighd.krendering/src-custom/de/cau/cs/kieler/klighd/krendering/Colors.java +++ b/plugins/de.cau.cs.kieler.klighd.krendering/src-custom/de/cau/cs/kieler/klighd/krendering/Colors.java @@ -18,8 +18,6 @@ import java.util.HashMap; -import com.google.common.collect.Maps; - /** * An color library containing a huge collection named colors.
* The list of literals have been extracted from @@ -1755,7 +1753,7 @@ public String toStringWithComponents() { return super.toString() + "(" + redComponent + "," + greenComponent + "," + blueComponent + ")"; } - private static HashMap fastColorLookup = Maps.newHashMap(); + private static HashMap fastColorLookup = new HashMap<>(); /** * Provides the color with the name name. Besides it builds up a {@link HashMap} of diff --git a/plugins/de.cau.cs.kieler.klighd.krendering/src-custom/de/cau/cs/kieler/klighd/krendering/KRenderingOptions.java b/plugins/de.cau.cs.kieler.klighd.krendering/src-custom/de/cau/cs/kieler/klighd/krendering/KRenderingOptions.java index b17cb9a97..fea1cc0e9 100644 --- a/plugins/de.cau.cs.kieler.klighd.krendering/src-custom/de/cau/cs/kieler/klighd/krendering/KRenderingOptions.java +++ b/plugins/de.cau.cs.kieler.klighd.krendering/src-custom/de/cau/cs/kieler/klighd/krendering/KRenderingOptions.java @@ -16,8 +16,8 @@ */ package de.cau.cs.kieler.klighd.krendering; -import de.cau.cs.kieler.klighd.krendering.KRendering; import java.util.EnumSet; + import org.eclipse.elk.core.data.ILayoutMetaDataProvider; import org.eclipse.elk.core.data.LayoutOptionData; import org.eclipse.elk.graph.properties.IProperty; diff --git a/plugins/de.cau.cs.kieler.klighd.krendering/src/de/cau/cs/kieler/klighd/krendering/impl/KRenderingImpl.java b/plugins/de.cau.cs.kieler.klighd.krendering/src/de/cau/cs/kieler/klighd/krendering/impl/KRenderingImpl.java index deddb4381..01d5269c6 100644 --- a/plugins/de.cau.cs.kieler.klighd.krendering/src/de/cau/cs/kieler/klighd/krendering/impl/KRenderingImpl.java +++ b/plugins/de.cau.cs.kieler.klighd.krendering/src/de/cau/cs/kieler/klighd/krendering/impl/KRenderingImpl.java @@ -16,45 +16,27 @@ */ package de.cau.cs.kieler.klighd.krendering.impl; -import de.cau.cs.kieler.klighd.kgraph.EMapPropertyHolder; -import de.cau.cs.kieler.klighd.kgraph.KGraphData; -import de.cau.cs.kieler.klighd.kgraph.KGraphPackage; -import de.cau.cs.kieler.klighd.kgraph.PersistentEntry; - -import de.cau.cs.kieler.klighd.kgraph.impl.IPropertyToObjectMapImpl; - -import de.cau.cs.kieler.klighd.kgraph.impl.KGraphDataImpl; -import de.cau.cs.kieler.klighd.krendering.KAction; -import de.cau.cs.kieler.klighd.krendering.KContainerRendering; -import de.cau.cs.kieler.klighd.krendering.KPlacementData; -import de.cau.cs.kieler.klighd.krendering.KRendering; -import de.cau.cs.kieler.klighd.krendering.KRenderingPackage; - -import de.cau.cs.kieler.klighd.krendering.KStyle; -import de.cau.cs.kieler.klighd.krendering.KStyleHolder; import java.util.Collection; -import java.util.Map; - -import org.eclipse.elk.graph.properties.IProperty; -import org.eclipse.elk.graph.properties.IPropertyHolder; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.NotificationChain; - import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.common.util.EMap; - import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EStructuralFeature; import org.eclipse.emf.ecore.InternalEObject; - import org.eclipse.emf.ecore.impl.ENotificationImpl; - import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.EcoreEMap; import org.eclipse.emf.ecore.util.EcoreUtil; import org.eclipse.emf.ecore.util.InternalEList; +import de.cau.cs.kieler.klighd.kgraph.impl.KGraphDataImpl; +import de.cau.cs.kieler.klighd.krendering.KAction; +import de.cau.cs.kieler.klighd.krendering.KContainerRendering; +import de.cau.cs.kieler.klighd.krendering.KPlacementData; +import de.cau.cs.kieler.klighd.krendering.KRendering; +import de.cau.cs.kieler.klighd.krendering.KRenderingPackage; +import de.cau.cs.kieler.klighd.krendering.KStyle; +import de.cau.cs.kieler.klighd.krendering.KStyleHolder; + /** * * An implementation of the model object 'KRendering'. diff --git a/plugins/de.cau.cs.kieler.klighd.krendering/src/de/cau/cs/kieler/klighd/krendering/impl/KRenderingPackageImpl.java b/plugins/de.cau.cs.kieler.klighd.krendering/src/de/cau/cs/kieler/klighd/krendering/impl/KRenderingPackageImpl.java index 54ec9d992..a096f7541 100644 --- a/plugins/de.cau.cs.kieler.klighd.krendering/src/de/cau/cs/kieler/klighd/krendering/impl/KRenderingPackageImpl.java +++ b/plugins/de.cau.cs.kieler.klighd.krendering/src/de/cau/cs/kieler/klighd/krendering/impl/KRenderingPackageImpl.java @@ -16,10 +16,18 @@ */ package de.cau.cs.kieler.klighd.krendering.impl; -import de.cau.cs.kieler.klighd.kgraph.KGraphPackage; - -import de.cau.cs.kieler.klighd.kgraph.impl.KGraphPackageImpl; +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EDataType; +import org.eclipse.emf.ecore.EEnum; +import org.eclipse.emf.ecore.EGenericType; +import org.eclipse.emf.ecore.EOperation; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; +import org.eclipse.emf.ecore.ETypeParameter; +import org.eclipse.emf.ecore.impl.EPackageImpl; +import de.cau.cs.kieler.klighd.kgraph.KGraphPackage; import de.cau.cs.kieler.klighd.krendering.Arc; import de.cau.cs.kieler.klighd.krendering.Colors; import de.cau.cs.kieler.klighd.krendering.HorizontalAlignment; @@ -86,18 +94,6 @@ import de.cau.cs.kieler.klighd.krendering.Underline; import de.cau.cs.kieler.klighd.krendering.VerticalAlignment; -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EDataType; -import org.eclipse.emf.ecore.EEnum; -import org.eclipse.emf.ecore.EGenericType; -import org.eclipse.emf.ecore.EOperation; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.EReference; -import org.eclipse.emf.ecore.ETypeParameter; - -import org.eclipse.emf.ecore.impl.EPackageImpl; - /** * * An implementation of the model Package. diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/.classpath b/plugins/de.cau.cs.kieler.klighd.lsp/.classpath index 7cd7b128b..3a822149d 100644 --- a/plugins/de.cau.cs.kieler.klighd.lsp/.classpath +++ b/plugins/de.cau.cs.kieler.klighd.lsp/.classpath @@ -1,12 +1,33 @@ + - - - + + + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/.project b/plugins/de.cau.cs.kieler.klighd.lsp/.project index 27cf23a80..918374c6f 100644 --- a/plugins/de.cau.cs.kieler.klighd.lsp/.project +++ b/plugins/de.cau.cs.kieler.klighd.lsp/.project @@ -15,16 +15,6 @@ - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - org.eclipse.m2e.core.maven2Builder @@ -35,6 +25,5 @@ org.eclipse.jdt.core.javanature org.eclipse.xtext.ui.shared.xtextNature org.eclipse.m2e.core.maven2Nature - org.eclipse.pde.PluginNature diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/.settings/org.eclipse.core.resources.prefs b/plugins/de.cau.cs.kieler.klighd.lsp/.settings/org.eclipse.core.resources.prefs index 7a5313928..505845e4f 100644 --- a/plugins/de.cau.cs.kieler.klighd.lsp/.settings/org.eclipse.core.resources.prefs +++ b/plugins/de.cau.cs.kieler.klighd.lsp/.settings/org.eclipse.core.resources.prefs @@ -1,3 +1,4 @@ eclipse.preferences.version=1 encoding/=UTF-8 encoding/src=UTF-8 +encoding/xtend-gen=UTF-8 diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/.settings/org.eclipse.xtend.core.Xtend.prefs b/plugins/de.cau.cs.kieler.klighd.lsp/.settings/org.eclipse.xtend.core.Xtend.prefs index 56e3bbe88..2b65c6b65 100644 --- a/plugins/de.cau.cs.kieler.klighd.lsp/.settings/org.eclipse.xtend.core.Xtend.prefs +++ b/plugins/de.cau.cs.kieler.klighd.lsp/.settings/org.eclipse.xtend.core.Xtend.prefs @@ -2,5 +2,7 @@ BuilderConfiguration.is_project_specific=true eclipse.preferences.version=1 outlet.DEFAULT_OUTPUT.hideLocalSyntheticVariables=true outlet.DEFAULT_OUTPUT.installDslAsPrimarySource=false +outlet.DEFAULT_OUTPUT.sourceFolder.src-gen.directory=xtend-gen outlet.DEFAULT_OUTPUT.sourceFolder.src.directory=xtend-gen +outlet.DEFAULT_OUTPUT.sourceFolder.xtend-gen.directory=xtend-gen outlet.DEFAULT_OUTPUT.userOutputPerSourceFolder=true diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/META-INF/MANIFEST.MF b/plugins/de.cau.cs.kieler.klighd.lsp/META-INF/MANIFEST.MF deleted file mode 100644 index c61328d68..000000000 --- a/plugins/de.cau.cs.kieler.klighd.lsp/META-INF/MANIFEST.MF +++ /dev/null @@ -1,37 +0,0 @@ -Manifest-Version: 1.0 -Bundle-ManifestVersion: 2 -Bundle-Name: KIELER Lightweight Diagrams as Language Server -Bundle-SymbolicName: de.cau.cs.kieler.klighd.lsp;singleton:=true -Bundle-Version: 2.3.1.qualifier -Bundle-ClassPath: . -Bundle-RequiredExecutionEnvironment: JavaSE-11 -Export-Package: de.cau.cs.kieler.klighd.lsp, - de.cau.cs.kieler.klighd.lsp.gson_utils, - de.cau.cs.kieler.klighd.lsp.interactive, - de.cau.cs.kieler.klighd.lsp.interactive.layered, - de.cau.cs.kieler.klighd.lsp.interactive.rectpacking, - de.cau.cs.kieler.klighd.lsp.launch, - de.cau.cs.kieler.klighd.lsp.model, - de.cau.cs.kieler.klighd.lsp.utils -Bundle-Vendor: Kiel University -Bundle-Localization: plugin -Bundle-ActivationPolicy: lazy -Require-Bundle: de.cau.cs.kieler.kgraph.text, - de.cau.cs.kieler.klighd, - de.cau.cs.kieler.klighd.ide, - de.cau.cs.kieler.klighd.kgraph, - de.cau.cs.kieler.klighd.standalone, - com.google.gson;bundle-version="2.8.2", - com.google.inject;bundle-version="3.0.0", - org.apache.log4j;bundle-version="1.2.15", - org.eclipse.elk.alg.layered, - org.eclipse.elk.alg.rectpacking, - org.eclipse.elk.core, - org.eclipse.elk.graph, - org.eclipse.emf.ecore;bundle-version="2.14.0", - org.eclipse.lsp4j;bundle-version="0.8.0", - org.eclipse.lsp4j.generator;bundle-version="0.8.0", - org.eclipse.lsp4j.jsonrpc;bundle-version="0.8.0", - org.eclipse.sprotty;bundle-version="0.7.0", - org.eclipse.xtext.ide;bundle-version="2.21.0", - org.eclipse.xtext.xbase;bundle-version="2.21.0" diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/META-INF/services/de.cau.cs.kieler.klighd.lsp.ISprottyActionHandler b/plugins/de.cau.cs.kieler.klighd.lsp/META-INF/services/de.cau.cs.kieler.klighd.lsp.ISprottyActionHandler new file mode 100644 index 000000000..6e03b9500 --- /dev/null +++ b/plugins/de.cau.cs.kieler.klighd.lsp/META-INF/services/de.cau.cs.kieler.klighd.lsp.ISprottyActionHandler @@ -0,0 +1,3 @@ +de.cau.cs.kieler.klighd.lsp.interactive.layered.LayeredInteractiveActionHandler +de.cau.cs.kieler.klighd.lsp.interactive.rectpacking.RectpackingInteractiveActionHandler +de.cau.cs.kieler.klighd.lsp.interactive.mrtree.MrTreeActionHandler \ No newline at end of file diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/META-INF/services/de.cau.cs.kieler.klighd.lsp.interactive.IConstraintSerializer b/plugins/de.cau.cs.kieler.klighd.lsp/META-INF/services/de.cau.cs.kieler.klighd.lsp.interactive.IConstraintSerializer new file mode 100644 index 000000000..67775785d --- /dev/null +++ b/plugins/de.cau.cs.kieler.klighd.lsp/META-INF/services/de.cau.cs.kieler.klighd.lsp.interactive.IConstraintSerializer @@ -0,0 +1 @@ +de.cau.cs.kieler.klighd.lsp.interactive.ElkGraphConstraintSerializer \ No newline at end of file diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/build.properties b/plugins/de.cau.cs.kieler.klighd.lsp/build.properties index bf12396e8..d41815c23 100644 --- a/plugins/de.cau.cs.kieler.klighd.lsp/build.properties +++ b/plugins/de.cau.cs.kieler.klighd.lsp/build.properties @@ -5,5 +5,6 @@ bin.includes = .,\ plugin.xml,\ about.html META-INF/, -bin.excludes = **/*.xtend +bin.excludes = **/*.xtend,\ + **/*.java._trace src.includes = about.html diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/plugin.xml b/plugins/de.cau.cs.kieler.klighd.lsp/plugin.xml deleted file mode 100644 index d67d5efdf..000000000 --- a/plugins/de.cau.cs.kieler.klighd.lsp/plugin.xml +++ /dev/null @@ -1,17 +0,0 @@ - - - - - - - - - - - - - diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/pom.xml b/plugins/de.cau.cs.kieler.klighd.lsp/pom.xml index 01029cca8..969ec204a 100644 --- a/plugins/de.cau.cs.kieler.klighd.lsp/pom.xml +++ b/plugins/de.cau.cs.kieler.klighd.lsp/pom.xml @@ -5,12 +5,11 @@ de.cau.cs.kieler.klighd parent - 2.3.1-SNAPSHOT + 3.0.3-SNAPSHOT ../../pom.xml de.cau.cs.kieler.klighd.lsp - eclipse-plugin KIELER Lightweight Diagrams as Language Server KIELER Lightweight Diagrams as Language Server @@ -70,7 +69,7 @@
${project.groupId} - de.cau.cs.kieler.klighd.standalone + de.cau.cs.kieler.klighd.setup ${project.version} jar @@ -79,6 +78,11 @@ org.eclipse.elk.alg.layered ${elk-version} + + org.eclipse.elk + org.eclipse.elk.alg.mrtree + ${elk-version} + org.eclipse.elk org.eclipse.elk.alg.rectpacking @@ -200,17 +204,32 @@ src - - - src/resources - - org.eclipse.xtend xtend-maven-plugin + + + org.apache.maven.plugins + maven-source-plugin + 3.3.0 + + + attach-sources + verify + + jar-no-fork + + + + + + + org.apache.maven.plugins + maven-gpg-plugin +
diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/AbstractActionHandler.xtend b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/AbstractActionHandler.xtend index 0c3d93bb4..eb5a81bce 100644 --- a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/AbstractActionHandler.xtend +++ b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/AbstractActionHandler.xtend @@ -16,21 +16,25 @@ */ package de.cau.cs.kieler.klighd.lsp -import java.util.HashMap -import org.eclipse.xtend.lib.annotations.Accessors +import java.util.Map +import org.eclipse.sprotty.Action /** * Abstract class to handle Sprotty actions. - * - * @author sdo */ -abstract class AbstractActionHandler implements IActionHandler { +abstract class AbstractActionHandler implements ISprottyActionHandler { - @Accessors(PUBLIC_GETTER, PROTECTED_SETTER) - HashMap> supportedMessages = newHashMap + Map> supportedMessages + + override Map> getSupportedMessages() { + return supportedMessages + } + + def setSupportedMessages(Map> messages) { + this.supportedMessages = messages + } override canHandleAction(String kind) { - return supportedMessages.containsKey(kind) - - } + return supportedMessages.containsKey(kind) + } } \ No newline at end of file diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/IActionHandler.xtend b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/ISprottyActionHandler.xtend similarity index 84% rename from plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/IActionHandler.xtend rename to plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/ISprottyActionHandler.xtend index 56aa23794..875198c82 100644 --- a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/IActionHandler.xtend +++ b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/ISprottyActionHandler.xtend @@ -17,13 +17,16 @@ package de.cau.cs.kieler.klighd.lsp import org.eclipse.sprotty.Action +import java.util.Map /** - * Service Interface for ActionHandler. - * - * @author sdo + * Service interface for Sprotty action handlers. */ -interface IActionHandler { +interface ISprottyActionHandler { + + + def Map> getSupportedMessages(); + /** * Checks and returns true if this ActionHandler can handle this action. * @param kind String identifier of action diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/KGraphDiagramGenerator.xtend b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/KGraphDiagramGenerator.xtend index 819ad0f07..aa2ecb3c6 100644 --- a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/KGraphDiagramGenerator.xtend +++ b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/KGraphDiagramGenerator.xtend @@ -3,7 +3,7 @@ * * http://rtsys.informatik.uni-kiel.de/kieler * - * Copyright 2018-2021 by + * Copyright 2018-2024 by * + Kiel University * + Department of Computer Science * + Real-Time and Embedded Systems Group @@ -40,6 +40,7 @@ import de.cau.cs.kieler.klighd.lsp.model.SKLabel import de.cau.cs.kieler.klighd.lsp.model.SKNode import de.cau.cs.kieler.klighd.lsp.model.SKPort import de.cau.cs.kieler.klighd.lsp.utils.KGraphElementIdGenerator +import de.cau.cs.kieler.klighd.lsp.utils.KGraphMappingUtil import de.cau.cs.kieler.klighd.lsp.utils.SprottyProperties import de.cau.cs.kieler.klighd.util.KlighdPredicates import de.cau.cs.kieler.klighd.util.KlighdProperties @@ -49,9 +50,7 @@ import java.util.HashSet import java.util.List import org.apache.log4j.Logger import org.eclipse.elk.alg.layered.options.LayeredOptions -import org.eclipse.elk.alg.rectpacking.options.RectPackingOptions import org.eclipse.elk.core.options.CoreOptions -import org.eclipse.emf.ecore.EObject import org.eclipse.sprotty.Dimension import org.eclipse.sprotty.SEdge import org.eclipse.sprotty.SGraph @@ -261,6 +260,7 @@ class KGraphDiagramGenerator implements IDiagramGenerator { nodeElement.data = node.data.filter[KRenderingLibrary.isAssignableFrom(it.class)].toList setProperties(nodeElement, node) + KGraphMappingUtil.mapProperties(node, nodeElement) findSpecialRenderings(filteredData) val renderingContextData = RenderingContextData.get(node) @@ -313,6 +313,7 @@ class KGraphDiagramGenerator implements IDiagramGenerator { val renderings = edge.data.filter[KRendering.isAssignableFrom(it.class)].toList + KGraphMappingUtil.mapProperties(edge, edgeElement) findSpecialRenderings(renderings) edgeElement.children.addAll(createLabels(edge.labels)) edgeElement.junctionPoints = edge.getProperty(CoreOptions.JUNCTION_POINTS) @@ -334,6 +335,7 @@ class KGraphDiagramGenerator implements IDiagramGenerator { val renderings = port.data.filter [ KRendering.isAssignableFrom(it.class)].toList + KGraphMappingUtil.mapProperties(port, portElement) findSpecialRenderings(renderings) portElement.children.addAll(createLabels(port.labels)) @@ -355,6 +357,7 @@ class KGraphDiagramGenerator implements IDiagramGenerator { val renderings = label.data.filter[KRendering.isAssignableFrom(it.class)].toList + KGraphMappingUtil.mapProperties(label, labelElement) findSpecialRenderings(renderings) // activate the element by default if it does not have an active/inactive status yet. val renderingContextData = RenderingContextData.get(label) diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/KGraphDiagramModule.xtend b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/KGraphDiagramModule.xtend index b3065defd..e89c8a1a3 100644 --- a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/KGraphDiagramModule.xtend +++ b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/KGraphDiagramModule.xtend @@ -3,7 +3,7 @@ * * http://rtsys.informatik.uni-kiel.de/kieler * - * Copyright 2018-2021 by + * Copyright 2018-2024 by * + Kiel University * + Department of Computer Science * + Real-Time and Embedded Systems Group @@ -19,12 +19,10 @@ package de.cau.cs.kieler.klighd.lsp import com.google.inject.Module import de.cau.cs.kieler.klighd.lsp.utils.KeithDiagramSelectionListener import de.cau.cs.kieler.klighd.lsp.utils.LazyTraceProvider -import de.cau.cs.kieler.klighd.lsp.utils.SimpleTraceRegionProvider import org.eclipse.sprotty.IDiagramSelectionListener import org.eclipse.sprotty.xtext.DefaultDiagramModule import org.eclipse.sprotty.xtext.IDiagramGenerator import org.eclipse.sprotty.xtext.ls.DiagramUpdater -import org.eclipse.sprotty.xtext.tracing.TextRegionProvider import org.eclipse.xtext.ide.server.WorkspaceManager import org.eclipse.xtext.naming.IQualifiedNameProvider import org.eclipse.xtext.naming.SimpleNameProvider @@ -53,10 +51,6 @@ class KGraphDiagramModule extends DefaultDiagramModule { KGraphDiagramServer } - def Class bindTraceRegionProvider() { - SimpleTraceRegionProvider - } - override bindTraceProvider() { LazyTraceProvider } diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/KGraphDiagramServer.xtend b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/KGraphDiagramServer.xtend index 1c1ac48ff..5c893a337 100644 --- a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/KGraphDiagramServer.xtend +++ b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/KGraphDiagramServer.xtend @@ -3,7 +3,7 @@ * * http://rtsys.informatik.uni-kiel.de/kieler * - * Copyright 2018-2022 by + * Copyright 2018-2024 by * + Kiel University * + Department of Computer Science * + Real-Time and Embedded Systems Group @@ -16,19 +16,16 @@ */ package de.cau.cs.kieler.klighd.lsp -import com.google.common.base.Strings import com.google.common.base.Throwables import com.google.common.io.ByteStreams import com.google.inject.Inject +import com.google.inject.Injector import de.cau.cs.kieler.klighd.IAction import de.cau.cs.kieler.klighd.IAction.ActionContext import de.cau.cs.kieler.klighd.Klighd import de.cau.cs.kieler.klighd.KlighdDataManager import de.cau.cs.kieler.klighd.ViewContext import de.cau.cs.kieler.klighd.kgraph.KNode -import de.cau.cs.kieler.klighd.lsp.interactive.layered.LayeredInteractiveActionHandler -import de.cau.cs.kieler.klighd.lsp.interactive.rectpacking.RectpackingInteractiveActionHandler -import de.cau.cs.kieler.klighd.lsp.launch.AbstractLanguageServer import de.cau.cs.kieler.klighd.lsp.model.CheckImagesAction import de.cau.cs.kieler.klighd.lsp.model.CheckedImagesAction import de.cau.cs.kieler.klighd.lsp.model.ClientColorPreferencesAction @@ -51,10 +48,11 @@ import java.io.InputStream import java.util.ArrayList import java.util.Base64 import java.util.Collection +import java.util.HashMap import java.util.List import java.util.Map -import java.util.concurrent.CompletableFuture -import org.apache.log4j.Logger +import java.util.ServiceLoader +import java.util.Set import org.eclipse.core.runtime.Platform import org.eclipse.elk.core.data.LayoutMetaDataService import org.eclipse.elk.core.data.LayoutOptionData @@ -63,13 +61,8 @@ import org.eclipse.elk.graph.properties.IProperty import org.eclipse.emf.ecore.EObject import org.eclipse.sprotty.Action import org.eclipse.sprotty.ActionMessage -import org.eclipse.sprotty.ILayoutEngine -import org.eclipse.sprotty.IModelUpdateListener -import org.eclipse.sprotty.LayoutAction import org.eclipse.sprotty.RejectAction -import org.eclipse.sprotty.RequestBoundsAction import org.eclipse.sprotty.RequestModelAction -import org.eclipse.sprotty.SModelCloner import org.eclipse.sprotty.SModelElement import org.eclipse.sprotty.SModelRoot import org.eclipse.sprotty.SelectAction @@ -85,13 +78,10 @@ import org.eclipse.xtend.lib.annotations.Accessors * @author nre */ class KGraphDiagramServer extends LanguageAwareDiagramServer { - static val LOG = Logger.getLogger(KGraphDiagramServer) - @Inject - protected LayeredInteractiveActionHandler constraintActionHandler + @Inject protected Injector injector - @Inject - protected RectpackingInteractiveActionHandler rectpackingActionHandler + Map handlers = new HashMap @Inject protected KGraphDiagramState diagramState @@ -118,29 +108,20 @@ class KGraphDiagramServer extends LanguageAwareDiagramServer { @Accessors(PUBLIC_GETTER) protected Object modelLock = new Object - /** - * Needed for KeithUpdateModelAction - * - * FIXME Remove this if UpdateModelAction has a cause. - */ - protected String lastSubmittedModelType - - /** - * Needed for KeithUpdateModelAction - * - * FIXME Remove this if UpdateModelAction has a cause. - */ - protected int revision = 0 - /** * Needed for KeithUpdateModelAction * * FIXME Remove this if UpdateModelAction has a cause. */ new() { - currentRoot = new SModelRoot(); - currentRoot.setType("NONE"); - currentRoot.setId("ROOT"); + super() + // Create map of registered action kinds and handlers. + ServiceLoader.load(ISprottyActionHandler, KlighdDataManager.getClassLoader()).forEach[handler | + val Set kindsSupported = handler.supportedMessages.keySet + for (kind : kindsSupported) { + handlers.put(kind, handler); + } + ] } /** @@ -255,12 +236,16 @@ class KGraphDiagramServer extends LanguageAwareDiagramServer { handle(action as RefreshLayoutAction) } else if (action.getKind === RequestDiagramPieceAction.KIND) { handle(action as RequestDiagramPieceAction) - } else if (constraintActionHandler.canHandleAction(action.getKind)) { - constraintActionHandler.handle(action, clientId, this) - } else if (rectpackingActionHandler.canHandleAction(action.getKind)) { - rectpackingActionHandler.handle(action, clientId, this) } else { - super.accept(message) + val handlerInstance = handlers.get(action.kind) + if (handlerInstance !== null) { + // Even though we have an instance, it is not yet populated with all injected things. + val handler = injector.getInstance(handlerInstance.class) + handler.handle(action, clientId, this) + } else { + // If no handler is registered for this message. Let the default super class handle it. + super.accept(message) + } } } } catch (Exception e) { @@ -268,114 +253,7 @@ class KGraphDiagramServer extends LanguageAwareDiagramServer { notificationHandler.sendErrorAndThrow(e) } } - - /** - * Submit a new or updated model to the client. If client layout is required, a {@link RequestBoundsAction} - * is sent, otherwise either a {@link SetModelAction} or an {@link UpdateModelAction} is sent depending on - * the {@code update} parameter. - * Needed for KeithUpdateModelAction - * - * FIXME Remove this if UpdateModelAction has a cause. - */ - override CompletableFuture submitModel(SModelRoot newRoot, boolean update, Action cause) { - if (needsClientLayout(newRoot)) { - if (!needsServerLayout(newRoot, cause)) { - // In this case the client won't send us the computed bounds - dispatch(new RequestBoundsAction(newRoot)); - val IModelUpdateListener listener = getModelUpdateListener(); - if (listener !== null) { - listener.modelSubmitted(newRoot, this); - } - } else { - return request(new RequestBoundsAction(newRoot)).handle([response, exception | { - if (exception !== null) { - LOG.error("RequestBoundsAction failed with an exception.", exception); - } else { - try { - var SModelRoot model = handle(response); - if (model !== null) - doSubmitModel(model, true, cause); - } catch (Exception exc) { - LOG.error("Exception while processing ComputedBoundsAction.", exc); - } - } - return null; - }]) - } - } else { - doSubmitModel(newRoot, update, cause); - } - return CompletableFuture.completedFuture(null); - } - - /** - * Needed for KeithUpdateModelAction - * - * FIXME Remove this if UpdateModelAction has a cause. - */ - override CompletableFuture setModel(SModelRoot newRoot) { - if (newRoot === null) - throw new NullPointerException(); - synchronized(modelLock) { - newRoot.setRevision(revision + 1); - revision++ - currentRoot = newRoot; - } - return submitModel(newRoot, false, null); - } - - /** - * Needed for KeithUpdateModelAction - * - * FIXME Remove this if UpdateModelAction has a cause. - */ - override CompletableFuture updateModel(SModelRoot newRoot) { - if (newRoot === null) - throw new IllegalArgumentException("updateModel() cannot be called with null"); - synchronized(modelLock) { - currentRoot = newRoot; - newRoot.setRevision(revision + 1); - revision++ - } - return submitModel(newRoot, true, null); - } - - - /** - * Needed for KeithUpdateModelAction - * - * FIXME Remove this if UpdateModelAction has a cause. - */ - def void doSubmitModel(SModelRoot newRoot, boolean update, Action cause) { - val ILayoutEngine layoutEngine = getLayoutEngine(); - if (needsServerLayout(newRoot, cause)) { - AbstractLanguageServer.addToMainThreadQueue([ - layoutEngine.layout(newRoot, cause) - ]) - } - synchronized (modelLock) { - if (newRoot.getRevision() == revision) { - var String modelType = newRoot.getType(); - if (cause instanceof RequestModelAction - && !Strings.isNullOrEmpty((cause as RequestModelAction).getRequestId())) { - var RequestModelAction request = cause as RequestModelAction; - var SetModelAction response = new SetModelAction(newRoot); - response.setResponseId(request.getRequestId()); - dispatch(response); - } else if (update && modelType !== null && modelType.equals(lastSubmittedModelType)) { - dispatch(new UpdateModelAction(newRoot)); - } else { - dispatch(new SetModelAction(newRoot)); - } - lastSubmittedModelType = modelType; - var IModelUpdateListener listener = getModelUpdateListener(); - if (listener !== null) { - listener.modelSubmitted(newRoot, this); - } - } - } - } - + /** * Taken from {@code DefaultDiagramServer.handle(RequestModelAction)} to use this getModel. * Needed for KeithUpdateModelAction @@ -385,7 +263,7 @@ class KGraphDiagramServer extends LanguageAwareDiagramServer { override protected handle(RequestModelAction request) { if (model.type == 'NONE' && diagramLanguageServer !== null) { if (!request.requestId.nullOrEmpty) - LOG.warn("Model requests are not supported by the Xtext diagram server.") +// LOG.warn("Model requests are not supported by the Xtext diagram server.") copyOptions(request) synchronized (diagramState) { // In the request model action there may be some further information for the client color preferences to @@ -403,27 +281,6 @@ class KGraphDiagramServer extends LanguageAwareDiagramServer { } } - /** - * Taken from {@code DefaultDiagramServer.handle(LayoutAction)} to use this getModel. - * Needed for KeithUpdateModelAction - * - * FIXME Remove this if UpdateModelAction has a cause. - */ - override void handle(LayoutAction action) { - if (needsServerLayout(model,action)) { - // Clone the current model, as it has already been sent to the client with the old revision - val SModelCloner cloner = getSModelCloner(); - val SModelRoot newRoot = cloner.clone(model); - synchronized(modelLock) { - newRoot.setRevision(revision + 1); - revision++ - currentRoot = newRoot; - } - // the actual layout is performed in doSubmitModel - doSubmitModel(newRoot, true, action); - } - } - /** * Called when a {@link PerformActionAction} is received. * Invokes the contained KlighD {@link IAction} on the current {@link KNode KGraph}. @@ -544,6 +401,9 @@ class KGraphDiagramServer extends LanguageAwareDiagramServer { * Tells the server that the diagram should be refreshed. */ protected def handle(RefreshDiagramAction action) { + if (action.options !== null) { + getOptions().putAll(action.options) + } updateDiagram() return } @@ -659,13 +519,4 @@ class KGraphDiagramServer extends LanguageAwareDiagramServer { } newModel = false } - - /** - * Needed for KeithUpdateModelAction - * - * FIXME Remove this if UpdateModelAction has a cause. - */ - override SModelRoot getModel() { - return currentRoot; - } } diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/KGraphDiagramServerManager.xtend b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/KGraphDiagramServerManager.xtend index 964adab69..dcb15e8da 100644 --- a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/KGraphDiagramServerManager.xtend +++ b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/KGraphDiagramServerManager.xtend @@ -16,10 +16,10 @@ */ package de.cau.cs.kieler.klighd.lsp +import com.google.inject.Inject +import com.google.inject.Provider import java.util.ArrayList import java.util.List -import javax.inject.Inject -import javax.inject.Provider import org.eclipse.sprotty.xtext.IDiagramServerFactory import org.eclipse.sprotty.xtext.ls.DiagramServerManager diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/KGraphDiagramUpdater.xtend b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/KGraphDiagramUpdater.xtend index b39d7d308..2182feac4 100644 --- a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/KGraphDiagramUpdater.xtend +++ b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/KGraphDiagramUpdater.xtend @@ -3,7 +3,7 @@ * * http://rtsys.informatik.uni-kiel.de/kieler * - * Copyright 2019, 2020, 2021 by + * Copyright 2019-2024 by * + Kiel University * + Department of Computer Science * + Real-Time and Embedded Systems Group @@ -30,6 +30,7 @@ import de.cau.cs.kieler.klighd.lsp.launch.AbstractLanguageServer import de.cau.cs.kieler.klighd.lsp.model.RequestDiagramPieceAction import de.cau.cs.kieler.klighd.lsp.model.SKGraph import de.cau.cs.kieler.klighd.lsp.utils.KGraphMappingUtil +import de.cau.cs.kieler.klighd.lsp.utils.RenderingPreparer import de.cau.cs.kieler.klighd.util.KlighdProperties import de.cau.cs.kieler.klighd.util.KlighdSynthesisProperties import java.util.HashSet @@ -38,10 +39,12 @@ import java.util.Map import java.util.concurrent.CompletableFuture import org.eclipse.emf.common.util.URI import org.eclipse.emf.ecore.EObject +import org.eclipse.sprotty.Action import org.eclipse.sprotty.IDiagramServer import org.eclipse.sprotty.SGraph import org.eclipse.sprotty.SModelElement import org.eclipse.sprotty.xtext.ILanguageAwareDiagramServer +import org.eclipse.sprotty.xtext.LanguageAwareDiagramServer import org.eclipse.sprotty.xtext.ls.DiagramLanguageServer import org.eclipse.sprotty.xtext.ls.DiagramUpdater import org.eclipse.xtext.util.CancelIndicator @@ -138,7 +141,19 @@ class KGraphDiagramUpdater extends DiagramUpdater { } override protected doUpdateDiagrams(String uri, List diagramServers) { - if (diagramServers.empty) { + diagramServers.forEach[updateDiagram(it as LanguageAwareDiagramServer, null)] + return CompletableFuture.completedFuture(null) + } + + override updateDiagram(LanguageAwareDiagramServer server_, Action cause) { + if (!(server_ instanceof KGraphDiagramServer)) return super.updateDiagram(server_, cause) + + val server = server_ as KGraphDiagramServer + val uri = server.sourceUri + if (uri.isNullOrEmpty) { + val exc = new RuntimeException("Missing property 'sourceUri'.") + server.rejectRemoteRequest(cause, exc) +// LOG.error("Failed to update diagram.", exc) return CompletableFuture.completedFuture(null) } return (languageServer as KGraphLanguageServerExtension).doRead(uri) [ resource, ci | @@ -167,16 +182,13 @@ class KGraphDiagramUpdater extends DiagramUpdater { new StringBuilder, [builder, error | builder.append("\n" + error)]).toString model = new MessageModel("The model contains errors:\n" + errors) } - val model_ = model; - (diagramServers as List).forEach [ KGraphDiagramServer server | - // Only update an erroneous model if there was no diagram shown before. - if (!hasErrors || server.currentRoot.type == "NONE") { - synchronized (diagramState) { - prepareModel(server, model_, uri) - updateLayout(server) - } + // Only update an erroneous model if there was no diagram shown before. + if (!hasErrors || server.currentRoot.type == "NONE") { + synchronized (diagramState) { + prepareModel(server, model, uri) + updateLayout(server) } - ] + } return null as Void ] } @@ -312,6 +324,7 @@ class KGraphDiagramUpdater extends DiagramUpdater { var SGraph sGraph = null; synchronized (diagramState) { sGraph = diagramGenerator.toSGraph(viewContext.viewModel, uri, cancelIndicator) + RenderingPreparer.prepareRenderingIDs(viewContext.viewModel, diagramGenerator.getKGraphToSModelElementMap) } if (incrementalDiagramGenerator) { val requestManager = new KGraphDiagramPieceRequestManager(diagramGenerator as KGraphIncrementalDiagramGenerator) diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/KGraphLanguageServerExtension.xtend b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/KGraphLanguageServerExtension.xtend index c52205629..f5fe619c7 100644 --- a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/KGraphLanguageServerExtension.xtend +++ b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/KGraphLanguageServerExtension.xtend @@ -137,8 +137,7 @@ class KGraphLanguageServerExtension extends SyncDiagramLanguageServer override accept(ActionMessage message) { if (message.action instanceof RequestModelAction) { val action = message.action as RequestModelAction - val diagramType = action.diagramType - ?: action.options.get(DiagramOptions.OPTION_DIAGRAM_TYPE) + val diagramType = action.options.get(DiagramOptions.OPTION_DIAGRAM_TYPE) val server = diagramServerManager.getDiagramServer(diagramType, message.clientId) // If a diagram server is requested for the same client, but a different source file, then close the old server. // If the server does not have options yet, the server has not been used yet and does not need to be relaunched. diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/KGraphLayoutEngine.xtend b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/KGraphLayoutEngine.xtend index 9e7b91019..23f119011 100644 --- a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/KGraphLayoutEngine.xtend +++ b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/KGraphLayoutEngine.xtend @@ -3,7 +3,7 @@ * * http://rtsys.informatik.uni-kiel.de/kieler * - * Copyright 2018,2019 by + * Copyright 2018-2024 by * + Kiel University * + Department of Computer Science * + Real-Time and Embedded Systems Group @@ -18,11 +18,14 @@ package de.cau.cs.kieler.klighd.lsp import com.google.inject.Inject import de.cau.cs.kieler.klighd.LightDiagramLayoutConfig +import de.cau.cs.kieler.klighd.lsp.launch.AbstractLanguageServer import de.cau.cs.kieler.klighd.lsp.utils.KGraphMappingUtil import de.cau.cs.kieler.klighd.lsp.utils.RenderingPreparer import java.io.ByteArrayOutputStream import java.util.ArrayList import org.apache.log4j.Logger +import org.eclipse.elk.core.math.ElkPadding +import org.eclipse.elk.core.options.CoreOptions import org.eclipse.elk.graph.ElkNode import org.eclipse.emf.common.util.URI import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl @@ -48,16 +51,18 @@ class KGraphLayoutEngine extends ElkLayoutEngine { public static val LOG = Logger.getLogger(KGraphLayoutEngine) override layout(SModelRoot root, Action cause) { - synchronized (diagramState) { - if (root instanceof SGraph) { - // The layout is executed on the KGraph, not the SGraph. So get the KGraph belonging to this SGraph from - // the KGraphContext. - onlyLayoutOnKGraph(root.id) - - // map layouted KGraph to SGraph - KGraphMappingUtil.mapLayout(diagramState.getKGraphToSModelElementMap(root.id)) + AbstractLanguageServer.addToMainThreadQueue([ + synchronized (diagramState) { + if (root instanceof SGraph) { + // The layout is executed on the KGraph, not the SGraph. So get the KGraph belonging to this SGraph from + // the KGraphContext. + onlyLayoutOnKGraph(root.id) + + // map layouted KGraph to SGraph + KGraphMappingUtil.mapLayout(diagramState.getKGraphToSModelElementMap(root.id)) + } } - } + ]) } /** @@ -67,6 +72,8 @@ class KGraphLayoutEngine extends ElkLayoutEngine { */ def onlyLayoutOnKGraph(String uri) { val kGraphContext = diagramState.getKGraphContext(uri) + // Remove any padding from the root node to avoid blank padding around the edge of the entire graph. + kGraphContext.viewModel.setProperty(CoreOptions.PADDING, new ElkPadding(0)) // layout of KGraph val lightDiagramLayoutConfig = new LightDiagramLayoutConfig(kGraphContext) @@ -80,7 +87,7 @@ class KGraphLayoutEngine extends ElkLayoutEngine { synchronized (kGraphContext.viewModel) { lightDiagramLayoutConfig.performLayout - RenderingPreparer.prepareRendering(kGraphContext.viewModel) + RenderingPreparer.prepareRenderingLayout(kGraphContext.viewModel, diagramState.getKGraphToSModelElementMap(uri)) } } diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/TopDownPreservedProperties.java b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/TopDownPreservedProperties.java index a8788453e..e6f8b57a6 100644 --- a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/TopDownPreservedProperties.java +++ b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/TopDownPreservedProperties.java @@ -31,7 +31,7 @@ public class TopDownPreservedProperties implements IPreservedProperties { */ @Override public List> getProperties() { - return Arrays.asList(/*CoreOptions.TOP_DOWN_LAYOUT_RENDER_SCALE*/); + return Arrays.asList(CoreOptions.TOPDOWN_SCALE_FACTOR); } } diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/gson_utils/EObjectSerializer.xtend b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/gson_utils/EObjectSerializer.xtend index 0eb1d98af..8f9f3e027 100644 --- a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/gson_utils/EObjectSerializer.xtend +++ b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/gson_utils/EObjectSerializer.xtend @@ -20,7 +20,6 @@ import com.google.gson.JsonNull import com.google.gson.JsonObject import com.google.gson.JsonSerializationContext import com.google.gson.JsonSerializer -import de.cau.cs.kieler.klighd.KlighdDataManager import de.cau.cs.kieler.klighd.kgraph.EMapPropertyHolder import de.cau.cs.kieler.klighd.kgraph.KInsets import de.cau.cs.kieler.klighd.kgraph.impl.EMapPropertyHolderImpl diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/gson_utils/KGraphTypeAdapterUtil.xtend b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/gson_utils/KGraphTypeAdapterUtil.xtend index 3a25cfd7a..9c6d84ef8 100644 --- a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/gson_utils/KGraphTypeAdapterUtil.xtend +++ b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/gson_utils/KGraphTypeAdapterUtil.xtend @@ -3,7 +3,7 @@ * * http://rtsys.informatik.uni-kiel.de/kieler * - * Copyright 2018-2021 by + * Copyright 2018-2022 by * + Kiel University * + Department of Computer Science * + Real-Time and Embedded Systems Group @@ -17,16 +17,10 @@ package de.cau.cs.kieler.klighd.lsp.gson_utils import com.google.gson.GsonBuilder +import com.google.inject.Injector +import de.cau.cs.kieler.klighd.KlighdDataManager import de.cau.cs.kieler.klighd.SynthesisOption -import de.cau.cs.kieler.klighd.lsp.interactive.layered.DeleteLayerConstraintAction -import de.cau.cs.kieler.klighd.lsp.interactive.layered.DeletePositionConstraintAction -import de.cau.cs.kieler.klighd.lsp.interactive.layered.DeleteStaticConstraintAction -import de.cau.cs.kieler.klighd.lsp.interactive.layered.SetLayerConstraintAction -import de.cau.cs.kieler.klighd.lsp.interactive.layered.SetPositionConstraintAction -import de.cau.cs.kieler.klighd.lsp.interactive.layered.SetStaticConstraintAction -import de.cau.cs.kieler.klighd.lsp.interactive.rectpacking.RectpackingDeletePositionConstraintAction -import de.cau.cs.kieler.klighd.lsp.interactive.rectpacking.RectpackingSetPositionConstraintAction -import de.cau.cs.kieler.klighd.lsp.interactive.rectpacking.SetAspectRatioAction +import de.cau.cs.kieler.klighd.lsp.ISprottyActionHandler import de.cau.cs.kieler.klighd.lsp.model.CheckedImagesAction import de.cau.cs.kieler.klighd.lsp.model.ClientColorPreferencesAction import de.cau.cs.kieler.klighd.lsp.model.PerformActionAction @@ -35,16 +29,17 @@ import de.cau.cs.kieler.klighd.lsp.model.RefreshLayoutAction import de.cau.cs.kieler.klighd.lsp.model.RequestDiagramPieceAction import de.cau.cs.kieler.klighd.lsp.model.SetSynthesisAction import java.awt.geom.Point2D +import java.util.ServiceLoader import org.eclipse.emf.ecore.EObject import org.eclipse.sprotty.server.json.ActionTypeAdapter /** * Static util class to configure needed gson type adapters for KGraph serialization. * - * @author nre + * @author nre, sdo */ class KGraphTypeAdapterUtil { - def static GsonBuilder configureGson(GsonBuilder gsonBuilder) { + def static GsonBuilder configureGson(GsonBuilder gsonBuilder, Injector injector) { gsonBuilder .registerTypeAdapterFactory( new ActionTypeAdapter.Factory => [ @@ -56,21 +51,18 @@ class KGraphTypeAdapterUtil { addActionKind(RefreshLayoutAction.KIND, RefreshLayoutAction) addActionKind(ClientColorPreferencesAction.KIND, ClientColorPreferencesAction) - // Interactive layered actions - addActionKind(SetStaticConstraintAction.KIND, SetStaticConstraintAction) - addActionKind(SetPositionConstraintAction.KIND, SetPositionConstraintAction) - addActionKind(SetLayerConstraintAction.KIND, SetLayerConstraintAction) - addActionKind(DeleteStaticConstraintAction.KIND, DeleteStaticConstraintAction) - addActionKind(DeletePositionConstraintAction.KIND, DeletePositionConstraintAction) - addActionKind(DeleteLayerConstraintAction.KIND, DeleteLayerConstraintAction) - - // Interactive rectpacking actions - addActionKind(RectpackingSetPositionConstraintAction.KIND, RectpackingSetPositionConstraintAction) - addActionKind(RectpackingDeletePositionConstraintAction.KIND, RectpackingDeletePositionConstraintAction) - addActionKind(SetAspectRatioAction.KIND, SetAspectRatioAction) + // Load all registered action handlers and add their actions. + ServiceLoader.load(ISprottyActionHandler, KlighdDataManager.getClassLoader()).forEach[handler | + val handlerInstance = injector.getInstance(handler.class) + handlerInstance.supportedMessages.keySet.forEach[kind | + addActionKind(kind, handlerInstance.supportedMessages.get(kind)) + ] + ] // Incremental topdown actions addActionKind(RequestDiagramPieceAction.KIND, RequestDiagramPieceAction) + + ] ) .registerTypeAdapter(Point2D, new Point2DTypeAdapter) diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/ConstraintProperty.xtend b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/ConstraintProperty.xtend index 68f6cc5e9..a7de3a3c0 100644 --- a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/ConstraintProperty.xtend +++ b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/ConstraintProperty.xtend @@ -26,7 +26,8 @@ import de.cau.cs.kieler.klighd.kgraph.KNode * @author sdo */ @Data -class ConstraintProperty { +class ConstraintProperty { KNode kNode - IProperty property + IProperty property + T value } diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/ElkGraphConstraintSerializer.xtend b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/ElkGraphConstraintSerializer.xtend new file mode 100644 index 000000000..7c22d0c31 --- /dev/null +++ b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/ElkGraphConstraintSerializer.xtend @@ -0,0 +1,52 @@ +/* + * KIELER - Kiel Integrated Environment for Layout Eclipse RichClient + * + * http://rtsys.informatik.uni-kiel.de/kieler + * + * Copyright 2022 by + * + Kiel University + * + Department of Computer Science + * + Real-Time and Embedded Systems Group + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + */ +package de.cau.cs.kieler.klighd.lsp.interactive + +import de.cau.cs.kieler.klighd.internal.util.KlighdInternalProperties +import java.util.List +import org.eclipse.elk.graph.ElkNode +import org.eclipse.emf.ecore.resource.Resource + +/** + * Serializes constraint for an ELK graph by just adding the corresponding properties. + * + * @author sdo + * + */ +class ElkGraphConstraintSerializer implements IConstraintSerializer { + + override canHandle(Object graph) { + return graph instanceof ElkNode + } + + override serializeConstraints( + List> changedNodes, + Object graph, + Resource resource + ) { + val codeBefore = InteractiveUtil.serializeResource(resource) + changedNodes.forEach [ c | + val ElkNode elkNode = c.KNode.getProperty(KlighdInternalProperties.MODEL_ELEMENT) as ElkNode + elkNode.setProperty(c.property, c.value) + ] + + val codeAfter = InteractiveUtil.serializeResource(resource) + + return InteractiveUtil.calculateTextEdit(codeBefore, codeAfter) + } + +} diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/IConstraintSerializer.xtend b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/IConstraintSerializer.xtend new file mode 100644 index 000000000..db5002235 --- /dev/null +++ b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/IConstraintSerializer.xtend @@ -0,0 +1,47 @@ +/* + * KIELER - Kiel Integrated Environment for Layout Eclipse RichClient + * + * http://rtsys.informatik.uni-kiel.de/kieler + * + * Copyright 2022 by + * + Kiel University + * + Department of Computer Science + * + Real-Time and Embedded Systems Group + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + */ +package de.cau.cs.kieler.klighd.lsp.interactive + +import java.util.List +import org.eclipse.emf.ecore.resource.Resource +import org.eclipse.lsp4j.TextEdit + +/** + * Service interface for implementations that serialize a set constraint in the model. + * E.g. for ElkGraphs a property is added and the graph serialized, + * for SCCharts an Annotation with a layout constraint is added and the graph serialized. + * + * @author sdo + * + */ +interface IConstraintSerializer { + /** + * Checks whether this serializer can handle a graph type + * + * @param graph The graph to serialize + * @return true if the graph can be serialized + */ + def boolean canHandle(Object graph); + + /** + * @param changedNodes The added constraints. + * @param graph The model, e.g. SCChart or ElkGraph. + * @param resource The resource to change + * @return The TextEdit to send to the client consisting of the new text and a range. + */ + def TextEdit serializeConstraints(List> changedNodes, Object graph, Resource resource); +} \ No newline at end of file diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/InteractiveUtil.xtend b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/InteractiveUtil.xtend index 8cbb6526d..add8e671d 100644 --- a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/InteractiveUtil.xtend +++ b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/InteractiveUtil.xtend @@ -3,7 +3,7 @@ * * http://rtsys.informatik.uni-kiel.de/kieler * - * Copyright 2020 by + * Copyright 2022 by * + Kiel University * + Department of Computer Science * + Real-Time and Embedded Systems Group @@ -16,14 +16,23 @@ */ package de.cau.cs.kieler.klighd.lsp.interactive +import de.cau.cs.kieler.klighd.KlighdDataManager +import de.cau.cs.kieler.klighd.internal.util.KlighdInternalProperties +import de.cau.cs.kieler.klighd.kgraph.KIdentifier import de.cau.cs.kieler.klighd.kgraph.KNode +import de.cau.cs.kieler.klighd.lsp.KGraphLanguageClient +import de.cau.cs.kieler.klighd.lsp.KGraphLanguageServerExtension +import java.io.ByteArrayOutputStream import java.util.ArrayList import java.util.List +import java.util.ServiceLoader import org.eclipse.elk.alg.layered.options.LayeredOptions -import org.eclipse.elk.alg.rectpacking.options.RectPackingOptions -import org.eclipse.elk.core.options.CoreOptions import org.eclipse.elk.graph.ElkNode import org.eclipse.elk.graph.properties.IProperty +import org.eclipse.emf.ecore.resource.Resource +import org.eclipse.lsp4j.Position +import org.eclipse.lsp4j.Range +import org.eclipse.lsp4j.TextEdit /** * Provides utility methods for interactive layout. @@ -83,32 +92,6 @@ class InteractiveUtil { } } - /** - * Copies constraint properties depending on the algorithm from kNode to elkNode - * by using {@code copyConstraintProp()}. - * - * @param elkNode The target ElkNode - * @param kNode The source KNode of the property - */ - static def copyAllConstraints(ElkNode elkNode, KNode kNode) { - val algorithm = kNode.parent.getProperty(CoreOptions.ALGORITHM) - var List> props = #[] - if(algorithm === null || algorithm == 'layered') { - props = #[ - LayeredOptions.LAYERING_LAYER_CHOICE_CONSTRAINT, - LayeredOptions.CROSSING_MINIMIZATION_POSITION_CHOICE_CONSTRAINT - ] - } else if ("rectpacking".equals(algorithm)) { - props = #[ - RectPackingOptions.DESIRED_POSITION, - RectPackingOptions.ASPECT_RATIO - ] - } - for (prop : props) { - copyConstraintProp(elkNode, kNode, prop) - } - } - /** * Determines the root of the given node. * @@ -122,4 +105,147 @@ class InteractiveUtil { } return parent } + + /** + * Determines the nodes that are connected to {@code node} by relative constraints. + * The returned list of nodes is sorted based on the position of the nodes. + * + * @param node One node of the chain + * @param layerNodes Nodes that are in the same layer as {@code node} + * @return All nodes of the relative constraint chain of the given node present in the given layer nodes. + */ + static def getChain(KNode node, List layerNodes) { + var pos = layerNodes.indexOf(node) + var chainNodes = new ArrayList(); + chainNodes.add(node) + + // from node to the start + for (var i = pos - 1; i >= 0; i--) { + if (layerNodes.get(i).getProperty(LayeredOptions.CROSSING_MINIMIZATION_IN_LAYER_PRED_OF) == getIdOfNode(layerNodes.get(i + 1)) + || layerNodes.get(i + 1).getProperty(LayeredOptions.CROSSING_MINIMIZATION_IN_LAYER_SUCC_OF) == getIdOfNode(layerNodes.get(i))) { + chainNodes.add(0, layerNodes.get(i)) + } else { + i = -1 + } + } + + // count from node to the end + for (var i = pos + 1; i < layerNodes.size; i++) { + if (layerNodes.get(i).getProperty(LayeredOptions.CROSSING_MINIMIZATION_IN_LAYER_SUCC_OF) == getIdOfNode(layerNodes.get(i - 1)) + || layerNodes.get(i - 1).getProperty(LayeredOptions.CROSSING_MINIMIZATION_IN_LAYER_PRED_OF) == getIdOfNode(layerNodes.get(i))) { + chainNodes.add(layerNodes.get(i)) + } else { + i = layerNodes.size + } + } + + return chainNodes + } + + + /** + * Checks whether the nodes of {@code chain1} and the nodes {@code chain2} can be merged to one chain + * + * @param chain1 One of the two chains. + * @param chain2 Other one of the two chains. + * @return Returns true if the chains can be merged. + */ + static def isMergeImpossible(List chain1, List chain2) { + var connectedNodes = new ArrayList() + for (n : chain1) { + var edges = n.outgoingEdges + for (e : edges) { + connectedNodes.add(e.target) + } + edges = n.incomingEdges + for (e : edges) { + connectedNodes.add(e.source) + } + } + + for (n : connectedNodes) { + if (chain2.contains(n)) { + return true + } + } + + return false + } + + /** + * Calls serializer for corresponding model type if one was bound. + * + * @param changedNodes List of {@code ConstraintProperty} that represent the changed nodes. + * @param model The KNode that has to be changed. + * @param uri The uri of the model file that will be rewritten if a serializer exists. + */ + static def serializeConstraints(List> changedNodes, KNode model, String uri, + KGraphLanguageServerExtension languageServer, KGraphLanguageClient client + ) { + var serializer = false + + var sourceModel = model.getProperty(KlighdInternalProperties.MODEL_ELEMENT) + if (!model.hasProperty(KlighdInternalProperties.MODEL_ELEMENT)) { + sourceModel = model.children.get(0).getProperty(KlighdInternalProperties.MODEL_ELEMENT) + } + for (IConstraintSerializer cs : ServiceLoader.load(IConstraintSerializer, + KlighdDataManager.getClassLoader())) { + if (cs.canHandle(sourceModel)) { + val resource = languageServer.getResource(uri) + val textEdit = cs.serializeConstraints(changedNodes, model, resource) + // Send changes to the client. + client.replaceContentInFile(uri, textEdit.newText, textEdit.range) + // If a serializer is registered, we do not need to update the layout since the diagram will update + // since the model changes. + serializer = true + } + } + // If there is no serializer that changes the textual model (which will cause a refresh model action), + // we have to update the layout (not refresh the layout) to update based on the changed via model. + if (!serializer) { + languageServer.updateLayout(uri) + } + return + } + + /** + * Creates a string of a model resource by saving the resource and returning the output string. + * + * @param resource Resource to get the string for. + */ + static def String serializeResource(Resource resource) { + var outputStream = new ByteArrayOutputStream + resource.save(outputStream, emptyMap) + return outputStream.toString + } + + /** + * Creates a TextEdit based on the before and after text. + * + * @param codeBefore The whole text before + * @param codeAfter The new text + * @return A TextEdit that assumes that the whole code before will ne replaced. + */ + static def TextEdit calculateTextEdit(String codeBefore, String codeAfter) { + val lines = codeBefore.split("\r\n|\r|\n") + val lastLineLength = lines.get(lines.size - 1).length + val Range range = new Range(new Position(0, 0), new Position(lines.length, lastLineLength)) + return new TextEdit(range, codeAfter) + } + + /** + * Returns id of a node. + * + * @param node The node. + * @return The id string of the node. + */ + static def String getIdOfNode(KNode node) { + var nameStringOfReferenceNode = node.toString + val id = node.getData(KIdentifier) + if (id !== null) { + nameStringOfReferenceNode = id.id + } + return nameStringOfReferenceNode + } + } \ No newline at end of file diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/layered/Actions.xtend b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/layered/Actions.xtend index 42c32dcba..b352af9e0 100644 --- a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/layered/Actions.xtend +++ b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/layered/Actions.xtend @@ -141,3 +141,104 @@ class DeleteLayerConstraintAction implements Action { initializer.accept(this) } } + +/** + * Sets a 'in layer predecessor of'-constraint for a node. + * + * @author jep + */ +@Accessors +@EqualsHashCode +@ToString(skipNulls = true) +class SetInLayerPredecessorOfConstraintAction implements Action { + public static val KIND = 'setILPredOfConstraint' + String kind = KIND + + InLayerPredecessorOfConstraint constraint + + new() {} + new(Consumer initializer) { + initializer.accept(this) + } +} + +/** + * Sets a 'in layer successor of'-constraint for a node. + * + * @author jep + */ +@Accessors +@EqualsHashCode +@ToString(skipNulls = true) +class SetInLayerSuccessorOfConstraintAction implements Action { + public static val KIND = 'setILSuccOfConstraint' + String kind = KIND + + InLayerSuccessorOfConstraint constraint + + new() {} + new(Consumer initializer) { + initializer.accept(this) + } +} + +/** + * Deletes the relative constraints on the node that is identified by the given id. + * + * @author jep + */ +@Accessors +@EqualsHashCode +@ToString(skipNulls = true) +class DeleteRelativeConstraintsAction implements Action { + public static val KIND = 'deleteRelativeConstraints' + String kind = KIND + + DeleteConstraint constraint + + new() {} + new(Consumer initializer) { + initializer.accept(this) + } +} + +/** + * Deletes the iLPredOf constraint on the node that is identified by the given id. + * + * @author jep + */ +@Accessors +@EqualsHashCode +@ToString(skipNulls = true) +class DeleteInLayerPredecessorOfConstraintAction implements Action { + public static val KIND = 'deleteILPredOfConstraint' + String kind = KIND + + DeleteConstraint constraint + + new() {} + new(Consumer initializer) { + initializer.accept(this) + } +} + +/** + * Deletes the iLSuccOf constraint on the node that is identified by the given id. + * + * @author jep + */ +@Accessors +@EqualsHashCode +@ToString(skipNulls = true) +class DeleteInLayerSuccessorOfConstraintAction implements Action { + public static val KIND = 'deleteILSuccOfConstraint' + String kind = KIND + + DeleteConstraint constraint + + new() {} + new(Consumer initializer) { + initializer.accept(this) + } +} + diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/layered/ConstraintsUtils.xtend b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/layered/ConstraintsUtils.xtend index 430035bdd..8759b9021 100644 --- a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/layered/ConstraintsUtils.xtend +++ b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/layered/ConstraintsUtils.xtend @@ -22,7 +22,7 @@ import org.eclipse.elk.alg.layered.options.LayeredOptions /** * Provides a set of utility methods that is used in the constraints package. * - * @author jet, cos, sdo + * @author jep, cos, sdo */ class ConstraintsUtils { @@ -33,17 +33,17 @@ class ConstraintsUtils { /** * Returns the value of the position constraint that is set on the node. * - * @param node the instance of KNode of which you want the constraint value + * @param node The instance of KNode of which you want the constraint value * @return The position constraint of the given node. */ - def static getPosConstraint(KNode node) { + def static getPositionConstraint(KNode node) { return node.getProperty(LayeredOptions.CROSSING_MINIMIZATION_POSITION_CHOICE_CONSTRAINT) } /** * Returns the value of the layer constraint that is set on the node. * - * @param node the instance of KNode of which you want the constraint value + * @param node The instance of KNode of which you want the constraint value * @return The layer constraint of the given node. */ def static getLayerConstraint(KNode node) { @@ -54,17 +54,17 @@ class ConstraintsUtils { * Sets the value of the position constraint that is set on the node. * * @param node The instance of KNode of which you want the constraint value - * @param pos The new desired position of the node. + * @param position The new desired position of the node. */ - def static setPosConstraint(KNode node, int pos) { - node.setProperty(LayeredOptions.CROSSING_MINIMIZATION_POSITION_CHOICE_CONSTRAINT, pos) + def static setPositionConstraint(KNode node, int position) { + node.setProperty(LayeredOptions.CROSSING_MINIMIZATION_POSITION_CHOICE_CONSTRAINT, position) } /** * Sets the value of the layer constraint that is set on the node. * - * @param node the instance of KNode that should get the constraint. - * @param layer the value for the layer constraint + * @param node The instance of KNode that should get the constraint. + * @param layer The value for the layer constraint. */ def static setLayerConstraint(KNode node, int layer) { node.setProperty(LayeredOptions.LAYERING_LAYER_CHOICE_CONSTRAINT, layer) @@ -74,7 +74,7 @@ class ConstraintsUtils { * Sets the value of the layer constraint to null. * This procedure effectively deletes the constraint from the node. * - * @param node the instance of KNode of which the layer constraint is set to null + * @param node The instance of KNode of which the layer constraint is set to null */ def static nullifyLayerConstraint(KNode node) { node.setProperty(LayeredOptions.LAYERING_LAYER_CHOICE_CONSTRAINT, null) @@ -84,9 +84,9 @@ class ConstraintsUtils { * Sets the value of the position constraint to null. * This procedure effectively deletes the constraint from the node. * - * @param node the instance of KNode of which the position constraint is set to null. + * @param node The instance of KNode of which the position constraint is set to null. */ - def static nullifyPosConstraint(KNode node) { + def static nullifyPositionConstraint(KNode node) { node.setProperty(LayeredOptions.CROSSING_MINIMIZATION_POSITION_CHOICE_CONSTRAINT, null) } } diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/layered/DeleteConstraint.xtend b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/layered/DeleteConstraint.xtend index e899ea896..df4a2ee0e 100644 --- a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/layered/DeleteConstraint.xtend +++ b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/layered/DeleteConstraint.xtend @@ -21,7 +21,7 @@ import org.eclipse.xtend.lib.annotations.Data /** * Data class for a delete constraint. * - * @author jet, cos, sdo + * @author jep, cos, sdo */ @Data class DeleteConstraint { diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/layered/InLayerPredecessorOfConstraint.xtend b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/layered/InLayerPredecessorOfConstraint.xtend new file mode 100644 index 000000000..83c11118c --- /dev/null +++ b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/layered/InLayerPredecessorOfConstraint.xtend @@ -0,0 +1,30 @@ +/* + * KIELER - Kiel Integrated Environment for Layout Eclipse RichClient + * + * http://rtsys.informatik.uni-kiel.de/kieler + * + * Copyright 2022 by + * + Kiel University + * + Department of Computer Science + * + Real-Time and Embedded Systems Group + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + */ +package de.cau.cs.kieler.klighd.lsp.interactive.layered + +import org.eclipse.xtend.lib.annotations.Data + +/** + * Data class for a 'in layer predecessor of'-constraint. + * + * @author jep + */ +@Data +class InLayerPredecessorOfConstraint { + String id + String referencedNode +} diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/layered/InLayerSuccessorOfConstraint.xtend b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/layered/InLayerSuccessorOfConstraint.xtend new file mode 100644 index 000000000..a1e3a7da7 --- /dev/null +++ b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/layered/InLayerSuccessorOfConstraint.xtend @@ -0,0 +1,30 @@ +/* + * KIELER - Kiel Integrated Environment for Layout Eclipse RichClient + * + * http://rtsys.informatik.uni-kiel.de/kieler + * + * Copyright 2022 by + * + Kiel University + * + Department of Computer Science + * + Real-Time and Embedded Systems Group + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + */ +package de.cau.cs.kieler.klighd.lsp.interactive.layered + +import org.eclipse.xtend.lib.annotations.Data + +/** + * Data class for a 'in layer successor of'-constraint. + * + * @author jep + */ +@Data +class InLayerSuccessorOfConstraint { + String id + String referencedNode +} diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/layered/LayerConstraint.xtend b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/layered/LayerConstraint.xtend index c4c5f07c5..2c0256207 100644 --- a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/layered/LayerConstraint.xtend +++ b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/layered/LayerConstraint.xtend @@ -21,11 +21,11 @@ import org.eclipse.xtend.lib.annotations.Data /** * Data class for a layer constraint. * - * @author jet, cos, sdo + * @author jep, cos, sdo */ @Data class LayerConstraint { String id int layer - int layerCons + int layerConstraint } diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/layered/LayeredConstraintReevaluation.xtend b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/layered/LayeredConstraintReevaluation.xtend index d94b1ded8..32a7ad6e0 100644 --- a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/layered/LayeredConstraintReevaluation.xtend +++ b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/layered/LayeredConstraintReevaluation.xtend @@ -3,7 +3,7 @@ * * http://rtsys.informatik.uni-kiel.de/kieler * - * Copyright 2019, 2020 by + * Copyright 2019-2022 by * + Kiel University * + Department of Computer Science * + Real-Time and Embedded Systems Group @@ -20,7 +20,6 @@ import de.cau.cs.kieler.klighd.kgraph.KNode import de.cau.cs.kieler.klighd.kgraph.util.KGraphUtil import de.cau.cs.kieler.klighd.lsp.interactive.ConstraintProperty import de.cau.cs.kieler.klighd.lsp.interactive.InteractiveUtil -import java.util.HashMap import java.util.List import org.eclipse.elk.alg.layered.options.LayeredOptions import org.eclipse.xtend.lib.annotations.Accessors @@ -29,12 +28,12 @@ import org.eclipse.xtend.lib.annotations.Accessors * Class to reevaluate constraint set for the layered algorithm since they may become obsolete or have to be changed * if some node is moved. * - * @author cos, sdo + * @author cos, sdo, jep */ class LayeredConstraintReevaluation { @Accessors(PUBLIC_GETTER) - HashMap changedNodes = newHashMap() + List> changedNodes = newLinkedList() @Accessors(PUBLIC_GETTER) KNode target @@ -46,84 +45,93 @@ class LayeredConstraintReevaluation { /** * Adjusts position constraints in a layer after one node has been introduced to it. * - * @param newNodesOfLayer nodes of the new layer - * @param oldNodesOfLayer the nodes of old layer - * @param target the moved node - * @param newPos the new position of the node + * @param newNodesOfLayer The nodes of the new layer. + * @param oldNodesOfLayer The nodes of old layer. + * @param target The moved node. + * @param newPosition The new position of the node. */ - def reevaluatePositionConstraintsAfterLayerSwap(List newNodesOfLayer, List oldNodesOfLayer, KNode target, - int newPos) { - + def reevaluatePositionConstraintsAfterLayerSwap(List newNodesOfLayer, List oldNodesOfLayer, + KNode target, int newPosition) { + val chainLength = InteractiveUtil.getChain(target, oldNodesOfLayer).size // formerLayer != newLayer -- should always be true - it doesn't cause errors if it's not, though. // The node is "deleted" from its old layer if it had a position constraint the old layer - // needs to be reevaluated - offsetPosConstraintsOfLayerFrom(oldNodesOfLayer, -1, + // needs to be reevaluated. + offsetPositionConstraintsOfLayerFrom(oldNodesOfLayer, -chainLength, target.getProperty(LayeredOptions.CROSSING_MINIMIZATION_POSITION_ID), target) // The node is added at the new position in the new layer. - offsetPosConstraintsOfLayerFrom(newNodesOfLayer, 1, newPos, target) + offsetPositionConstraintsOfLayerFrom(newNodesOfLayer, chainLength, newPosition, target) } /** * Adjusts position constraints in a layer after one node has been introduced to it. * - * @param nodesOfLayer the nodes of the layer - * @param target the moved node - * @param newPos the new position of the node + * @param nodesOfLayer The nodes of the layer. + * @param target The moved node. + * @param newPosition The new position of the node. */ - def reevaluatePositionConstraintsAfterPosChangeInLayer(List nodesOfLayer, KNode target, int newPos) { - val oldPos = target.getProperty(LayeredOptions.CROSSING_MINIMIZATION_POSITION_ID) + def reevaluatePositionConstraintsAfterPositionChangeInLayer(List nodesOfLayer, KNode target, + int newPosition) { + val oldPosition = target.getProperty(LayeredOptions.CROSSING_MINIMIZATION_POSITION_ID) - if (newPos < oldPos) { - // new position constraint is above the old position - // increment all position constraints of nodes that weren't below the target beforehand - offsetPosConstraintsOfLayerFromTo(nodesOfLayer, 1, newPos, oldPos, target) + val chainLength = InteractiveUtil.getChain(target, nodesOfLayer).size + if (newPosition < oldPosition) { + // New position constraint is above the old position + // increment all position constraints of nodes that weren't below the target beforehand. + offsetPositionConstraintsOfLayerFromTo(nodesOfLayer, chainLength, newPosition, oldPosition, target) } else { - // oldPos < newPos new position constraint is below the old position - // Decrement all position constraints of nodes that weren't above the target beforehand - offsetPosConstraintsOfLayerFromTo(nodesOfLayer, -1, oldPos, newPos, target) + // oldPos < newPos: New position constraint is below the old position. + // Decrement all position constraints of nodes that weren't above the target beforehand. + offsetPositionConstraintsOfLayerFromTo(nodesOfLayer, -chainLength, oldPosition, newPosition, target) } } /** * Reevaluates position constraints in a layer after a node is removed. * - * @param nodesOfLayer the nodes in the layer - * @param removedNode the removed node + * @param nodesOfLayer The nodes in the layer. + * @param removedNode The removed node. */ def reevaluatePositionConstraintsAfterRemoval(List nodesOfLayer, KNode removedNode) { - // Offset all positional constraint greater or equal to the new one in order to conserve the - // established subsequence of nodes below the removed node - val formerPosCons = ConstraintsUtils.getPosConstraint(removedNode) - if (formerPosCons !== -1) { - offsetPosConstraintsOfLayerFrom(nodesOfLayer, -1, formerPosCons, removedNode) + // Offset all position constraints greater or equal to the new one in order to conserve the + // established subsequence of nodes below the removed node. + val formerPositionConstraint = ConstraintsUtils.getPositionConstraint(removedNode) + if (formerPositionConstraint !== null) { + offsetPositionConstraintsOfLayerFrom(nodesOfLayer, -1, formerPositionConstraint, removedNode) } } /** - * Optional reevaluation when emptying a layer should lead to its disappearance. + * Optional: Reevaluation when emptying a layer should lead to its disappearance. * Adjust layer constraints in the graph if a new layer constraint empties a layer and lets it disappear. * - * @param target the removed node - * @param targetLayer the layer id - * @param nodes the nodes in the graph + * @param target The removed node. + * @param targetLayer The layer id. + * @param nodes The nodes in the graph. + * @return True, if layers were deleted such that the targetLayer is out of bounds. */ def reevaluateAfterEmptyingALayer(KNode target, int targetLayer, List nodes) { val layerConstraintTarget = ConstraintsUtils.getLayerConstraint(target) val layerId = target.getProperty(LayeredOptions.LAYERING_LAYER_ID) - val originalLayerIndex = if (layerConstraintTarget > layerId) layerConstraintTarget else layerId + var originalLayerIndex = 0 + // Calculate previous desired layer of target. + if (layerConstraintTarget === null || layerConstraintTarget <= layerId) { + originalLayerIndex = layerId + } else { + originalLayerIndex = layerConstraintTarget + } val originalLayer = InteractiveUtil.getNodesOfLayer(originalLayerIndex, nodes) - if (originalLayer.length == 1) { - /* If a layer is emptied and disappears from the drawing - * then all LayerConstraints with a value higher or equal than - * the disappeared layer need to be decremented*/ + if (originalLayer.length == InteractiveUtil.getChain(target, originalLayer).size()) { + // If a layer is emptied and disappears from the drawing + // then all layer constraint with a value higher or equal than + // the disappeared layer need to be decremented. for (node : nodes) { - val layerCons = ConstraintsUtils.getLayerConstraint(node) - if (layerCons >= originalLayerIndex) { - changedNodes.put(new ConstraintProperty(node, LayeredOptions.LAYERING_LAYER_CHOICE_CONSTRAINT), layerCons - 1) + val layerConstraint = ConstraintsUtils.getLayerConstraint(node) + if (layerConstraint !== null && layerConstraint >= originalLayerIndex) { + changedNodes.add(new ConstraintProperty(node, LayeredOptions.LAYERING_LAYER_CHOICE_CONSTRAINT, layerConstraint - 1)) } } @@ -135,18 +143,20 @@ class LayeredConstraintReevaluation { } /** - * Shifting-Reevaluation + * Shifting-Reevaluation: * Simulates the shifting of nodes in order to adjust layer and position constraints. * - * @param insertedNode the node that is the target of the constraints - * @param posCons the value of the position constraint for insertedNode - * @param layerCons the value of the layer constraint for insertedNode - * @param oldLayerNodes The origin layer of insertedNode - * @param newLayerNodes The target layer of insertedNode - * @param nodes All nodes of the current graph + * @param insertedNode The node that is the target of the constraints. + * @param newLayerId The id of the new layer. + * @param layerConstraint The value of the layer constraint for insertedNode. + * @param newPositionId The new position in the layer. + * @param positionConstraint The value of the position constraint for insertedNode. + * @param oldLayerNodes The origin layer of insertedNode. + * @param newLayerNodes The target layer of insertedNode. + * @param nodes All nodes of the current graph. */ - def void shiftIfNecessary(KNode insertedNode, int newLayerId, int layerCons, int newPosId, int posCons, - List oldLayerNodes, List newLayerNodes, List nodes) { + def void shiftIfNecessary(KNode insertedNode, int newLayerId, int layerConstraint, int newPositionId, + int positionConstraint, List oldLayerNodes, List newLayerNodes, List nodes) { val adjacentNodes = KGraphUtil.getAdjacentNodes(insertedNode) @@ -154,44 +164,48 @@ class LayeredConstraintReevaluation { for (n : adjacentNodes) { if (newLayerNodes.contains(n)) { - // If the shifted node has a layer constraint. It needs to be incremented else the shift would have no effect. + // If the shifted node has a layer constraint. + // It needs to be incremented else the shift would have no effect. shiftedNodes.add(n) // Test whether the shift leads to more shifts in the next layer. val nextNextLayerNodes = InteractiveUtil.getNodesOfLayer(newLayerId + 1, nodes) - val nPosId = n.getProperty(LayeredOptions.CROSSING_MINIMIZATION_POSITION_ID) - val nPosCons = ConstraintsUtils.getPosConstraint(n) + val nPositionId = n.getProperty(LayeredOptions.CROSSING_MINIMIZATION_POSITION_ID) + val nPositionConstraint = ConstraintsUtils.getPositionConstraint(n) - shiftIfNecessary(n, newLayerId + 1, layerCons + 1, nPosId, nPosCons, newLayerNodes, nextNextLayerNodes, nodes) + shiftIfNecessary(n, newLayerId + 1, layerConstraint + 1, nPositionId, nPositionConstraint, + newLayerNodes, nextNextLayerNodes, nodes) } } } /** - * Position Reevaluation for Blockshifting + * Position Reevaluation for Blockshifting. * Adjusts positional constraints in the source and target layer after one node has been shifted. * - * @param shiftedNode the shifted node - * @param targetNode the node that might be changed - * @param posCons the layer the target node - * @param originLayer the previous layer of the node - * @param targetLayer the new layer of the node + * @param shiftedNode The shifted node. + * @param targetNode The node that might be changed. + * @param positionConstraint The layer the target node. + * @param oldLayer The previous layer of the node. + * @param targetLayer The new layer of the node. */ - def reevaluateAfterShift(KNode shiftedNode, KNode targetNode, int posCons, List originLayer, + def reevaluateAfterShift(KNode shiftedNode, KNode targetNode, int positionConstraint, List oldLayer, List targetLayer) { // Currently, we only shift from left to right. - // Get the position of the shiftedNode - it's the same position on which it will end up in its new layer - val posIndexOfShifted = shiftedNode.getProperty(LayeredOptions.CROSSING_MINIMIZATION_POSITION_ID) - val posConsShifted = ConstraintsUtils.getPosConstraint(shiftedNode) - if (posConsShifted !== -1) { - reevaluatePositionConstraintsAfterLayerSwap(originLayer, targetLayer, shiftedNode, posConsShifted) + // Get the position of the shiftedNode - it's the same position on which it will end up in its new layer. + val positionIndexOfShifted = shiftedNode.getProperty(LayeredOptions.CROSSING_MINIMIZATION_POSITION_ID) + val positionConstraintOfShifted = ConstraintsUtils.getPositionConstraint(shiftedNode) + if (positionConstraintOfShifted !== null) { + reevaluatePositionConstraintsAfterLayerSwap(oldLayer, targetLayer, shiftedNode, positionConstraintOfShifted) } else { - reevaluatePositionConstraintsAfterLayerSwap(originLayer, targetLayer, shiftedNode, posIndexOfShifted) + reevaluatePositionConstraintsAfterLayerSwap(oldLayer, targetLayer, shiftedNode, positionIndexOfShifted) } - // Reevaluate the position constraints in the source and target layer accordingly - // Also examine the position constraint of the target node - if (posCons > 0 && posCons >= posIndexOfShifted) { - changedNodes.put(new ConstraintProperty(targetNode, LayeredOptions.CROSSING_MINIMIZATION_POSITION_CHOICE_CONSTRAINT), posCons - 1) + // Reevaluate the position constraints in the source and target layer accordingly. + // Also examine the position constraint of the target node. + if (positionConstraint > 0 && positionConstraint >= positionIndexOfShifted) { + changedNodes.add( + new ConstraintProperty(targetNode, LayeredOptions.CROSSING_MINIMIZATION_POSITION_CHOICE_CONSTRAINT, + positionConstraint - 1)) } } @@ -200,21 +214,23 @@ class LayeredConstraintReevaluation { * than {@code startPos} and smaller than {@code endPos}. * * @param layer The layer to examine as a list including its nodes ordered by position. - * @param offset The offset that should be applied on the position constraints - * @param startPos The smallest position of the layer - * @param endPos The biggest position of the layer - * @param target The target node + * @param offset The offset that should be applied on the position constraints. + * @param startPosition The smallest position of the layer. + * @param endPosition The biggest position of the layer. + * @param target The target node. */ - def private offsetPosConstraintsOfLayerFromTo(List layer, int offset, int startPos, int endPos, - KNode target) { + def private offsetPositionConstraintsOfLayerFromTo(List layer, int offset, int startPosition, + int endPosition, KNode target) { if (!layer.empty) { - for (var i = startPos; i < endPos + 1; i++) { - val node = layer.get(i) - val posChoiceCons = ConstraintsUtils.getPosConstraint(node) + for (var currentPosition = startPosition; currentPosition < endPosition + 1; currentPosition++) { + val node = layer.get(currentPosition) + val positionConstraint = ConstraintsUtils.getPositionConstraint(node) - if (node != target && posChoiceCons !== -1) { - changedNodes.put(new ConstraintProperty(node, LayeredOptions.CROSSING_MINIMIZATION_POSITION_CHOICE_CONSTRAINT), posChoiceCons + offset) + if (node != target && positionConstraint !== null) { + changedNodes.add( + new ConstraintProperty(node, LayeredOptions.CROSSING_MINIMIZATION_POSITION_CHOICE_CONSTRAINT, + Math.max(0, positionConstraint + offset))) } } } @@ -222,14 +238,49 @@ class LayeredConstraintReevaluation { /** * Offsets all nodes in a layer by {@code offset} that own a positional constraint that is greater or equal - * than {@code startPos}. + * than {@code startPosition}. * * @param layer The layer to examine as a list including its nodes ordered by position. - * @param The offset that should be applied on the position constraints - * @param startPos The smallest position of the layer - * @param target The target node + * @param offset The offset that should be applied on the position constraints. + * @param startPosition The smallest position of the layer. + * @param target The target node. */ - def private offsetPosConstraintsOfLayerFrom(List layer, int offset, int startPos, KNode target) { - offsetPosConstraintsOfLayerFromTo(layer, offset, startPos, layer.length - 1, target) + def private offsetPositionConstraintsOfLayerFrom(List layer, int offset, int startPosition, KNode target) { + offsetPositionConstraintsOfLayerFromTo(layer, offset, startPosition, layer.length - 1, target) + } + + /** + * Updates position constraints of the moved node and the one in its chain. + * + * @param node The moved node. + * @param newPosition The new position of the moved node. + * @param chain The chain of {@code node}. + */ + def reevaluatePositionConstraintInChain(KNode node, int newPosition, List chain) { + val offset = chain.indexOf(node) + for (var i = 0; i < chain.size; i++) { + val chainedNode = chain.get(i) + if (chainedNode.getProperty(LayeredOptions.CROSSING_MINIMIZATION_POSITION_CHOICE_CONSTRAINT) !== null) { + val currentPosition = newPosition - (offset - i) + changedNodes.add( + new ConstraintProperty(chainedNode, LayeredOptions.CROSSING_MINIMIZATION_POSITION_CHOICE_CONSTRAINT, + currentPosition)) + } + } + } + + /** + * Updates layer constraint of the moved node and all other nodes in the chain to the layer of the target. + * + * @param layer New value of the layer constraints. + * @param chain Nodes of the chain the moved node is in. + */ + def reevaluateLayerConstraintsInChain(int layer, List chain) { + for (chainedNode : chain) { + if (chainedNode.getProperty(LayeredOptions.LAYERING_LAYER_CHOICE_CONSTRAINT) !== null) { + changedNodes.add(new ConstraintProperty(chainedNode, LayeredOptions.LAYERING_LAYER_CHOICE_CONSTRAINT, + layer)) + } + } } } diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/layered/LayeredInteractiveActionHandler.xtend b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/layered/LayeredInteractiveActionHandler.xtend index 67e18d96a..6057c6301 100644 --- a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/layered/LayeredInteractiveActionHandler.xtend +++ b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/layered/LayeredInteractiveActionHandler.xtend @@ -3,7 +3,7 @@ * * http://rtsys.informatik.uni-kiel.de/kieler * - * Copyright 2019, 2020 by + * Copyright 2019-2022 by * + Kiel University * + Department of Computer Science * + Real-Time and Embedded Systems Group @@ -24,7 +24,7 @@ import org.eclipse.sprotty.Action /** * Handles all sprotty actions for the layered interactive algorithm. * - * @author sdo + * @author sdo, jep */ class LayeredInteractiveActionHandler extends AbstractActionHandler { @@ -38,7 +38,12 @@ class LayeredInteractiveActionHandler extends AbstractActionHandler { SetLayerConstraintAction.KIND -> SetLayerConstraintAction, DeleteStaticConstraintAction.KIND -> DeleteStaticConstraintAction, DeletePositionConstraintAction.KIND -> DeletePositionConstraintAction, - DeleteLayerConstraintAction.KIND -> DeleteLayerConstraintAction + DeleteLayerConstraintAction.KIND -> DeleteLayerConstraintAction, + SetInLayerPredecessorOfConstraintAction.KIND -> SetInLayerPredecessorOfConstraintAction, + SetInLayerSuccessorOfConstraintAction.KIND -> SetInLayerSuccessorOfConstraintAction, + DeleteRelativeConstraintsAction.KIND -> DeleteRelativeConstraintsAction, + DeleteInLayerPredecessorOfConstraintAction.KIND -> DeleteInLayerPredecessorOfConstraintAction, + DeleteInLayerSuccessorOfConstraintAction.KIND -> DeleteInLayerSuccessorOfConstraintAction ) } @@ -67,6 +72,26 @@ class LayeredInteractiveActionHandler extends AbstractActionHandler { synchronized (server.modelLock) { constraintLS.deleteLayerConstraint(action.constraint, clientId) } + } else if (action instanceof SetInLayerPredecessorOfConstraintAction) { + synchronized (server.modelLock) { + constraintLS.setInLayerPredecessorOfConstraint(action.constraint, clientId) + } + } else if (action instanceof SetInLayerSuccessorOfConstraintAction) { + synchronized (server.modelLock) { + constraintLS.setInLayerSuccessorOfConstraint(action.constraint, clientId) + } + } else if (action instanceof DeleteRelativeConstraintsAction) { + synchronized (server.modelLock) { + constraintLS.deleteRelativeConstraints(action.constraint, clientId) + } + } else if (action instanceof DeleteInLayerPredecessorOfConstraintAction) { + synchronized (server.modelLock) { + constraintLS.deleteInLayerPredecessorOfConstraint(action.constraint, clientId) + } + } else if (action instanceof DeleteInLayerSuccessorOfConstraintAction) { + synchronized (server.modelLock) { + constraintLS.deleteILSuccOfConstraint(action.constraint, clientId) + } } else { throw new IllegalArgumentException("Action " + action.kind + " not supported by handler " + this.class.simpleName) diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/layered/LayeredInteractiveLanguageServerExtension.xtend b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/layered/LayeredInteractiveLanguageServerExtension.xtend index fa9819f16..de027a7e7 100644 --- a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/layered/LayeredInteractiveLanguageServerExtension.xtend +++ b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/layered/LayeredInteractiveLanguageServerExtension.xtend @@ -3,7 +3,7 @@ * * http://rtsys.informatik.uni-kiel.de/kieler * - * Copyright 2019, 2020 by + * Copyright 2019-2022 by * + Kiel University * + Department of Computer Science * + Real-Time and Embedded Systems Group @@ -17,25 +17,20 @@ package de.cau.cs.kieler.klighd.lsp.interactive.layered import com.google.inject.Inject -import de.cau.cs.kieler.klighd.internal.util.KlighdInternalProperties +import de.cau.cs.kieler.klighd.kgraph.KIdentifier +import com.google.inject.Singleton import de.cau.cs.kieler.klighd.kgraph.KNode +import de.cau.cs.kieler.klighd.kgraph.util.KGraphUtil import de.cau.cs.kieler.klighd.lsp.KGraphDiagramState import de.cau.cs.kieler.klighd.lsp.KGraphLanguageClient import de.cau.cs.kieler.klighd.lsp.KGraphLanguageServerExtension import de.cau.cs.kieler.klighd.lsp.LSPUtil import de.cau.cs.kieler.klighd.lsp.interactive.ConstraintProperty import de.cau.cs.kieler.klighd.lsp.interactive.InteractiveUtil -import java.io.ByteArrayOutputStream -import java.util.HashMap +import java.util.LinkedList import java.util.List -import java.util.Map -import javax.inject.Singleton import org.eclipse.elk.alg.layered.options.LayeredOptions -import org.eclipse.elk.graph.ElkNode import org.eclipse.elk.graph.properties.IProperty -import org.eclipse.lsp4j.Position -import org.eclipse.lsp4j.Range -import org.eclipse.lsp4j.TextEdit import org.eclipse.xtend.lib.annotations.Accessors import org.eclipse.xtext.ide.server.ILanguageServerAccess import org.eclipse.xtext.ide.server.ILanguageServerExtension @@ -43,7 +38,7 @@ import org.eclipse.xtext.ide.server.ILanguageServerExtension /** * Language server extension to change the layered algorithm in the interactive mode. * - * @author jet, cos, sdo + * @author jep, cos, sdo */ @Singleton class LayeredInteractiveLanguageServerExtension implements ILanguageServerExtension { @@ -60,117 +55,337 @@ class LayeredInteractiveLanguageServerExtension implements ILanguageServerExtens // Not implemented, since it is not needed. } + /** + * Sets a 'in layer predecessor'-constraint. + * + * @param constraint The constraint. + * @param clientId The client id. + */ + def setInLayerPredecessorOfConstraint(InLayerPredecessorOfConstraint constraint, String clientId) { + val uri = diagramState.getURIString(clientId) + setRelativeConstraint(LayeredOptions.CROSSING_MINIMIZATION_IN_LAYER_PRED_OF, uri, constraint.id, + constraint.getReferencedNode, clientId) + } + + /** + * Sets a 'in layer successor'-constraint. + * + * @param constraint The constraint. + * @param clientId The client id. + */ + def setInLayerSuccessorOfConstraint(InLayerSuccessorOfConstraint constraint, String clientId) { + val uri = diagramState.getURIString(clientId) + setRelativeConstraint(LayeredOptions.CROSSING_MINIMIZATION_IN_LAYER_SUCC_OF, uri, constraint.id, + constraint.getReferencedNode, clientId) + } + + /** + * Delete relative constraints. + * + * @param constraint The constraint to delete. + * @param clientId The client id. + */ + def deleteRelativeConstraints(DeleteConstraint constraint, String clientId) { + val uri = diagramState.getURIString(clientId) + val kNode = getKNode(uri, constraint.id) + if (kNode !== null) { + val changedNodes = new LinkedList> + changedNodes.add(new ConstraintProperty(kNode, LayeredOptions.CROSSING_MINIMIZATION_IN_LAYER_PRED_OF, null)) + changedNodes.add(new ConstraintProperty(kNode, LayeredOptions.CROSSING_MINIMIZATION_IN_LAYER_SUCC_OF, null)) + refreshModelInEditor(changedNodes, KGraphUtil.getRootNodeOf(kNode), uri) + } + } + + /** + * Delete in-layer-predecessor-of constraints. + * + * @param constraint The constraint to delete. + * @param clientId The client id. + */ + def deleteInLayerPredecessorOfConstraint(DeleteConstraint constraint, String clientId) { + val uri = diagramState.getURIString(clientId) + val kNode = getKNode(uri, constraint.id) + if (kNode !== null) { + val changedNodes = new LinkedList> + changedNodes.add(new ConstraintProperty(kNode, LayeredOptions.CROSSING_MINIMIZATION_IN_LAYER_PRED_OF, null)) + refreshModelInEditor(changedNodes, KGraphUtil.getRootNodeOf(kNode), uri) + } + } + + /** + * Delete in-layer-successor-of constraints. + * + * @param constraint The constraint to delete. + * @param clientId The client id. + */ + def deleteILSuccOfConstraint(DeleteConstraint constraint, String clientId) { + val uri = diagramState.getURIString(clientId) + val kNode = getKNode(uri, constraint.id) + if (kNode !== null) { + val changedNodes = new LinkedList> + changedNodes.add(new ConstraintProperty(kNode, LayeredOptions.CROSSING_MINIMIZATION_IN_LAYER_SUCC_OF, null)) + refreshModelInEditor(changedNodes, KGraphUtil.getRootNodeOf(kNode), uri) + } + } + + /** + * Sets a relative constraint with a chosen {@code value} on the node that is specified by the {@code targetId}. + * + * @param property The IProperty class of constraint that should be set. + * @param uri The uri of the diagram/file. + * @param targetId The id of the node on which the constraint should be set. + * @param referencedId The id of the node to which the relation should be set. + * @param clientId The client id. + */ + private def setRelativeConstraint( + IProperty property, + String uri, + String targetId, + String referencedId, + String clientId + ) { + val targetNode = LSPUtil.getKNode(diagramState, uri, targetId) + val parentOfNode = targetNode.parent + + // Get the actual label of the node + val referencedNode = LSPUtil.getKNode(diagramState, uri, referencedId) + + var nameStringOfReferenceNode = targetNode.toString + val id = referencedNode.getData(KIdentifier) + if (id !== null) { + nameStringOfReferenceNode = id.id + } + + if (targetNode !== null && parentOfNode !== null) { + var referenceLayer = referencedNode.getProperty(LayeredOptions.LAYERING_LAYER_ID); + var targetPosition = referencedNode.getProperty(LayeredOptions.CROSSING_MINIMIZATION_POSITION_ID); + + // Update target position depending on the constraint that should be set. + if (referenceLayer === targetNode.getProperty(LayeredOptions.LAYERING_LAYER_ID) && + targetPosition > targetNode.getProperty(LayeredOptions.CROSSING_MINIMIZATION_POSITION_ID)) { + targetPosition--; + } + if (property === LayeredOptions.CROSSING_MINIMIZATION_IN_LAYER_SUCC_OF) { + targetPosition++; + } + + var layerNodes = InteractiveUtil.getNodesOfLayer(referenceLayer, parentOfNode.children) + var oldLayerNodes = InteractiveUtil.getNodesOfLayer( + targetNode.getProperty(LayeredOptions.LAYERING_LAYER_ID), parentOfNode.children) + + // Update position constraints. + val layerSwap = referenceLayer !== targetNode.getProperty(LayeredOptions.LAYERING_LAYER_ID) + var relativeConstraintReevaluation = new RelativeConstraintReevaluation(targetNode) + var absoluteConstraintReevaluation = new LayeredConstraintReevaluation(targetNode) + + targetNode.setProperty(property, null); + var List chain = InteractiveUtil.getChain(targetNode, oldLayerNodes) + + if (layerSwap) { + absoluteConstraintReevaluation. + reevaluatePositionConstraintsAfterLayerSwap(layerNodes, oldLayerNodes, targetNode, targetPosition) + absoluteConstraintReevaluation.reevaluateLayerConstraintsInChain(referenceLayer, chain) + } else { + if (targetPosition !== targetNode.getProperty(LayeredOptions.CROSSING_MINIMIZATION_POSITION_ID) && + chain.contains(referencedNode) && + targetPosition >= chain.get(0).getProperty(LayeredOptions.CROSSING_MINIMIZATION_POSITION_ID) && + targetPosition <= + chain.get(chain.size - 1).getProperty(LayeredOptions.CROSSING_MINIMIZATION_POSITION_ID)) { + // Node is moved within its chain. + relativeConstraintReevaluation.reevaluateRelativeConstraintAfterSwapInChain(targetNode, oldLayerNodes) + } + absoluteConstraintReevaluation. + reevaluatePositionConstraintsAfterPositionChangeInLayer(layerNodes, targetNode, targetPosition) + } + + var posCons = targetPosition + if (layerSwap || + targetPosition < targetNode.getProperty(LayeredOptions.CROSSING_MINIMIZATION_POSITION_ID)) { + // Position ids must be increased by the number of predecessors. + posCons = targetPosition + chain.indexOf(targetNode) + } + + absoluteConstraintReevaluation.reevaluatePositionConstraintInChain(targetNode, posCons, chain) + + // Update relative constraints. + if (layerSwap || + targetPosition !== targetNode.getProperty(LayeredOptions.CROSSING_MINIMIZATION_POSITION_ID)) { + relativeConstraintReevaluation.checkRelativeConstraints(targetNode, targetPosition, layerNodes, oldLayerNodes, + property) + relativeConstraintReevaluation.reevaluateRelativeConstraints(targetNode, targetPosition, layerNodes, oldLayerNodes) + } + val changedNodes = absoluteConstraintReevaluation.changedNodes + changedNodes.addAll(relativeConstraintReevaluation.changedNodes) + changedNodes.add(new ConstraintProperty(targetNode, property, nameStringOfReferenceNode)) + if (layerSwap) { + // Already apply changes to be able to correctly identify if a chain is split because of the new + // relative constraint. + changedNodes.forEach[constraint| + val KNode kNode = constraint.KNode + kNode.setProperty(constraint.property, constraint.value) + ] + absoluteConstraintReevaluation.reevaluateAfterEmptyingALayer(targetNode, referenceLayer, parentOfNode.children) + } + refreshModelInEditor(changedNodes, KGraphUtil.getRootNodeOf(targetNode), uri) + } + } + /** * Sets a layer constraint. - * @param lc the layer constraint - * @param clientId the client id + * + * @param constraint The layer constraint. + * @param clientId The client id. */ - def setLayerConstraint(LayerConstraint lc, String clientId) { + def setLayerConstraint(LayerConstraint constraint, String clientId) { val uri = diagramState.getURIString(clientId) - setConstraint(LayeredOptions.LAYERING_LAYER_CHOICE_CONSTRAINT, uri, lc.id, lc.layer, lc.layerCons) + setConstraint(LayeredOptions.LAYERING_LAYER_CHOICE_CONSTRAINT, uri, constraint.id, constraint.layer, + constraint.getLayerConstraint, clientId) } /** * Sets a position constraint. - * @param pc the position constraint - * @param clientId the client id + * + * @param constraint The position constraint. + * @param clientId The client id. */ - def setPositionConstraint(PositionConstraint pc, String clientId) { + def setPositionConstraint(PositionConstraint constraint, String clientId) { val uri = diagramState.getURIString(clientId) - setConstraint(LayeredOptions.CROSSING_MINIMIZATION_POSITION_CHOICE_CONSTRAINT, uri, pc.id, - pc.position, pc.posCons) + setConstraint(LayeredOptions.CROSSING_MINIMIZATION_POSITION_CHOICE_CONSTRAINT, uri, constraint.id, + constraint.position, constraint.getPositionConstraint, clientId) } /** * Sets a layer constraint and a positional constraint that * are encapsulated in an instance of StaticConstraint. - * @param sc the constraint - * @param clientId the client id + * + * @param constraint The constraint. + * @param clientId The client id. */ - def setStaticConstraint(StaticConstraint sc, String clientId) { + def setStaticConstraint(StaticConstraint constraint, String clientId) { val uri = diagramState.getURIString(clientId) - val kNode = LSPUtil.getKNode(diagramState, uri, sc.id) + val kNode = LSPUtil.getKNode(diagramState, uri, constraint.id) val parentOfNode = kNode.parent // In case that the interactive mode is active, the viewContext is not null // and the element is actually a KNode. Carry on. if (kNode !== null && parentOfNode !== null) { - /* - * As long as no increased pos constraint is present in the target layer - * and no increased layer constraint is present left to the target layer - * newLayerId === newLayer Cons && newPosCons = newPosId - * In the other cases both values can differ. - */ + // As long as no increased position constraint is present in the target layer + // and no increased layer constraint is present left to the target layer + // newLayerId === newLayerConstraint && newPosCons = newPosId + // In the other cases both values can differ. var allNodes = parentOfNode.children - var newLayerId = sc.layer - val newPosId = sc.position - val newPosCons = sc.posCons - var newLayerCons = sc.layerCons - + var newLayerId = constraint.layer + var newLayerConstraint = constraint.getLayerConstraint + val List> changedNodes = newLinkedList; + // If layerId is -1 all other nodes need to have their layerId and layerChoiceId increased. + if (newLayerConstraint == -1) { + newLayerId++ + newLayerConstraint++ + allNodes.forEach[node | + if (node.hasProperty(LayeredOptions.LAYERING_LAYER_ID)) { + node.setProperty(LayeredOptions.LAYERING_LAYER_ID, + node.getProperty(LayeredOptions.LAYERING_LAYER_ID) + 1 + ) + } + if (node != kNode && node.hasProperty(LayeredOptions.LAYERING_LAYER_CHOICE_CONSTRAINT)) { + node.setProperty(LayeredOptions.LAYERING_LAYER_CHOICE_CONSTRAINT, + node.getProperty(LayeredOptions.LAYERING_LAYER_CHOICE_CONSTRAINT) + 1 + ) + changedNodes.add(new ConstraintProperty(node, LayeredOptions.LAYERING_LAYER_CHOICE_CONSTRAINT, + node.getProperty(LayeredOptions.LAYERING_LAYER_CHOICE_CONSTRAINT) + )) + } + ] + } + val layerId = kNode.getProperty(LayeredOptions.LAYERING_LAYER_ID) var targetLayerNodes = InteractiveUtil.getNodesOfLayer(newLayerId, allNodes) var oldLayerNodes = InteractiveUtil.getNodesOfLayer(layerId, allNodes) - + + val chain = InteractiveUtil.getChain(kNode, oldLayerNodes) + // posID must be increased by the number of predecessors + val newPositionId = constraint.position + chain.indexOf(kNode) + val newPositionConstraint = constraint.getPositionConstraint + chain.indexOf(kNode) + // Reevaluate insertion of node to target layer - var reval = new LayeredConstraintReevaluation(kNode) + var absoluteConstraintReevaluation = new LayeredConstraintReevaluation(kNode) - if (reval.reevaluateAfterEmptyingALayer(kNode, newLayerCons, allNodes)) { - newLayerCons-- + if (absoluteConstraintReevaluation.reevaluateAfterEmptyingALayer(kNode, newLayerConstraint, allNodes)) { + newLayerConstraint-- } - reval.reevaluatePositionConstraintsAfterLayerSwap(targetLayerNodes, oldLayerNodes, kNode, newPosId) + absoluteConstraintReevaluation. + reevaluatePositionConstraintsAfterLayerSwap(targetLayerNodes, oldLayerNodes, kNode, newPositionId) + absoluteConstraintReevaluation.reevaluateLayerConstraintsInChain(newLayerConstraint, chain) + absoluteConstraintReevaluation.reevaluatePositionConstraintInChain(kNode, newPositionConstraint, chain) - var changedNodes = reval.changedNodes - changedNodes.put(new ConstraintProperty(kNode, LayeredOptions.CROSSING_MINIMIZATION_POSITION_CHOICE_CONSTRAINT), newPosCons) - changedNodes.put(new ConstraintProperty(kNode, LayeredOptions.LAYERING_LAYER_CHOICE_CONSTRAINT), newLayerCons) - // Update source code of the model - refreshModelInEditor(changedNodes, uri) + changedNodes.addAll(absoluteConstraintReevaluation.changedNodes) + changedNodes.add( + new ConstraintProperty(kNode, LayeredOptions.CROSSING_MINIMIZATION_POSITION_CHOICE_CONSTRAINT, + newPositionConstraint)) + changedNodes.add( + new ConstraintProperty(kNode, LayeredOptions.LAYERING_LAYER_CHOICE_CONSTRAINT, newLayerConstraint)) + + // Update relative constraints. + var relativeCOnstraintReevaluation = new RelativeConstraintReevaluation(kNode) + relativeCOnstraintReevaluation.reevaluateRelativeConstraints(kNode, newPositionId, targetLayerNodes, oldLayerNodes) + changedNodes.addAll(relativeCOnstraintReevaluation.changedNodes) + // Update source code of the model. + refreshModelInEditor(changedNodes, KGraphUtil.getRootNodeOf(kNode), uri) } } /** * Delete a constraint. - * @param dc the constraint o delete - * @param clientId the client id + * + * @param constraint The constraint to delete. + * @param clientId The client id. */ - def deleteStaticConstraint(DeleteConstraint dc, String clientId) { + def deleteStaticConstraint(DeleteConstraint constraint, String clientId) { val uri = diagramState.getURIString(clientId) - val kNode = getKNode(uri, dc.id) + val kNode = getKNode(uri, constraint.id) if (kNode !== null) { - val changedNodes = newHashMap() - changedNodes.put(new ConstraintProperty(kNode, LayeredOptions.CROSSING_MINIMIZATION_POSITION_CHOICE_CONSTRAINT), null) - changedNodes.put(new ConstraintProperty(kNode, LayeredOptions.LAYERING_LAYER_CHOICE_CONSTRAINT), null) - refreshModelInEditor(changedNodes, uri) + val changedNodes = new LinkedList> + changedNodes.add( + new ConstraintProperty(kNode, LayeredOptions.CROSSING_MINIMIZATION_POSITION_CHOICE_CONSTRAINT, null)) + changedNodes.add(new ConstraintProperty(kNode, LayeredOptions.LAYERING_LAYER_CHOICE_CONSTRAINT, null)) + refreshModelInEditor(changedNodes, KGraphUtil.getRootNodeOf(kNode), uri) } } /** * Delete a position constraint. - * @param dc the position constraint o delete - * @param clientId the client id + * + * @param constraint The position constraint to delete. + * @param clientId The client id. */ - def deletePositionConstraint(DeleteConstraint dc, String clientId) { + def deletePositionConstraint(DeleteConstraint constraint, String clientId) { val uri = diagramState.getURIString(clientId) - val kNode = getKNode(uri, dc.id) + val kNode = getKNode(uri, constraint.id) if (kNode !== null) { - val changedNodes = newHashMap() - changedNodes.put(new ConstraintProperty(kNode, LayeredOptions.CROSSING_MINIMIZATION_POSITION_CHOICE_CONSTRAINT), null) - refreshModelInEditor(changedNodes, uri) + val changedNodes = new LinkedList> + changedNodes.add(new ConstraintProperty( + kNode, + LayeredOptions.CROSSING_MINIMIZATION_POSITION_CHOICE_CONSTRAINT, + null + )) + refreshModelInEditor(changedNodes, KGraphUtil.getRootNodeOf(kNode), uri) } } /** * Delete a layer constraint. - * @param dc the layer constraint o delete - * @param clientId the client id + * + * @param constraint The layer constraint to delete. + * @param clientId The client id. */ - def deleteLayerConstraint(DeleteConstraint dc, String clientId) { + def deleteLayerConstraint(DeleteConstraint constraint, String clientId) { val uri = diagramState.getURIString(clientId) - val kNode = getKNode(uri, dc.id) + val kNode = getKNode(uri, constraint.id) if (kNode !== null) { - val changedNodes = newHashMap() - changedNodes.put(new ConstraintProperty(kNode, LayeredOptions.LAYERING_LAYER_CHOICE_CONSTRAINT), null) - refreshModelInEditor(changedNodes, uri) + val changedNodes = new LinkedList> + changedNodes.add(new ConstraintProperty(kNode, LayeredOptions.LAYERING_LAYER_CHOICE_CONSTRAINT, null)) + refreshModelInEditor(changedNodes, KGraphUtil.getRootNodeOf(kNode), uri) } } @@ -178,30 +393,97 @@ class LayeredInteractiveLanguageServerExtension implements ILanguageServerExtens * Sets a layer or position constraint with a chosen {@code value} on the node * that is specified by the {@code targetID}. * - * @param PropID the type of constraint that should be set (LayerConstraint or PositionConstraint) - * The IProperty class is expected. + * @param property The IProperty of constraint that should be set (LayerConstraint or PositionConstraint). * @param uri The uri of the diagram/file. * @param targetId The id of the node on which the constraint should be set. - * @param value Either the id of the position or the id of the layer. + * @param oldValue Either the id of the position or the id of the layer. + * @param newValue Either the value if the position constraint or the layer constraint. + * @param cliendId The client id. */ - private def setConstraint(IProperty property, String uri, String targetId, int valueId, int valueCons) { + private def setConstraint(IProperty property, String uri, String targetId, int oldValue, int newValue, + String clientId + ) { val kNode = LSPUtil.getKNode(diagramState, uri, targetId) val parentOfNode = kNode.parent if (kNode !== null && parentOfNode !== null) { - var layerID = kNode.getProperty(LayeredOptions.LAYERING_LAYER_ID) - var List residingLayer - residingLayer = InteractiveUtil.getNodesOfLayer(layerID, parentOfNode.children) + var layerId = kNode.getProperty(LayeredOptions.LAYERING_LAYER_ID) + var positionId = kNode.getProperty(LayeredOptions.CROSSING_MINIMIZATION_POSITION_CHOICE_CONSTRAINT); + if (property === LayeredOptions.LAYERING_LAYER_CHOICE_CONSTRAINT) { + layerId = oldValue + } + var newValueConstraint = newValue + var newValueId = oldValue + + val List> changedNodes = newLinkedList; + // If layerId is -1 all other nodes need to have their layerId and layerChoiceId increased. + if (oldValue == -1) { + layerId++ + newValueId++ + newValueConstraint++ + parentOfNode.children.forEach[node | + if (node.hasProperty(LayeredOptions.LAYERING_LAYER_ID)) { + node.setProperty(LayeredOptions.LAYERING_LAYER_ID, + node.getProperty(LayeredOptions.LAYERING_LAYER_ID) + 1 + ) + } + if (node != kNode && node.hasProperty(LayeredOptions.LAYERING_LAYER_CHOICE_CONSTRAINT)) { + node.setProperty(LayeredOptions.LAYERING_LAYER_CHOICE_CONSTRAINT, + node.getProperty(LayeredOptions.LAYERING_LAYER_CHOICE_CONSTRAINT) + 1 + ) + changedNodes.add(new ConstraintProperty(node, LayeredOptions.LAYERING_LAYER_CHOICE_CONSTRAINT, + node.getProperty(LayeredOptions.LAYERING_LAYER_CHOICE_CONSTRAINT) + )) + } + ] + } + + var List layerNodes = InteractiveUtil.getNodesOfLayer(layerId, parentOfNode.children) + val oldLayerNodes = InteractiveUtil.getNodesOfLayer(kNode.getProperty(LayeredOptions.LAYERING_LAYER_ID), + parentOfNode.children + ) - var reval = new LayeredConstraintReevaluation(kNode) + val oldPosition = kNode.getProperty(LayeredOptions.CROSSING_MINIMIZATION_POSITION_ID) + + var relativeConstraintReevaluation = new RelativeConstraintReevaluation(kNode) + val chain = InteractiveUtil.getChain(kNode, oldLayerNodes) + if (property === LayeredOptions.CROSSING_MINIMIZATION_POSITION_CHOICE_CONSTRAINT) { + positionId = oldValue + if (positionId != -1 && + positionId >= chain.get(0).getProperty(LayeredOptions.CROSSING_MINIMIZATION_POSITION_ID) && + positionId <= chain.get(chain.size - 1).getProperty(LayeredOptions.CROSSING_MINIMIZATION_POSITION_ID)) { + // node is moved within its chain + relativeConstraintReevaluation.reevaluateRelativeConstraintAfterSwapInChain(kNode, oldLayerNodes) + } else if (positionId < oldPosition) { + // posID must be increased by the number of predecessors + newValueConstraint += chain.indexOf(kNode) + newValueId += chain.indexOf(kNode) + } + } + + var absoluteConstraintReevalution = new LayeredConstraintReevaluation(kNode) switch (property) { - case LayeredOptions.CROSSING_MINIMIZATION_POSITION_CHOICE_CONSTRAINT: - reval.reevaluatePositionConstraintsAfterPosChangeInLayer(residingLayer, kNode, valueId) + case LayeredOptions.CROSSING_MINIMIZATION_POSITION_CHOICE_CONSTRAINT: { + absoluteConstraintReevalution.reevaluatePositionConstraintsAfterPositionChangeInLayer(layerNodes, kNode, newValueId) + absoluteConstraintReevalution.reevaluatePositionConstraintInChain(kNode, newValueConstraint, chain) + } + case LayeredOptions.LAYERING_LAYER_CHOICE_CONSTRAINT: { + absoluteConstraintReevalution.reevaluateLayerConstraintsInChain(layerId, chain) + if (absoluteConstraintReevalution.reevaluateAfterEmptyingALayer(kNode, newValueConstraint, parentOfNode.children)) { + newValueConstraint-- + } + } } - var changedNodes = reval.changedNodes - changedNodes.put(new ConstraintProperty(kNode, property), valueCons) - refreshModelInEditor(changedNodes, uri) + changedNodes.addAll(absoluteConstraintReevalution.changedNodes) + changedNodes.add(new ConstraintProperty(kNode, property, newValueConstraint)) + + // Update relative constraints. + if (positionId !== null) { + relativeConstraintReevaluation.reevaluateRelativeConstraints(kNode, positionId, layerNodes, oldLayerNodes) + changedNodes.addAll(relativeConstraintReevaluation.changedNodes) + }; + refreshModelInEditor(changedNodes, KGraphUtil.getRootNodeOf(kNode), uri) } } @@ -213,9 +495,9 @@ class LayeredInteractiveLanguageServerExtension implements ILanguageServerExtens * This version of getKNode retrieves the root itself. If you already have retrieved the root, * then you should use the other variant. * - * @param uri The resource's uri - * @param nodeId The Id of the requested KNode - * @return The requested node + * @param uri The resource's uri. + * @param nodeId The Id of the requested KNode. + * @return The requested node. */ private def getKNode(String uri, String nodeId) { return LSPUtil.getKNode(diagramState, uri, nodeId) @@ -224,49 +506,16 @@ class LayeredInteractiveLanguageServerExtension implements ILanguageServerExtens /** * Sends request to the client to update the file according to the property changes. * - * @param changedNodes list of all changes to nodes - * @param uri uri of resource + * @param changedNodes The list of all changes to nodes. + * @param model The main kNode. + * @param uri The uri of resource. */ - def refreshModelInEditor(HashMap changedNodes, String uri) { - val resource = languageServer.getResource(uri) - - // Get previous file content as String - var outputStream = new ByteArrayOutputStream - resource.save(outputStream, emptyMap) - val codeBefore = outputStream.toString - - var changed = false - for (entry : changedNodes.keySet) { - // set Property of corresponding elkNode - val kNode = entry.KNode - val elkNode = kNode.getProperty(KlighdInternalProperties.MODEL_ELEMEMT) - - if (elkNode instanceof ElkNode) { - val value = changedNodes.get(entry) - if (kNode.getProperty(entry.property) !== value) { - kNode.setProperty(entry.property, value) - InteractiveUtil.copyAllConstraints(elkNode, kNode) - changed = true; - } - } - } - - val elkNode = changedNodes.keySet().head.KNode.getProperty(KlighdInternalProperties.MODEL_ELEMEMT) - if (elkNode instanceof ElkNode && changed) { - val Map> changes = newHashMap - - // Get changed file as String - outputStream = new ByteArrayOutputStream - resource.save(outputStream, emptyMap) - val String codeAfter = outputStream.toString().trim - // The range is the length of the previous file. - val Range range = new Range(new Position(0, 0), new Position(codeBefore.split("\r\n|\r|\n").length, 0)) - val TextEdit textEdit = new TextEdit(range, codeAfter) - changes.put(uri, #[textEdit]); - this.client.replaceContentInFile(uri, codeAfter, range) - return - } else { - languageServer.updateDiagram(uri) - } + def refreshModelInEditor(List> changedNodes, KNode model, String uri) { + changedNodes.forEach[constraint| + val KNode kNode = constraint.KNode + kNode.setProperty(constraint.property, constraint.value) + ] + InteractiveUtil.serializeConstraints(changedNodes, model, uri, this.languageServer, this.client) + return } } diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/layered/PositionConstraint.xtend b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/layered/PositionConstraint.xtend index 85229d444..c87a98868 100644 --- a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/layered/PositionConstraint.xtend +++ b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/layered/PositionConstraint.xtend @@ -21,11 +21,11 @@ import org.eclipse.xtend.lib.annotations.Data /** * Data class for a position constraint. * - * @author jet, cos, sdo + * @author jep, cos, sdo */ @Data class PositionConstraint { String id int position - int posCons + int positionConstraint } diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/layered/RelativeConstraintReevaluation.xtend b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/layered/RelativeConstraintReevaluation.xtend new file mode 100644 index 000000000..d021737c5 --- /dev/null +++ b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/layered/RelativeConstraintReevaluation.xtend @@ -0,0 +1,157 @@ +/* + * KIELER - Kiel Integrated Environment for Layout Eclipse RichClient + * + * http://rtsys.informatik.uni-kiel.de/kieler + * + * Copyright 2022 by + * + Kiel University + * + Department of Computer Science + * + Real-Time and Embedded Systems Group + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + */ +package de.cau.cs.kieler.klighd.lsp.interactive.layered + +import de.cau.cs.kieler.klighd.kgraph.KNode +import de.cau.cs.kieler.klighd.lsp.interactive.ConstraintProperty +import de.cau.cs.kieler.klighd.lsp.interactive.InteractiveUtil +import java.util.List +import org.eclipse.elk.alg.layered.options.LayeredOptions +import org.eclipse.elk.graph.properties.IProperty +import org.eclipse.xtend.lib.annotations.Accessors + +/** + * Class to reevaluate relative constraint set for the layered algorithm since they may become obsolete or have to be + * changed if some node is moved. + * + * @author jep + */ +class RelativeConstraintReevaluation { + + IProperty predecessorProperty = LayeredOptions.CROSSING_MINIMIZATION_IN_LAYER_PRED_OF + IProperty successorProperty = LayeredOptions.CROSSING_MINIMIZATION_IN_LAYER_SUCC_OF + + @Accessors(PUBLIC_GETTER) + List> changedNodes = newLinkedList() + + @Accessors(PUBLIC_GETTER) + KNode target + + new(KNode target) { + this.target = target + } + + /** + * When a node is moved between two other nodes, the relative constraints of them must be updated. + * + * @param target The moved node. + * @param newPosition The position {@code target} is moved to. + * @param newLayerNodes Nodes of the layer {@code target} is moved to. + * @param oldLayerNodes Nodes of the layer {@code target} was original in. + */ + def reevaluateRelativeConstraints(KNode target, int newPosition, List newLayerNodes, List oldLayerNodes) { + val chainNodes = InteractiveUtil.getChain(target, oldLayerNodes) + var startOfChain = chainNodes.get(0) + var endOfChain = chainNodes.get(chainNodes.size - 1) + var position = newPosition + // Determine newPosition of new successor. + if (newLayerNodes.contains(target)) { + val oldPos = target.getProperty(LayeredOptions.CROSSING_MINIMIZATION_POSITION_ID) + if (newPosition > oldPos) { + position++ + } + } + + if (position > 0 && position < newLayerNodes.size) { + // Update relative constraint of the new predecessor and successor. + val predecessor = newLayerNodes.get(position - 1) + val successor = newLayerNodes.get(position) + if (predecessor.getProperty(predecessorProperty) !== null) { + changedNodes.add(new ConstraintProperty(predecessor, predecessorProperty, startOfChain.labels.get(0).text)) + } + if (successor.getProperty(successorProperty) !== null) { + changedNodes.add(new ConstraintProperty(successor, successorProperty, endOfChain.labels.get(0).text)) + } + } + } + + /** + * Updates relative constraints that have the moved node as target and of the target. + * + * @param target The moved node. + * @param newPosition The position {@code target} is moved to. + * @param newLayerNodes Nodes of the layer {@code target} is moved to. + * @param oldLayerNodes Nodes of the layer {@code target} was original in. + * @param property The property to check. + */ + def checkRelativeConstraints(KNode target, int newPosition, List newLayerNodes, List oldLayerNodes, + IProperty property + ) { + val oldPosition = target.getProperty(LayeredOptions.CROSSING_MINIMIZATION_POSITION_ID) + var forbidden = false + // Delete relative constraints that are overwritten by new relative constraint of the target. + switch(property) { + case predecessorProperty: { + if (oldPosition + 1 < oldLayerNodes.size) { + changedNodes.add(new ConstraintProperty(oldLayerNodes.get(oldPosition + 1), successorProperty, null)) + } + // If the chains can not be merged, delete old relative constraint and only merge moved node with chain. + val chain = InteractiveUtil.getChain(newLayerNodes.get(newPosition), newLayerNodes) + forbidden = InteractiveUtil.isMergeImpossible(InteractiveUtil.getChain(target, oldLayerNodes), chain) + if (forbidden) { + if (oldPosition - 1 >= 0) { + changedNodes.add(new ConstraintProperty(oldLayerNodes.get(oldPosition - 1), predecessorProperty, null)) + } + changedNodes.add(new ConstraintProperty(target, successorProperty, null)) + } + } + case successorProperty: { + if (oldPosition - 1 >= 0) { + changedNodes.add(new ConstraintProperty(oldLayerNodes.get(oldPosition - 1), predecessorProperty, null)) + } + // If the chains can not be merged, delete old relative constraint and only merge moved node with chain. + val chain = InteractiveUtil.getChain(newLayerNodes.get(newPosition - 1), newLayerNodes) + forbidden = InteractiveUtil.isMergeImpossible(InteractiveUtil.getChain(target, oldLayerNodes), chain) + if (forbidden) { + if (oldPosition + 1 < oldLayerNodes.size) { + changedNodes.add(new ConstraintProperty(oldLayerNodes.get(oldPosition + 1), successorProperty, null)) + } + changedNodes.add(new ConstraintProperty(target, predecessorProperty, null)) + } + } + } + } + + /** + * Reevaluates relative constraints after a node is moved within its chain. + * + * @param target The moved node. + * @param layerNodes The nodes that are in the same layer as {@code target}. + */ + def reevaluateRelativeConstraintAfterSwapInChain(KNode target, List layerNodes) { + // Remove relative constraint of target. + changedNodes.add(new ConstraintProperty(target, predecessorProperty, null)) + changedNodes.add(new ConstraintProperty(target, successorProperty, null)) + // Must be done in order for correct calculation of the chain in later reevaluation. + target.setProperty(predecessorProperty, null) + target.setProperty(successorProperty, null) + + // Remove relative constraint of predecessor and successor that could have the moved node as target. + val oldPosition = target.getProperty(LayeredOptions.CROSSING_MINIMIZATION_POSITION_ID) + if (oldPosition - 1 >= 0) { + val oldPredecessor = layerNodes.get(oldPosition - 1) + oldPredecessor.setProperty(predecessorProperty, null) + changedNodes.add(new ConstraintProperty(oldPredecessor, predecessorProperty, null)) + } + if (oldPosition + 1 < layerNodes.size) { + val oldSuccessor = layerNodes.get(oldPosition + 1) + changedNodes.add(new ConstraintProperty(oldSuccessor, successorProperty, null)) + oldSuccessor.setProperty(successorProperty, null) + } + } + +} \ No newline at end of file diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/layered/StaticConstraint.xtend b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/layered/StaticConstraint.xtend index d25812b6c..f58a5007a 100644 --- a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/layered/StaticConstraint.xtend +++ b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/layered/StaticConstraint.xtend @@ -21,7 +21,7 @@ import org.eclipse.xtend.lib.annotations.Data /** * Data class for a combined position and layer constraint. * - * @author jet, cos, sdo + * @author jep, cos, sdo */ @Data class StaticConstraint { @@ -44,11 +44,11 @@ class StaticConstraint { /** * Value for the layer constraint */ - int layerCons + int layerConstraint /** * Value for the position constraint */ - int posCons + int positionConstraint } diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/mrtree/MrTreeActionHandler.xtend b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/mrtree/MrTreeActionHandler.xtend new file mode 100644 index 000000000..a6c39d756 --- /dev/null +++ b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/mrtree/MrTreeActionHandler.xtend @@ -0,0 +1,45 @@ +/* + * KIELER - Kiel Integrated Environment for Layout Eclipse RichClient + * + * http://rtsys.informatik.uni-kiel.de/kieler + * + * Copyright 2022 by + * + Kiel University + * + Department of Computer Science + * + Real-Time and Embedded Systems Group + * + * This code is provided under the terms of the Eclipse Public License (EPL). + */ +package de.cau.cs.kieler.klighd.lsp.interactive.mrtree + +import com.google.inject.Inject +import de.cau.cs.kieler.klighd.lsp.AbstractActionHandler +import de.cau.cs.kieler.klighd.lsp.KGraphDiagramServer +import org.eclipse.sprotty.Action + +/** + * This class handles all sprotty actions for the interactive mrtree algorithm. + * + * @author sdo + * + */ +class MrTreeActionHandler extends AbstractActionHandler { + + @Inject + MrTreeInteractiveLanguageServerExtension lsExtension + + new() { + this.supportedMessages = newHashMap(MrTreeSetPositionConstraintAction.KIND -> MrTreeSetPositionConstraintAction) + } + + override handle(Action action, String clientId, KGraphDiagramServer server) { + if (action instanceof MrTreeSetPositionConstraintAction) { + synchronized((server as KGraphDiagramServer).modelLock) { + lsExtension.setPositionConstraint(action.constraint, clientId) + } + } else { + throw new IllegalArgumentException("Action " + action.kind + " not supported by handler " + this.class.simpleName) + } + } + +} diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/mrtree/MrTreeInteractiveLanguageServerExtension.xtend b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/mrtree/MrTreeInteractiveLanguageServerExtension.xtend new file mode 100644 index 000000000..6832940c1 --- /dev/null +++ b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/mrtree/MrTreeInteractiveLanguageServerExtension.xtend @@ -0,0 +1,108 @@ +/* + * KIELER - Kiel Integrated Environment for Layout Eclipse RichClient + * + * http://rtsys.informatik.uni-kiel.de/kieler + * + * Copyright 2022 by + * + Kiel University + * + Department of Computer Science + * + Real-Time and Embedded Systems Group + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + */ +package de.cau.cs.kieler.klighd.lsp.interactive.mrtree + +import com.google.inject.Inject +import com.google.inject.Singleton +import de.cau.cs.kieler.klighd.kgraph.KNode +import de.cau.cs.kieler.klighd.kgraph.util.KGraphUtil +import de.cau.cs.kieler.klighd.lsp.KGraphDiagramState +import de.cau.cs.kieler.klighd.lsp.KGraphLanguageClient +import de.cau.cs.kieler.klighd.lsp.KGraphLanguageServerExtension +import de.cau.cs.kieler.klighd.lsp.LSPUtil +import de.cau.cs.kieler.klighd.lsp.interactive.ConstraintProperty +import de.cau.cs.kieler.klighd.lsp.interactive.InteractiveUtil +import java.util.List +import org.eclipse.elk.alg.mrtree.options.MrTreeOptions +import org.eclipse.elk.graph.properties.IProperty +import org.eclipse.xtend.lib.annotations.Accessors +import org.eclipse.xtext.ide.server.ILanguageServerAccess +import org.eclipse.xtext.ide.server.ILanguageServerExtension + +/** + * Language server extension to change the mrtree algorithm in the interactive mode. + * @author sdo + * + */ +@Singleton +class MrTreeInteractiveLanguageServerExtension implements ILanguageServerExtension { + + @Accessors KGraphLanguageClient client; + + @Inject + KGraphDiagramState diagramState + + @Inject + KGraphLanguageServerExtension languageServer + + override initialize(ILanguageServerAccess access) { + } + + /** + * Set order constraint of node specified by node id. + * This changes all order values of all constraints of a previous layout run. + * + * @param pc constraint to be set + * @param clientId identifier of diagram + */ + def setPositionConstraint(MrTreeSetPositionConstraint pc, String clientId) { + val uri = diagramState.getURIString(clientId) + setConstraint(MrTreeOptions.POSITION_CONSTRAINT, uri, pc.id, + pc.position, pc.positionConstraint) + } + + /** + * Sets a layer or position constraint with a chosen {@code value} on the node + * that is specified by the {@code targetID}. + * + * @param PropID the type of constraint that should be set (LayerConstraint or PositionConstraint) + * The IProperty class is expected. + * @param uri The uri of the diagram/file. + * @param targetID The id of the node on which the constraint should be set. + * @param value Either the id of the position or the id of the layer. + */ + private def setConstraint(IProperty property, String uri, String targetID, int valueId, int valueCons) { + val kNode = LSPUtil.getKNode(diagramState, uri, targetID) + val parentOfNode = kNode.parent + + if (kNode !== null && parentOfNode !== null) { + val reeval = new PositionConstraintReevaluation(kNode) + reeval.reevaluatePositionConstraintsAfterPosChangeInLayer(parentOfNode, kNode, valueId) + + var changedNodes = reeval.changedNodes + refreshModelInEditor(changedNodes, KGraphUtil.getRootNodeOf(kNode), uri) + } + } + + + + /** + * Sends request to the client to update the file according to the property changes. + * + * @param changedNodes The list of all changes to nodes. + * @param model The main kNode. + * @param uri The uri of resource. + */ + def refreshModelInEditor(List> changedNodes, KNode model, String uri) { + changedNodes.forEach[constraint| + val KNode kNode = constraint.KNode + kNode.setProperty(constraint.property, constraint.value) + ] + InteractiveUtil.serializeConstraints(changedNodes, model, uri, this.languageServer, this.client) + return + } +} diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/mrtree/MrTreeInteractiveUtil.xtend b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/mrtree/MrTreeInteractiveUtil.xtend new file mode 100644 index 000000000..4505b73f5 --- /dev/null +++ b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/mrtree/MrTreeInteractiveUtil.xtend @@ -0,0 +1,98 @@ +/* + * KIELER - Kiel Integrated Environment for Layout Eclipse RichClient + * + * http://rtsys.informatik.uni-kiel.de/kieler + * + * Copyright 2022 by + * + Kiel University + * + Department of Computer Science + * + Real-Time and Embedded Systems Group + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + */ +package de.cau.cs.kieler.klighd.lsp.interactive.mrtree + +import de.cau.cs.kieler.klighd.kgraph.KEdge +import de.cau.cs.kieler.klighd.kgraph.KNode +import java.util.ArrayList +import java.util.Comparator +import java.util.List +import java.util.stream.Collectors +import org.eclipse.elk.alg.mrtree.options.MrTreeOptions +import org.eclipse.elk.core.math.KVector +import org.eclipse.elk.core.options.Direction + +/** + * Provides utility methods for the interactive mrtree algorithm. + * + * @author sdo + * + */ +class MrTreeInteractiveUtil { + + static def List getSiblings(KNode n, KNode parent) { + val lowestParent = getLowestParent(n, parent); + if (lowestParent === null) + return new ArrayList(); + val siblings = parent.children.stream. + filter[x | lowestParent == getLowestParent(x, parent)].collect(Collectors.toList) + return siblings + } + + static def KNode getLowestParent(KNode n, KNode parent) { + val dirVec = getDirectionVector(parent); + if (n.incomingEdges.size == 0) + return null + val sources = n.incomingEdges.stream().map[x | x.source].collect(Collectors.toList) + val parents = parent.children.stream.filter[x | sources.contains(x)].collect(Collectors.toList) + + if (parents.size < 1) + return null + else if (parents.size == 1) + return parents.get(0) + else { + val lowestParentPos = parents.stream. + map[x | new KVector(x.xpos + x.width / 2, x.ypos + x.height / 2).dotProduct(dirVec)]. + max(Comparator.naturalOrder).get + val lowestParent = parents.stream. + filter[x | new KVector(x.xpos + x.width / 2, x.ypos + x.height / 2).dotProduct(dirVec) == lowestParentPos]. + findFirst.get + + return lowestParent; + } + } + + /** + * Gets a KVector which faces in the direction of the layout direction of parent + * @param parent the parent node of the graph + * @return the KVector + */ + static def KVector getDirectionVector(KNode parent) { + val direction = parent.getProperty(MrTreeOptions.DIRECTION) + if (direction == Direction.LEFT) + return new KVector(-1, 0) + else if (direction == Direction.RIGHT) + return new KVector(1, 0) + else if (direction == Direction.UP) + return new KVector(0, -1) + else + return new KVector(0, 1) + } + + /** + * Get the child nodes of n within a tree. + * @param n the n + * @return the child nodes of n within a tree + */ + static def List getChildren(KNode n) { + var re = new ArrayList(); + for (KEdge out : n.getOutgoingEdges()) { + re.add(out.getTarget()); + } + return re.stream().distinct().collect(Collectors.toList()); + } +} \ No newline at end of file diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/mrtree/MrTreeSetPositionConstraint.xtend b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/mrtree/MrTreeSetPositionConstraint.xtend new file mode 100644 index 000000000..5700b26f1 --- /dev/null +++ b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/mrtree/MrTreeSetPositionConstraint.xtend @@ -0,0 +1,31 @@ +/* + * KIELER - Kiel Integrated Environment for Layout Eclipse RichClient + * + * http://rtsys.informatik.uni-kiel.de/kieler + * + * Copyright 2022 by + * + Kiel University + * + Department of Computer Science + * + Real-Time and Embedded Systems Group + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + */ +package de.cau.cs.kieler.klighd.lsp.interactive.mrtree + +import org.eclipse.xtend.lib.annotations.Data + +/** + * Data class for a position constraint sent from client to server for the mrtree algorithm. + * + * @author sdo + */ +@Data +class MrTreeSetPositionConstraint { + String id + int position + int positionConstraint +} diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/mrtree/MrTreeSetPositionConstraintAction.xtend b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/mrtree/MrTreeSetPositionConstraintAction.xtend new file mode 100644 index 000000000..f860449ab --- /dev/null +++ b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/mrtree/MrTreeSetPositionConstraintAction.xtend @@ -0,0 +1,41 @@ +/* + * KIELER - Kiel Integrated Environment for Layout Eclipse RichClient + * + * http://rtsys.informatik.uni-kiel.de/kieler + * + * Copyright 2022 by + * + Kiel University + * + Department of Computer Science + * + Real-Time and Embedded Systems Group + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + */ +package de.cau.cs.kieler.klighd.lsp.interactive.mrtree + +import java.util.function.Consumer +import org.eclipse.sprotty.Action +import org.eclipse.xtend.lib.annotations.Accessors +import org.eclipse.xtend.lib.annotations.EqualsHashCode +import org.eclipse.xtend.lib.annotations.ToString + +/** + * Sets the order of a node for the MrTree algorithm. + */ +@Accessors +@EqualsHashCode +@ToString(skipNulls = true) +public class MrTreeSetPositionConstraintAction implements Action { + public static val KIND = 'treeSetPositionConstraint' + String kind = KIND + + MrTreeSetPositionConstraint constraint + + new() {} + new(Consumer initializer) { + initializer.accept(this) + } +} diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/mrtree/PositionConstraintReevaluation.xtend b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/mrtree/PositionConstraintReevaluation.xtend new file mode 100644 index 000000000..dced571fd --- /dev/null +++ b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/mrtree/PositionConstraintReevaluation.xtend @@ -0,0 +1,76 @@ +/* + * KIELER - Kiel Integrated Environment for Layout Eclipse RichClient + * + * http://rtsys.informatik.uni-kiel.de/kieler + * + * Copyright 2022 by + * + Kiel University + * + Department of Computer Science + * + Real-Time and Embedded Systems Group + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + */ +package de.cau.cs.kieler.klighd.lsp.interactive.mrtree + +import de.cau.cs.kieler.klighd.kgraph.KNode +import de.cau.cs.kieler.klighd.lsp.interactive.ConstraintProperty +import java.util.LinkedList +import org.eclipse.elk.alg.mrtree.options.MrTreeOptions +import org.eclipse.xtend.lib.annotations.Accessors + +/** + * Class to reevalute position constraints for MrTree. + * + * @author jnc, sdo + */ +class PositionConstraintReevaluation { + @Accessors(PUBLIC_GETTER) + KNode target + + @Accessors(PUBLIC_GETTER) + LinkedList> changedNodes = newLinkedList() + + new(KNode target) { + this.target = target + } + + /** + * Adjusts position constraints in a layer after one node has been introduced to it. + * @param parent the nodes of the layer + * @param target the moved node + * @param newPosition the new position of the node + */ + def reevaluatePositionConstraintsAfterPosChangeInLayer(KNode parent, KNode target, int newPosition) { + var targetSiblings = MrTreeInteractiveUtil.getSiblings(target, parent) + + // There is no point in sorting a list with less than 2 elements. + if (targetSiblings.size <= 1) { + return + } + + // Sort list by node positions. + if (parent.getProperty(MrTreeOptions.DIRECTION).horizontal) + targetSiblings = targetSiblings.sortBy[ypos] + else + targetSiblings = targetSiblings.sortBy[xpos] + + // Set target node to its target position. + val newPositionInBounds = + if (newPosition >= targetSiblings.length) targetSiblings.length - 1 + else newPosition + if (newPositionInBounds == targetSiblings.indexOf(target)) { + return + } + targetSiblings.remove(target); + targetSiblings.add(newPositionInBounds, target); + + // Set node position constraint to its list index. + for (var i = 0; i < targetSiblings.length; i++) { + changedNodes.add(new ConstraintProperty(targetSiblings.get(i), MrTreeOptions.POSITION_CONSTRAINT, i)) + } + } +} \ No newline at end of file diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/mrtree/SetAspectRatio.xtend b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/mrtree/SetAspectRatio.xtend new file mode 100644 index 000000000..6c1e68719 --- /dev/null +++ b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/mrtree/SetAspectRatio.xtend @@ -0,0 +1,30 @@ +/* + * KIELER - Kiel Integrated Environment for Layout Eclipse RichClient + * + * http://rtsys.informatik.uni-kiel.de/kieler + * + * Copyright 2022 by + * + Kiel University + * + Department of Computer Science + * + Real-Time and Embedded Systems Group + * + * This program and the accompanying materials are made available under the + * terms of the Eclipse Public License 2.0 which is available at + * http://www.eclipse.org/legal/epl-2.0. + * + * SPDX-License-Identifier: EPL-2.0 + */ +package de.cau.cs.kieler.klighd.lsp.interactive.mrtree + +import org.eclipse.xtend.lib.annotations.Data + +/** + * Data class to set a new aspect ratio which is sent from client to server for the mrtree algorithm. + * + * @author sdo + */ +@Data +class SetAspectRatio { + String id + Double aspectRatio +} diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/rectpacking/RectpackingInteractiveLanguageServerExtension.xtend b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/rectpacking/RectpackingInteractiveLanguageServerExtension.xtend index 61ad1b56f..f7ab13f42 100644 --- a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/rectpacking/RectpackingInteractiveLanguageServerExtension.xtend +++ b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/interactive/rectpacking/RectpackingInteractiveLanguageServerExtension.xtend @@ -17,24 +17,19 @@ package de.cau.cs.kieler.klighd.lsp.interactive.rectpacking import com.google.inject.Inject -import de.cau.cs.kieler.klighd.internal.util.KlighdInternalProperties +import com.google.inject.Singleton import de.cau.cs.kieler.klighd.kgraph.KNode +import de.cau.cs.kieler.klighd.kgraph.util.KGraphUtil import de.cau.cs.kieler.klighd.lsp.KGraphDiagramState import de.cau.cs.kieler.klighd.lsp.KGraphLanguageClient import de.cau.cs.kieler.klighd.lsp.KGraphLanguageServerExtension import de.cau.cs.kieler.klighd.lsp.LSPUtil +import de.cau.cs.kieler.klighd.lsp.interactive.ConstraintProperty import de.cau.cs.kieler.klighd.lsp.interactive.InteractiveUtil -import java.io.ByteArrayOutputStream import java.util.Arrays import java.util.List -import java.util.Map -import javax.inject.Singleton import org.eclipse.elk.alg.rectpacking.options.RectPackingOptions import org.eclipse.elk.core.options.CoreOptions -import org.eclipse.elk.graph.ElkNode -import org.eclipse.lsp4j.Position -import org.eclipse.lsp4j.Range -import org.eclipse.lsp4j.TextEdit import org.eclipse.xtend.lib.annotations.Accessors import org.eclipse.xtext.ide.server.ILanguageServerAccess import org.eclipse.xtext.ide.server.ILanguageServerExtension @@ -99,9 +94,10 @@ class RectpackingInteractiveLanguageServerExtension implements ILanguageServerEx } } } - kNode.setProperty(RectPackingOptions.DESIRED_POSITION, desiredPosition) - refreshModelInEditor(changedNodes, uri) + refreshModelInEditor(new ConstraintProperty(kNode, RectPackingOptions.DESIRED_POSITION, desiredPosition), KGraphUtil.getRootNodeOf(kNode), uri) + } else { + languageServer.updateLayout(uri) } } @@ -143,8 +139,10 @@ class RectpackingInteractiveLanguageServerExtension implements ILanguageServerEx } } kNode.setProperty(RectPackingOptions.DESIRED_POSITION, null) - refreshModelInEditor(changedNodes, uri) + refreshModelInEditor(new ConstraintProperty(kNode, RectPackingOptions.DESIRED_POSITION, null), KGraphUtil.getRootNodeOf(kNode), uri) + } else { + languageServer.updateLayout(uri) } } @@ -157,69 +155,22 @@ class RectpackingInteractiveLanguageServerExtension implements ILanguageServerEx def setAspectRatio(SetAspectRatio constraint, String clientId) { val uri = diagramState.getURIString(clientId) val kNode = LSPUtil.getKNode(diagramState, uri, constraint.id) - kNode.setProperty(RectPackingOptions.ASPECT_RATIO, Double.valueOf(constraint.aspectRatio)) - val resource = languageServer.getResource(uri); - - // Get previous file content as String - var outputStream = new ByteArrayOutputStream - resource.save(outputStream, emptyMap) - val codeBefore = outputStream.toString - - val elkNode = kNode.getProperty(KlighdInternalProperties.MODEL_ELEMEMT) - if (elkNode instanceof ElkNode) { - val Map> changes = newHashMap - elkNode.setProperty(RectPackingOptions.ASPECT_RATIO, constraint.aspectRatio) - - // Get changed file as String - outputStream = new ByteArrayOutputStream - resource.save(outputStream, emptyMap) - val codeAfter = outputStream.toString - - // The range is the length of the previous file. - val Range range = new Range(new Position(0, 0), new Position(codeBefore.split("\r\n|\r|\n").length, 0)) - val TextEdit textEdit = new TextEdit(range, codeAfter) - changes.put(uri, #[textEdit]); - this.client.replaceContentInFile(uri, codeAfter, range) - return - } + refreshModelInEditor(new ConstraintProperty(kNode, RectPackingOptions.ASPECT_RATIO, Double.valueOf(constraint.aspectRatio)), + KGraphUtil.getRootNodeOf(kNode), uri + ) } /** * Applies property changes to the file given by the uri by sending by notifying the client to execute the changes. * - * @param changedNodes The KNodes that changed. + * @param constraint The constraint to serialize + * @param model The main KNode * @param uri uri of resource */ - def refreshModelInEditor(List changedNodes, String uri) { - val resource = languageServer.getResource(uri); - - // Get previous file content as String - var outputStream = new ByteArrayOutputStream - resource.save(outputStream, emptyMap) - val codeBefore = outputStream.toString - - for (node : changedNodes) { - val elkNode = node.getProperty(KlighdInternalProperties.MODEL_ELEMEMT) - if (elkNode instanceof ElkNode) { - InteractiveUtil.copyAllConstraints(elkNode, node) - } - } - val elkNode = changedNodes.get(0).getProperty(KlighdInternalProperties.MODEL_ELEMEMT) - if (elkNode instanceof ElkNode) { - val Map> changes = newHashMap - - // Get changed file as String - outputStream = new ByteArrayOutputStream - resource.save(outputStream, emptyMap) - val codeAfter = outputStream.toString().trim() - - // The range is the length of the previous file. - val Range range = new Range(new Position(0, 0), new Position(codeBefore.split("\r\n|\r|\n").length, 0)) - val TextEdit textEdit = new TextEdit(range, codeAfter) - changes.put(uri, #[textEdit]); - this.client.replaceContentInFile(uri, codeAfter, range) - return - } - + def refreshModelInEditor(ConstraintProperty constraint, KNode model, String uri) { + val KNode kNode = constraint.KNode + kNode.setProperty(constraint.property, constraint.value) + InteractiveUtil.serializeConstraints(#[constraint], model, uri, this.languageServer, this.client) + return } } diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/launch/AbstractLsCreator.xtend b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/launch/AbstractLsCreator.xtend index 246644a01..a3651505c 100644 --- a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/launch/AbstractLsCreator.xtend +++ b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/launch/AbstractLsCreator.xtend @@ -30,7 +30,7 @@ import de.cau.cs.kieler.klighd.lsp.KGraphLanguageClient import de.cau.cs.kieler.klighd.lsp.LSPUtil import de.cau.cs.kieler.klighd.lsp.SprottyViewer import de.cau.cs.kieler.klighd.lsp.gson_utils.KGraphTypeAdapterUtil -import de.cau.cs.kieler.klighd.standalone.KlighdStandaloneSetup +import de.cau.cs.kieler.klighd.setup.KlighdStandaloneSetup import java.io.InputStream import java.io.OutputStream import java.util.Collection @@ -124,7 +124,7 @@ abstract class AbstractLsCreator implements ILsCreator { // TypeAdapter is needed to be able to send recursive data in json val Consumer configureGson = [ gsonBuilder | - KGraphTypeAdapterUtil.configureGson(gsonBuilder) + KGraphTypeAdapterUtil.configureGson(gsonBuilder, injector) ] // Get all LSExtensions to use them as local services val localServices = newArrayList diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/model/Actions.xtend b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/model/Actions.xtend index e1fe4c333..cc41a9a79 100644 --- a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/model/Actions.xtend +++ b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/model/Actions.xtend @@ -3,7 +3,7 @@ * * http://rtsys.informatik.uni-kiel.de/kieler * - * Copyright 2018-2022 by + * Copyright 2018-2024 by * + Kiel University * + Department of Computer Science * + Real-Time and Embedded Systems Group @@ -18,14 +18,13 @@ package de.cau.cs.kieler.klighd.lsp.model import de.cau.cs.kieler.klighd.krendering.KImage import java.util.List +import java.util.Map import java.util.Set import java.util.function.Consumer import org.eclipse.sprotty.Action import org.eclipse.sprotty.RequestAction import org.eclipse.sprotty.ResponseAction import org.eclipse.sprotty.SModelElement -import org.eclipse.sprotty.SModelRoot -import org.eclipse.sprotty.UpdateModelAction import org.eclipse.xtend.lib.annotations.Accessors import org.eclipse.xtend.lib.annotations.EqualsHashCode import org.eclipse.xtend.lib.annotations.ToString @@ -245,6 +244,8 @@ class RefreshDiagramAction implements Action { public static val KIND = 'refreshDiagram' String kind = KIND + Map options + new() {} new(Consumer initializer) { initializer.accept(this) @@ -269,36 +270,6 @@ class RefreshLayoutAction implements Action { } } -/** - * Updates the model and sends the cause to the client. - * Extends to UpdateModelAction. - * FIXME Remove this if the UpdateModelAction includes a cause. - * - * @author sdo - */ -@Accessors -@EqualsHashCode -@ToString(skipNulls = true) -public class KeithUpdateModelAction extends UpdateModelAction { - public static val KIND = 'updateModel' - String kind = KIND - - - SModelRoot newRoot - Boolean animate - Action cause - - new() {} - new(Consumer initializer) { - initializer.accept(this) - } - - new(SModelRoot newRoot, Action cause) { - this.newRoot = newRoot - this.cause = cause - } -} - /** * Sent from client to request a certain piece of the diagram. * diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/model/KGraphModel.xtend b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/model/KGraphModel.xtend index fa4a601b7..d8f628809 100644 --- a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/model/KGraphModel.xtend +++ b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/model/KGraphModel.xtend @@ -3,7 +3,7 @@ * * http://rtsys.informatik.uni-kiel.de/kieler * - * Copyright 2018-2022 by + * Copyright 2018-2024 by * + Kiel University * + Department of Computer Science * + Real-Time and Embedded Systems Group @@ -39,6 +39,7 @@ abstract interface SKElement { def List getData() def void setData(List data) def HashMap getProperties() + def void setProperties(HashMap theProperties) } /** diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/utils/KGraphElementIDGenerator.xtend b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/utils/KGraphElementIDGenerator.xtend index 73c73ac12..69dc8b628 100644 --- a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/utils/KGraphElementIDGenerator.xtend +++ b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/utils/KGraphElementIDGenerator.xtend @@ -3,7 +3,7 @@ * * http://rtsys.informatik.uni-kiel.de/kieler * - * Copyright 2018,2019 by + * Copyright 2018-2023 by * + Kiel University * + Department of Computer Science * + Real-Time and Embedded Systems Group @@ -34,8 +34,7 @@ import static extension de.cau.cs.kieler.klighd.lsp.utils.SprottyProperties.* /** * Class for generating unique IDs for any {@link KGraphElement}. Use a single instance of this and call getId() for all - * the elements you need IDs for. IDs will be unique, assuming that hashCode() on KGraphElements returns unique hashes - * per instance. + * the elements you need IDs for. IDs will be unique, based on the position in their parent graph element. * * @author nre */ @@ -109,9 +108,7 @@ class KGraphElementIdGenerator { // the root node is just called $root val parent = element.eContainer as KGraphElement var String parentId = null - if (parent !== null) { - parentId = getId(parent) - } else { + if (parent === null) { id = ID_SEPARATOR + 'root' if (idToElementMap.get(id) !== null) { // The graph already contains a root node, this is a connected node dangling without a parent and will @@ -122,6 +119,7 @@ class KGraphElementIdGenerator { idToElementMap.put(id, element) return id } + parentId = getId(parent) // use a prefix depending on the class of the element + the {@link KIdentifier} as id if an identifier is // defined, otherwise make up a new id based on the position in the model hierarchy with a Separator not @@ -130,19 +128,24 @@ class KGraphElementIdGenerator { val identifier = element.data.filter(KIdentifier) var char elementSeparator + var int index switch (element) { KNode: { elementSeparator = NODE_SEPARATOR + index = element.parent.children.indexOf(element) } KEdge: { elementSeparator = EDGE_SEPARATOR + index = element.source.outgoingEdges.indexOf(element) } KLabel: { elementSeparator = LABEL_SEPARATOR + index = element.parent.labels.indexOf(element) } KPort: { elementSeparator = PORT_SEPARATOR + index = element.node.ports.indexOf(element) } default: { throw new IllegalArgumentException("Can not generate an id for element of type " + element.class) @@ -150,7 +153,7 @@ class KGraphElementIdGenerator { } if (identifier.empty) { - elementId = "" + ID_SEPARATOR + elementSeparator + element.hashCode + elementId = "" + ID_SEPARATOR + elementSeparator + index } else { elementId = elementSeparator + identifier.head.id } @@ -169,8 +172,8 @@ class KGraphElementIdGenerator { } /** - * Class for generating unique IDs for any {@link KRendering}. IDs will be unique, assuming that hashCode() on - * KRenderings returns unique hashes per instance. + * Class for generating unique IDs for any {@link KRendering}. IDs will be unique, based on the position in their + * parent graph element / rendering. * * @author nre */ @@ -196,21 +199,11 @@ class KRenderingIdGenerator { * and puts it in the {@link SprottyProperties#RENDERING_ID} property. This ID can be used for uniquely identifying * renderings between systems. * - * @param rendering The rendering - */ - static def void generateIdsRecursive(KRendering rendering) { - if (rendering !== null) { - generateIdsRecursive(rendering, null) - } - } - - /** - * Recursive method implementing the behavior described in {@link #generateIdsRecursive(KStyleHolder)}. - * * @param rendering The rendering that should currently get an ID. - * @paran parentRendering The parent rendering of the current rendering, for convenience. + * @param parentId The ID of the parent to be added as the ID's prefix. + * @param renderingIndex The index of this rendering in relation to the parent. */ - private static def void generateIdsRecursive(KRendering rendering, KContainerRendering parentRendering) { + static def void generateIdsRecursive(KRendering rendering, String parentId, int renderingIndex) { if (rendering === null) { return } @@ -220,15 +213,10 @@ class KRenderingIdGenerator { return } - if (parentRendering === null) { - rendering.renderingId = "" + RENDERING_SEPERATOR + rendering.hashCode - } else { - val parentId = parentRendering.renderingId - // Generate a new ID based on the parent rendering's ID. - rendering.renderingId = parentId - + ID_SEPARATOR + RENDERING_SEPERATOR - + rendering.hashCode - } + // Generate a new ID based on the parent rendering's ID. + rendering.renderingId = parentId + + ID_SEPARATOR + RENDERING_SEPERATOR + + renderingIndex if (rendering instanceof KPolyline) { // Special case for KPolyline: It has a junctionPointRendering that also needs an ID. // Use a new separator and think of this as a new rendering hierarchy with possible children. @@ -240,8 +228,8 @@ class KRenderingIdGenerator { } if (rendering instanceof KContainerRendering) { // Each KContainerRendering has child renderings that also need new IDs. - for (childRendering : rendering.children) { - generateIdsRecursive(childRendering, rendering) + for (var int i = 0; i < rendering.children.size; i++) { + generateIdsRecursive(rendering.children.get(i), rendering.renderingId, i) } } } @@ -255,7 +243,7 @@ class KRenderingIdGenerator { * @return The {@link KRendering} with the given ID. */ static def findRenderingById(KGraphElement element, String id) { - val ids = id.split("\\" + ID_SEPARATOR) + val ids = id.split("\\" + ID_SEPARATOR + "\\" + ID_SEPARATOR + "\\" + ID_SEPARATOR).get(1).split("\\" + ID_SEPARATOR) // Every rendering ID is built hierarchically, separated by the RENDERING_SEPERATOR symbol. val renderings = element.data.filter(KRendering) + element.data.filter(KRenderingRef) diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/utils/KGraphMappingUtil.xtend b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/utils/KGraphMappingUtil.xtend index bf5a569e6..388cfe822 100644 --- a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/utils/KGraphMappingUtil.xtend +++ b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/utils/KGraphMappingUtil.xtend @@ -23,6 +23,7 @@ import de.cau.cs.kieler.klighd.kgraph.KLabel import de.cau.cs.kieler.klighd.kgraph.KNode import de.cau.cs.kieler.klighd.kgraph.KPort import de.cau.cs.kieler.klighd.kgraph.KShapeLayout +import de.cau.cs.kieler.klighd.kgraph.util.KGraphUtil import de.cau.cs.kieler.klighd.lsp.model.SKEdge import de.cau.cs.kieler.klighd.lsp.model.SKElement import de.cau.cs.kieler.klighd.lsp.model.SKLabel @@ -39,7 +40,6 @@ import org.eclipse.sprotty.Dimension import org.eclipse.sprotty.Point import org.eclipse.sprotty.SModelElement import org.eclipse.sprotty.SShapeElement -import de.cau.cs.kieler.klighd.kgraph.util.KGraphUtil /** * A helper class containing static methods for mapping of KGraph and SGraph bounds. @@ -108,15 +108,7 @@ class KGraphMappingUtil { skEdge.junctionPoints.addAllAsCopies(0, kEdge.getProperty(CoreOptions.JUNCTION_POINTS)) skEdge.junctionPoints.offset(new KVector(leftInset, topInset)) - // map all properties excepts those that are blacklisted - // also include external whitelisted properties - var properties = kEdge.allProperties; - - for (propertyKVPair : properties.entrySet()) { - if (keepProperty(propertyKVPair.key)) { - skEdge.properties.put(propertyKVPair.key.id, propertyKVPair.value) - } - } + mapProperties(kEdge, skEdge) } /** @@ -138,11 +130,19 @@ class KGraphMappingUtil { skNode.position = new Point(kNode.xpos + leftInset, kNode.ypos + topInset) skNode.size = new Dimension(kNode.width, kNode.height) - var properties = kNode.allProperties; + mapProperties(kNode, skNode) + } + + /** + * Maps the properties of the KGraphElement to the corresponding SModelElement. + * Excepts those that are blacklisted, but also include whitelisted external properties. + */ + static def mapProperties(KGraphElement kElement, SKElement sElement) { + val properties = kElement.allProperties for (propertyKVPair : properties.entrySet()) { if (keepProperty(propertyKVPair.key)) { - skNode.properties.put(propertyKVPair.key.id, propertyKVPair.value) + sElement.properties.put(propertyKVPair.key.id, propertyKVPair.value) } } } diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/utils/LazyTraceProvider.xtend b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/utils/LazyTraceProvider.xtend index d93372c48..fd389c7f0 100644 --- a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/utils/LazyTraceProvider.xtend +++ b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/utils/LazyTraceProvider.xtend @@ -77,7 +77,7 @@ class LazyTraceProvider extends XtextTraceProvider { /** * Generates a trace for the {@code kElement}'s source EObject on the {@code sElement}. * The kElement must be synthesized by a KLighD synthesis before and must have its source EObject stored in the - * {@link KlighdInternalProperties#MODEL_ELEMEMT} property. + * {@link KlighdInternalProperties#MODEL_ELEMENT} property. * * @param sElement The SModelElement that needs a trace to its model element. * @param kElement The KGraphElement that was generated from some model element. @@ -86,7 +86,7 @@ class LazyTraceProvider extends XtextTraceProvider { // The real model element that can be traced is the EObject that got synthesized in the // {@link KGraphDiagramGenerator#translateModel} function. That model element has to be stored in the properties // during the synthesis. Otherwise the tracing will not work. - val modelElement = kElement.properties.get(KlighdInternalProperties.MODEL_ELEMEMT) + val modelElement = kElement.properties.get(KlighdInternalProperties.MODEL_ELEMENT) if (modelElement instanceof EObject) { if (modelElement.eResource instanceof XtextResource) { trace(sElement, modelElement) diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/utils/RenderingPreparer.xtend b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/utils/RenderingPreparer.xtend index 596633a5a..dc45e9e14 100644 --- a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/utils/RenderingPreparer.xtend +++ b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/utils/RenderingPreparer.xtend @@ -3,7 +3,7 @@ * * http://rtsys.informatik.uni-kiel.de/kieler * - * Copyright 2018-2023 by + * Copyright 2018-2024 by * + Kiel University * + Department of Computer Science * + Real-Time and Embedded Systems Group @@ -46,11 +46,13 @@ import de.cau.cs.kieler.klighd.microlayout.DecoratorPlacementUtil.Decoration import de.cau.cs.kieler.klighd.microlayout.GridPlacementUtil import de.cau.cs.kieler.klighd.microlayout.PlacementUtil import de.cau.cs.kieler.klighd.util.KlighdProperties +import de.cau.cs.kieler.klighd.util.RenderingContextData import java.awt.geom.Point2D import java.util.ArrayList import java.util.HashMap import java.util.List import java.util.Map +import org.eclipse.sprotty.SModelElement import static com.google.common.collect.Iterables.filter @@ -62,6 +64,93 @@ import static extension de.cau.cs.kieler.klighd.lsp.utils.SprottyProperties.* * @author nre */ final class RenderingPreparer { + + /** + * Prepares the rendering IDs of a KGraph to be generated for an external viewer. + * + * + * @param element The parent element containing the graph to calculate all rendering IDs for. + * @param kGraphToSGraph A map for identifying the SGraph element for each KGraph element in this graph. + */ + static def void prepareRenderingIDs(KGraphElement element, Map kGraphToSGraph) { + // calculate the IDs of all renderings: + for (var int i = 0; i < element.data.size; i++) { + val data = element.data.get(i) + switch(data) { + KRenderingLibrary: { + // The library needs to generate ids for all later KRenderingRefs to refer to. + for (var int j = 0; j < data.renderings.size; j++) { + val rendering = data.renderings.get(j) + if (rendering instanceof KRendering) { + KRenderingIdGenerator.generateIdsRecursive(rendering, "$$lib$$", j) + } + } + } + KRenderingRef: { + // rendering refs refer to the referred ID + data.renderingId = kGraphToSGraph.get(element)?.id + data.rendering.renderingId + } + KRendering: { + // every rendering needs an ID, generate it here + KRenderingIdGenerator.generateIdsRecursive(data, kGraphToSGraph.get(element)?.id + "$$", i) + } + } + } + + // Recursively call this method for every child KGraphElement of this. + // (all labels, child nodes, outgoing edges and ports) + + if (element instanceof KLabeledGraphElement) { + for (label : element.labels) { + prepareRenderingIDs(label, kGraphToSGraph) + } + } + if (element instanceof KNode) { + // Do not recurse generating IDs if the element is not expanded, as there won't be any SGraph generated for + // it. + var boolean isExpanded + val renderingContextData = RenderingContextData.get(element) + if (renderingContextData.hasProperty(SprottyProperties.EXPANDED)) { + isExpanded = renderingContextData.getProperty(SprottyProperties.EXPANDED) + } else { + // If the expanded property does not exist yet, use the initial expansion. + isExpanded = element.getProperty(KlighdProperties.EXPAND) + } + + if (isExpanded) { + for (node : element.children) { + prepareRenderingIDs(node, kGraphToSGraph) + } + } + for (edge : element.outgoingEdges) { + // not expanded => edge must not have the target node inside the non-expanded + if (isExpanded || !KGraphUtil.isDescendant(edge.target, element)) { + prepareRenderingIDs(edge, kGraphToSGraph) + } + } + for (port : element.ports) { + prepareRenderingIDs(port, kGraphToSGraph) + } + } + + // Also prepare the IDs of all proxy-renderings + val proxyRendering = element.getProperty(KlighdProperties.PROXY_VIEW_PROXY_RENDERING) + if (element.getProperty(KlighdProperties.PROXY_VIEW_RENDER_NODE_AS_PROXY) && proxyRendering !== null) { + for (var int i = 0; i < proxyRendering.size; i++) { + val data = proxyRendering.get(i) + switch(data) { + KRenderingRef: { + // rendering refs refer to the referred ID + data.renderingId = kGraphToSGraph.get(element)?.id + data.rendering.renderingId + } + KRendering: { + // every rendering needs an ID, generate it here + KRenderingIdGenerator.generateIdsRecursive(data, kGraphToSGraph.get(element)?.id + "$$", i) + } + } + } + } + } /** * Prepares a KGraphElement to be rendered in an external viewer. @@ -72,26 +161,18 @@ final class RenderingPreparer { * In case of a {@link KRenderingRef} the bounds and decoration are persisted for every referenced rendering as a map * inside the properties of the reference. * For example: <id of the rendering in the library: bounds in this instance> - * Furthermore, for every rendering a unique ID is generated. * Finally, modifiable styles defined by the synthesis are processed for the rendering. * * @param element The parent element containing the graph to calculate all rendering bounds for. + * @param kGraphToSGraph A map for identifying the SGraph element for each KGraph element in this graph. */ - static def void prepareRendering(KGraphElement element) { + static def void prepareRenderingLayout(KGraphElement element, Map kGraphToSGraph) { // calculate the sizes of all renderings: - for (data : element.data) { + for (var int i = 0; i < element.data.size; i++) { + val data = element.data.get(i) switch(data) { - KRenderingLibrary: { - // The library needs to generate ids for all later KRenderingRefs to refer to, but no own bounds, - // since these are generic renderings. - for (rendering : data.renderings) { - if (rendering instanceof KRendering) { - KRenderingIdGenerator.generateIdsRecursive(rendering) - } - } - } KRenderingRef: { - // all references to KRenderings need to place a map with the ids of the renderings and their + // all references to KRenderings need to place a map with their // sizes and their decoration in this case in the properties of the reference. var boundsMap = new HashMap var decorationMap = new HashMap @@ -100,13 +181,8 @@ final class RenderingPreparer { data.properties.put(CALCULATED_BOUNDS_MAP, boundsMap) // and the decorationMap data.properties.put(CALCULATED_DECORATION_MAP, decorationMap) - // remember the id of the rendering in the reference - data.renderingId = data.rendering.renderingId - } KRendering: { - // every rendering needs an ID, generate it here - KRenderingIdGenerator.generateIdsRecursive(data) handleKRendering(element, data, null, null) } } @@ -117,25 +193,42 @@ final class RenderingPreparer { if (element instanceof KLabeledGraphElement) { for (label : element.labels) { - prepareRendering(label) + prepareRenderingLayout(label, kGraphToSGraph) } } if (element instanceof KNode) { - for (node : element.children) { - prepareRendering(node) + // Do not recurse generating IDs if the element is not expanded, as there won't be any SGraph generated for + // it. + var boolean isExpanded + val renderingContextData = RenderingContextData.get(element) + if (renderingContextData.hasProperty(SprottyProperties.EXPANDED)) { + isExpanded = renderingContextData.getProperty(SprottyProperties.EXPANDED) + } else { + // If the expanded property does not exist yet, use the initial expansion. + isExpanded = element.getProperty(KlighdProperties.EXPAND) + } + + if (isExpanded) { + for (node : element.children) { + prepareRenderingLayout(node, kGraphToSGraph) + } } for (edge : element.outgoingEdges) { - prepareRendering(edge) + // not expanded => edge must not have the target node inside the non-expanded + if (isExpanded || !KGraphUtil.isDescendant(edge.target, element)) { + prepareRenderingLayout(edge, kGraphToSGraph) + } } for (port : element.ports) { - prepareRendering(port) + prepareRenderingLayout(port, kGraphToSGraph) } } // Also calculate the sizes of all proxy-renderings val proxyRendering = element.getProperty(KlighdProperties.PROXY_VIEW_PROXY_RENDERING) if (element.getProperty(KlighdProperties.PROXY_VIEW_RENDER_NODE_AS_PROXY) && proxyRendering !== null) { - for (data : proxyRendering) { + for (var int i = 0; i < proxyRendering.size; i++) { + val data = proxyRendering.get(i) switch(data) { KRenderingRef: { // all references to KRenderings need to place a map with the ids of the renderings and their @@ -147,13 +240,9 @@ final class RenderingPreparer { data.properties.put(CALCULATED_BOUNDS_MAP, boundsMap) // and the decorationMap data.properties.put(CALCULATED_DECORATION_MAP, decorationMap) - // remember the id of the rendering in the reference - data.renderingId = data.rendering.renderingId } KRendering: { - // every rendering needs an ID, generate it here - KRenderingIdGenerator.generateIdsRecursive(data) if (data.eContainer instanceof KNode) { // Calculate the size and layout of the proxy first. val parent = data.eContainer as KNode @@ -331,7 +420,6 @@ final class RenderingPreparer { // to call KLighD's DecoratorPlacementUtil#evaluateDecoratorPlacement the points of the path of the // parent rendering have to be stored. var Point2D[] path = #[] -// var path = new KlighdPath(rendering) // TODO: Can I also only use the points of the rendering? val parentRendering = rendering.eContainer // Get inset from parent region @@ -365,10 +453,11 @@ final class RenderingPreparer { var List pointList = new ArrayList() if (parent instanceof KEdge) { val edge = parent as KEdge - - pointList.add(new Point2D.Float(edge.sourcePoint.x, edge.sourcePoint.y)) - pointList.addAll(edge.bendPoints.map[ new Point2D.Float(it.x, it.y) ]) - pointList.add(new Point2D.Float(edge.targetPoint.x, edge.targetPoint.y)) + if (edge.sourcePoint !== null && edge.targetPoint !== null) { + pointList.add(new Point2D.Float(edge.sourcePoint.x, edge.sourcePoint.y)) + pointList.addAll(edge.bendPoints.map[ new Point2D.Float(it.x, it.y) ]) + pointList.add(new Point2D.Float(edge.targetPoint.x, edge.targetPoint.y)) + } } else if (!parentRendering.points.empty) { pointList.addAll(parentRendering.points.map[position | PlacementUtil.evaluateKPosition(position, parentBounds, true).toPoint2D]) diff --git a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/utils/SimpleTraceRegionProvider.xtend b/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/utils/SimpleTraceRegionProvider.xtend deleted file mode 100644 index 175b4f0b8..000000000 --- a/plugins/de.cau.cs.kieler.klighd.lsp/src/de/cau/cs/kieler/klighd/lsp/utils/SimpleTraceRegionProvider.xtend +++ /dev/null @@ -1,41 +0,0 @@ -/* - * KIELER - Kiel Integrated Environment for Layout Eclipse RichClient - * - * http://rtsys.informatik.uni-kiel.de/kieler - * - * Copyright 2018,2019 by - * + Kiel University - * + Department of Computer Science - * + Real-Time and Embedded Systems Group - * - * This program and the accompanying materials are made available under the - * terms of the Eclipse Public License 2.0 which is available at - * http://www.eclipse.org/legal/epl-2.0. - * - * SPDX-License-Identifier: EPL-2.0 - */ -package de.cau.cs.kieler.klighd.lsp.utils - -import org.eclipse.emf.ecore.EObject -import org.eclipse.sprotty.xtext.tracing.TextRegionProvider -import org.eclipse.xtext.nodemodel.util.NodeModelUtils -import org.eclipse.xtext.util.TextRegion - -/** - * If Sprotty's text region provider does not find any significant region, this will instead try to highlight the text - * for the entire element that was clicked, not just its most significant part. - * - * @author nre - */ -class SimpleTraceRegionProvider extends TextRegionProvider { - /** - * Returns the text region of the entire definition of this {@link EObject}, if no more specific region is found. - */ - override TextRegion getSignificantRegion(EObject element) { - val significantRegion = super.getSignificantRegion(element) - if (significantRegion !== null) { - return significantRegion - } - return NodeModelUtils.findActualNodeFor(element).toTextRegion - } -} \ No newline at end of file diff --git a/plugins/de.cau.cs.kieler.klighd.piccolo.batik/.classpath b/plugins/de.cau.cs.kieler.klighd.piccolo.batik/.classpath index 711341e8d..9715836f2 100644 --- a/plugins/de.cau.cs.kieler.klighd.piccolo.batik/.classpath +++ b/plugins/de.cau.cs.kieler.klighd.piccolo.batik/.classpath @@ -7,7 +7,7 @@ - + diff --git a/plugins/de.cau.cs.kieler.klighd.piccolo.batik/.settings/org.eclipse.core.resources.prefs b/plugins/de.cau.cs.kieler.klighd.piccolo.batik/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 000000000..99f26c020 --- /dev/null +++ b/plugins/de.cau.cs.kieler.klighd.piccolo.batik/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/plugins/de.cau.cs.kieler.klighd.piccolo.batik/META-INF/MANIFEST.MF b/plugins/de.cau.cs.kieler.klighd.piccolo.batik/META-INF/MANIFEST.MF index 977fe3bd6..9d86ad984 100644 --- a/plugins/de.cau.cs.kieler.klighd.piccolo.batik/META-INF/MANIFEST.MF +++ b/plugins/de.cau.cs.kieler.klighd.piccolo.batik/META-INF/MANIFEST.MF @@ -2,10 +2,10 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: KIELER Lightweight Diagrams Vector Graphics Export Powered by Batik Bundle-SymbolicName: de.cau.cs.kieler.klighd.piccolo.batik;singleton:=true -Bundle-Version: 2.2.1.qualifier +Bundle-Version: 3.0.3.qualifier Bundle-Vendor: Kiel University Fragment-Host: de.cau.cs.kieler.klighd.piccolo;bundle-version="0.10.0" -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Bundle-RequiredExecutionEnvironment: JavaSE-11 Bundle-ClassPath: ., lib/batik.jar, lib/lib/batik-dom.jar, diff --git a/plugins/de.cau.cs.kieler.klighd.piccolo.batik/pom.xml b/plugins/de.cau.cs.kieler.klighd.piccolo.batik/pom.xml index f38782fff..3c2983f5b 100644 --- a/plugins/de.cau.cs.kieler.klighd.piccolo.batik/pom.xml +++ b/plugins/de.cau.cs.kieler.klighd.piccolo.batik/pom.xml @@ -5,13 +5,11 @@ de.cau.cs.kieler.klighd parent - 2.2.1-SNAPSHOT + 3.0.3-SNAPSHOT ../../pom.xml - de.cau.cs.kieler.klighd de.cau.cs.kieler.klighd.piccolo.batik - 2.2.1-SNAPSHOT eclipse-plugin KIELER Lightweight Diagrams Vector Graphics Export Powered by Batik diff --git a/plugins/de.cau.cs.kieler.klighd.piccolo.draw2d/.classpath b/plugins/de.cau.cs.kieler.klighd.piccolo.draw2d/.classpath index eca7bdba8..e801ebfb4 100644 --- a/plugins/de.cau.cs.kieler.klighd.piccolo.draw2d/.classpath +++ b/plugins/de.cau.cs.kieler.klighd.piccolo.draw2d/.classpath @@ -1,6 +1,6 @@ - + diff --git a/plugins/de.cau.cs.kieler.klighd.piccolo.draw2d/.settings/org.eclipse.core.resources.prefs b/plugins/de.cau.cs.kieler.klighd.piccolo.draw2d/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 000000000..99f26c020 --- /dev/null +++ b/plugins/de.cau.cs.kieler.klighd.piccolo.draw2d/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/plugins/de.cau.cs.kieler.klighd.piccolo.draw2d/META-INF/MANIFEST.MF b/plugins/de.cau.cs.kieler.klighd.piccolo.draw2d/META-INF/MANIFEST.MF index b36cfcb69..5491c9149 100644 --- a/plugins/de.cau.cs.kieler.klighd.piccolo.draw2d/META-INF/MANIFEST.MF +++ b/plugins/de.cau.cs.kieler.klighd.piccolo.draw2d/META-INF/MANIFEST.MF @@ -2,10 +2,10 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: KLighD Piccolo Binding Extension Supporting Draw2d Figures Bundle-SymbolicName: de.cau.cs.kieler.klighd.piccolo.draw2d;singleton:=true -Bundle-Version: 2.3.1.qualifier +Bundle-Version: 3.0.3.qualifier Bundle-Vendor: Kiel University Fragment-Host: de.cau.cs.kieler.klighd.piccolo -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Bundle-RequiredExecutionEnvironment: JavaSE-11 Require-Bundle: com.google.guava;bundle-version="10.0.0", org.eclipse.draw2d;bundle-version="3.7.0" Automatic-Module-Name: de.cau.cs.kieler.klighd.piccolo.draw2d diff --git a/plugins/de.cau.cs.kieler.klighd.piccolo.draw2d/pom.xml b/plugins/de.cau.cs.kieler.klighd.piccolo.draw2d/pom.xml index 996a21695..6e07c7222 100644 --- a/plugins/de.cau.cs.kieler.klighd.piccolo.draw2d/pom.xml +++ b/plugins/de.cau.cs.kieler.klighd.piccolo.draw2d/pom.xml @@ -5,13 +5,11 @@ de.cau.cs.kieler.klighd parent - 2.3.1-SNAPSHOT + 3.0.3-SNAPSHOT ../../pom.xml - de.cau.cs.kieler.klighd de.cau.cs.kieler.klighd.piccolo.draw2d - 2.3.1-SNAPSHOT eclipse-plugin KLighD Piccolo Binding Extension Supporting Draw2d Figures diff --git a/plugins/de.cau.cs.kieler.klighd.piccolo.freehep/.classpath b/plugins/de.cau.cs.kieler.klighd.piccolo.freehep/.classpath index ec88fe259..c43a0dbb1 100644 --- a/plugins/de.cau.cs.kieler.klighd.piccolo.freehep/.classpath +++ b/plugins/de.cau.cs.kieler.klighd.piccolo.freehep/.classpath @@ -1,13 +1,27 @@ - + + + + + - + + + + + + + + + + + diff --git a/plugins/de.cau.cs.kieler.klighd.piccolo.freehep/.project b/plugins/de.cau.cs.kieler.klighd.piccolo.freehep/.project index ffa35a610..317ff9ba4 100644 --- a/plugins/de.cau.cs.kieler.klighd.piccolo.freehep/.project +++ b/plugins/de.cau.cs.kieler.klighd.piccolo.freehep/.project @@ -5,6 +5,11 @@ + + org.eclipse.xtext.ui.shared.xtextBuilder + + + org.eclipse.jdt.core.javabuilder @@ -20,8 +25,15 @@ + + org.eclipse.m2e.core.maven2Builder + + + + org.eclipse.xtext.ui.shared.xtextNature + org.eclipse.m2e.core.maven2Nature org.eclipse.pde.PluginNature org.eclipse.jdt.core.javanature diff --git a/plugins/de.cau.cs.kieler.klighd.piccolo.freehep/.settings/org.eclipse.core.resources.prefs b/plugins/de.cau.cs.kieler.klighd.piccolo.freehep/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 000000000..99f26c020 --- /dev/null +++ b/plugins/de.cau.cs.kieler.klighd.piccolo.freehep/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/plugins/de.cau.cs.kieler.klighd.piccolo.freehep/.settings/org.eclipse.jdt.core.prefs b/plugins/de.cau.cs.kieler.klighd.piccolo.freehep/.settings/org.eclipse.jdt.core.prefs index c684e86e0..78976718d 100644 --- a/plugins/de.cau.cs.kieler.klighd.piccolo.freehep/.settings/org.eclipse.jdt.core.prefs +++ b/plugins/de.cau.cs.kieler.klighd.piccolo.freehep/.settings/org.eclipse.jdt.core.prefs @@ -1,5 +1,14 @@ eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=11 +org.eclipse.jdt.core.compiler.compliance=11 +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=11 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 @@ -7,17 +16,20 @@ org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_c org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 org.eclipse.jdt.core.formatter.alignment_for_assignment=16 -org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator=16 org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 +org.eclipse.jdt.core.formatter.alignment_for_logical_operator=16 org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator=16 org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_string_concatenation=16 org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 @@ -103,11 +115,12 @@ org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_additive_operator=insert org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_bitwise_operator=insert org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert @@ -138,6 +151,8 @@ org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_after_logical_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator=insert org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert @@ -162,13 +177,17 @@ org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_relational_operator=insert org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert +org.eclipse.jdt.core.formatter.insert_space_after_shift_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation=insert org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_additive_operator=insert org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_bitwise_operator=insert org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert @@ -216,6 +235,8 @@ org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do no org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_before_logical_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator=insert org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert @@ -252,9 +273,12 @@ org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not inser org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_relational_operator=insert org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_shift_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation=insert org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert @@ -280,7 +304,11 @@ org.eclipse.jdt.core.formatter.tabulation.char=space org.eclipse.jdt.core.formatter.tabulation.size=4 org.eclipse.jdt.core.formatter.use_on_off_tags=true org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=true -org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true +org.eclipse.jdt.core.formatter.wrap_before_additive_operator=true +org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator=true +org.eclipse.jdt.core.formatter.wrap_before_logical_operator=true +org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator=true org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true +org.eclipse.jdt.core.formatter.wrap_before_string_concatenation=true org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true org.eclipse.jdt.core.javaFormatter=org.eclipse.jdt.core.defaultJavaFormatter diff --git a/plugins/de.cau.cs.kieler.klighd.piccolo.freehep/.settings/org.eclipse.m2e.core.prefs b/plugins/de.cau.cs.kieler.klighd.piccolo.freehep/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 000000000..f897a7f1c --- /dev/null +++ b/plugins/de.cau.cs.kieler.klighd.piccolo.freehep/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/plugins/de.cau.cs.kieler.klighd.piccolo.freehep/.settings/org.eclipse.xtend.core.Xtend.prefs b/plugins/de.cau.cs.kieler.klighd.piccolo.freehep/.settings/org.eclipse.xtend.core.Xtend.prefs new file mode 100644 index 000000000..2b65c6b65 --- /dev/null +++ b/plugins/de.cau.cs.kieler.klighd.piccolo.freehep/.settings/org.eclipse.xtend.core.Xtend.prefs @@ -0,0 +1,8 @@ +BuilderConfiguration.is_project_specific=true +eclipse.preferences.version=1 +outlet.DEFAULT_OUTPUT.hideLocalSyntheticVariables=true +outlet.DEFAULT_OUTPUT.installDslAsPrimarySource=false +outlet.DEFAULT_OUTPUT.sourceFolder.src-gen.directory=xtend-gen +outlet.DEFAULT_OUTPUT.sourceFolder.src.directory=xtend-gen +outlet.DEFAULT_OUTPUT.sourceFolder.xtend-gen.directory=xtend-gen +outlet.DEFAULT_OUTPUT.userOutputPerSourceFolder=true diff --git a/plugins/de.cau.cs.kieler.klighd.piccolo.freehep/META-INF/MANIFEST.MF b/plugins/de.cau.cs.kieler.klighd.piccolo.freehep/META-INF/MANIFEST.MF index 7677b38ba..a63cefc97 100644 --- a/plugins/de.cau.cs.kieler.klighd.piccolo.freehep/META-INF/MANIFEST.MF +++ b/plugins/de.cau.cs.kieler.klighd.piccolo.freehep/META-INF/MANIFEST.MF @@ -2,10 +2,10 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: KIELER Lightweight Diagrams Vector Graphics Export Powered by FreeHEP Bundle-SymbolicName: de.cau.cs.kieler.klighd.piccolo.freehep;singleton:=true -Bundle-Version: 2.3.1.qualifier +Bundle-Version: 3.0.3.qualifier Bundle-Vendor: Kiel University Fragment-Host: de.cau.cs.kieler.klighd.piccolo -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Bundle-RequiredExecutionEnvironment: JavaSE-11 Bundle-ClassPath: ., lib/freehep-graphics2d-2.3.jar, lib/freehep-graphicsbase-2.3.jar, diff --git a/plugins/de.cau.cs.kieler.klighd.piccolo.freehep/pom.xml b/plugins/de.cau.cs.kieler.klighd.piccolo.freehep/pom.xml index 7590954db..a76c92487 100644 --- a/plugins/de.cau.cs.kieler.klighd.piccolo.freehep/pom.xml +++ b/plugins/de.cau.cs.kieler.klighd.piccolo.freehep/pom.xml @@ -5,13 +5,11 @@ de.cau.cs.kieler.klighd parent - 2.3.1-SNAPSHOT + 3.0.3-SNAPSHOT ../../pom.xml - de.cau.cs.kieler.klighd de.cau.cs.kieler.klighd.piccolo.freehep - 2.3.1-SNAPSHOT eclipse-plugin KIELER Lightweight Diagrams Vector Graphics Export Powered by FreeHEP diff --git a/plugins/de.cau.cs.kieler.klighd.piccolo.freehep/src/de/cau/cs/kieler/klighd/piccolo/freehep/SemanticSVGGraphics2D.java b/plugins/de.cau.cs.kieler.klighd.piccolo.freehep/src/de/cau/cs/kieler/klighd/piccolo/freehep/SemanticSVGGraphics2D.java index 8a518d1b2..4e07902de 100644 --- a/plugins/de.cau.cs.kieler.klighd.piccolo.freehep/src/de/cau/cs/kieler/klighd/piccolo/freehep/SemanticSVGGraphics2D.java +++ b/plugins/de.cau.cs.kieler.klighd.piccolo.freehep/src/de/cau/cs/kieler/klighd/piccolo/freehep/SemanticSVGGraphics2D.java @@ -37,6 +37,7 @@ import java.util.Arrays; import java.util.Date; import java.util.Enumeration; +import java.util.HashMap; import java.util.Hashtable; import java.util.Locale; import java.util.Map; @@ -66,8 +67,6 @@ import org.freehep.util.io.WriterOutputStream; import com.google.common.base.Strings; -import com.google.common.collect.Maps; - import de.cau.cs.kieler.klighd.Klighd; import de.cau.cs.kieler.klighd.KlighdConstants; import de.cau.cs.kieler.klighd.microlayout.PlacementUtil; @@ -227,7 +226,7 @@ public static void setDefaultProperties(Properties newProperties) { private final float pointToPxFactor = KlighdConstants.DEFAULT_DISPLAY_DPI / 72f; /** A mapping of awt fonts to swt fonts. The latter are used for font size calculations. */ - private Map awtSwtFontCache = Maps.newHashMap(); + private Map awtSwtFontCache = new HashMap<>(); /* * ================================================================================ | diff --git a/plugins/de.cau.cs.kieler.klighd.piccolo/.classpath b/plugins/de.cau.cs.kieler.klighd.piccolo/.classpath index 43b986286..1db08c6b4 100644 --- a/plugins/de.cau.cs.kieler.klighd.piccolo/.classpath +++ b/plugins/de.cau.cs.kieler.klighd.piccolo/.classpath @@ -1,6 +1,6 @@ - + diff --git a/plugins/de.cau.cs.kieler.klighd.piccolo/.settings/org.eclipse.jdt.core.prefs b/plugins/de.cau.cs.kieler.klighd.piccolo/.settings/org.eclipse.jdt.core.prefs index 684b002cf..40543c0e5 100644 --- a/plugins/de.cau.cs.kieler.klighd.piccolo/.settings/org.eclipse.jdt.core.prefs +++ b/plugins/de.cau.cs.kieler.klighd.piccolo/.settings/org.eclipse.jdt.core.prefs @@ -9,8 +9,13 @@ org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nul org.eclipse.jdt.core.compiler.annotation.nullable.secondary= org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 -org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate +org.eclipse.jdt.core.compiler.codegen.targetPlatform=11 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=11 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate org.eclipse.jdt.core.compiler.problem.APILeak=warning org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning org.eclipse.jdt.core.compiler.problem.assertIdentifier=error @@ -22,6 +27,7 @@ org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled org.eclipse.jdt.core.compiler.problem.discouragedReference=warning org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled org.eclipse.jdt.core.compiler.problem.enumIdentifier=error org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore @@ -67,6 +73,7 @@ org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=igno org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled @@ -104,8 +111,8 @@ org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning org.eclipse.jdt.core.compiler.problem.unusedTypeParameter=ignore org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning -org.eclipse.jdt.core.compiler.release=disabled -org.eclipse.jdt.core.compiler.source=1.8 +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 diff --git a/plugins/de.cau.cs.kieler.klighd.piccolo/META-INF/MANIFEST.MF b/plugins/de.cau.cs.kieler.klighd.piccolo/META-INF/MANIFEST.MF index 9aeef5e0e..4f7d342e5 100644 --- a/plugins/de.cau.cs.kieler.klighd.piccolo/META-INF/MANIFEST.MF +++ b/plugins/de.cau.cs.kieler.klighd.piccolo/META-INF/MANIFEST.MF @@ -2,9 +2,9 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: KIELER Lightweight Diagrams Powered by Piccolo2D Bundle-SymbolicName: de.cau.cs.kieler.klighd.piccolo;singleton:=true -Bundle-Version: 2.3.1.qualifier +Bundle-Version: 3.0.3.qualifier Bundle-Vendor: Kiel University -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Bundle-RequiredExecutionEnvironment: JavaSE-11 Bundle-ActivationPolicy: lazy Require-Bundle: com.google.guava;bundle-version="10.0.0", de.cau.cs.kieler.klighd;bundle-version="0.3.0";visibility:=reexport, diff --git a/plugins/de.cau.cs.kieler.klighd.piccolo/pom.xml b/plugins/de.cau.cs.kieler.klighd.piccolo/pom.xml index 5f3838361..8d9f0497c 100644 --- a/plugins/de.cau.cs.kieler.klighd.piccolo/pom.xml +++ b/plugins/de.cau.cs.kieler.klighd.piccolo/pom.xml @@ -5,13 +5,11 @@ de.cau.cs.kieler.klighd parent - 2.3.1-SNAPSHOT + 3.0.3-SNAPSHOT ../../pom.xml - de.cau.cs.kieler.klighd de.cau.cs.kieler.klighd.piccolo - 2.3.1-SNAPSHOT eclipse-plugin KIELER Lightweight Diagrams Powered by Piccolo2D diff --git a/plugins/de.cau.cs.kieler.klighd.piccolo/src/de/cau/cs/kieler/klighd/piccolo/export/AbstractDiagramExporter.java b/plugins/de.cau.cs.kieler.klighd.piccolo/src/de/cau/cs/kieler/klighd/piccolo/export/AbstractDiagramExporter.java index 54fd32091..81b8a6719 100644 --- a/plugins/de.cau.cs.kieler.klighd.piccolo/src/de/cau/cs/kieler/klighd/piccolo/export/AbstractDiagramExporter.java +++ b/plugins/de.cau.cs.kieler.klighd.piccolo/src/de/cau/cs/kieler/klighd/piccolo/export/AbstractDiagramExporter.java @@ -22,10 +22,8 @@ import java.awt.geom.AffineTransform; import java.awt.geom.Point2D; import java.awt.geom.Rectangle2D; +import java.util.Objects; -import org.eclipse.elk.core.util.Pair; - -import com.google.common.base.Function; import com.google.common.collect.Iterables; import de.cau.cs.kieler.klighd.DiagramExportConfig; @@ -163,26 +161,11 @@ protected final Trim getMaximumDiagramTileTrim(final Iterable e private Trim getCumulatedTrim(final boolean tileTrim, final Iterable brandings, final Rectangle2D bounds, final Trim deviceTrim, final Point dotsPerInch) { - final Trim res = Iterables2.fold(brandings, new Function, Trim>() { - - public Trim apply(final Pair input) { - final Trim previousResult = input.getFirst(); - final IExportBranding branding = input.getSecond(); - final Trim trim; - - if (tileTrim) { - trim = branding.getDiagramTileTrimm(bounds, dotsPerInch, deviceTrim); - } else { - trim = branding.getDiagramTrim(bounds); - } - - if (previousResult == null) { - return trim; - - } else if (trim == null) { - return previousResult; - - } else { + return Iterables2.stream(brandings) + .map(branding -> tileTrim + ? branding.getDiagramTileTrimm(bounds, dotsPerInch, deviceTrim) + : branding.getDiagramTrim(bounds)) + .filter(Objects::nonNull).reduce((previousResult, trim) -> { final float maxLeft = Math.max(previousResult.left, trim.left); final float maxRight = Math.max(previousResult.right, trim.right); final float maxTop = Math.max(previousResult.top, trim.top); @@ -194,11 +177,7 @@ public Trim apply(final Pair input) { } else { return previousResult; } - } - } - }); - - return res != null ? res : new Trim(0, 0, 0, 0); + }).orElseGet(() -> new Trim(0, 0, 0, 0)); } diff --git a/plugins/de.cau.cs.kieler.klighd.piccolo/src/de/cau/cs/kieler/klighd/piccolo/export/AuthorConfidentialExportBranding.java b/plugins/de.cau.cs.kieler.klighd.piccolo/src/de/cau/cs/kieler/klighd/piccolo/export/AuthorConfidentialExportBranding.java index 8f8555fde..f862221f8 100644 --- a/plugins/de.cau.cs.kieler.klighd.piccolo/src/de/cau/cs/kieler/klighd/piccolo/export/AuthorConfidentialExportBranding.java +++ b/plugins/de.cau.cs.kieler.klighd.piccolo/src/de/cau/cs/kieler/klighd/piccolo/export/AuthorConfidentialExportBranding.java @@ -41,12 +41,12 @@ *
  * {@code
  * 
- *    
+ *    
- *    
+ *    
  * }
  * 
* diff --git a/plugins/de.cau.cs.kieler.klighd.piccolo/src/de/cau/cs/kieler/klighd/piccolo/export/BitmapExporter.java b/plugins/de.cau.cs.kieler.klighd.piccolo/src/de/cau/cs/kieler/klighd/piccolo/export/BitmapExporter.java index 602baa43a..e1f42d52a 100644 --- a/plugins/de.cau.cs.kieler.klighd.piccolo/src/de/cau/cs/kieler/klighd/piccolo/export/BitmapExporter.java +++ b/plugins/de.cau.cs.kieler.klighd.piccolo/src/de/cau/cs/kieler/klighd/piccolo/export/BitmapExporter.java @@ -78,7 +78,7 @@ public IStatus export(final KlighdCanvas canvas, final ExportData data) { final TilingData tilingInfo = data.tilingInfo(); final Trim trim = getMaximumDiagramTrim(brandings, bounds); - final Trim tileTrimScaled = getMaximumDiagramTileTrim(brandings); + final Trim tileTrimScaled = getMaximumDiagramTileTrim(brandings, bounds, null, null); // determine the employed image's size final double width = data.scale() * (bounds.getWidth() + trim.getWidth()); diff --git a/plugins/de.cau.cs.kieler.klighd.piccolo/src/de/cau/cs/kieler/klighd/piccolo/export/KlighdAbstractSVGGraphics.java b/plugins/de.cau.cs.kieler.klighd.piccolo/src/de/cau/cs/kieler/klighd/piccolo/export/KlighdAbstractSVGGraphics.java index 020828993..39cb76f8b 100644 --- a/plugins/de.cau.cs.kieler.klighd.piccolo/src/de/cau/cs/kieler/klighd/piccolo/export/KlighdAbstractSVGGraphics.java +++ b/plugins/de.cau.cs.kieler.klighd.piccolo/src/de/cau/cs/kieler/klighd/piccolo/export/KlighdAbstractSVGGraphics.java @@ -47,6 +47,7 @@ import java.io.IOException; import java.io.OutputStream; import java.text.AttributedCharacterIterator; +import java.util.HashMap; import java.util.Map; import org.eclipse.elk.core.util.Pair; @@ -62,8 +63,6 @@ import org.eclipse.swt.graphics.RGB; import com.google.common.base.Objects; -import com.google.common.collect.Maps; - import de.cau.cs.kieler.klighd.KlighdConstants; import de.cau.cs.kieler.klighd.krendering.KTextUtil; import de.cau.cs.kieler.klighd.piccolo.internal.KlighdSWTGraphicsEx; @@ -100,7 +99,7 @@ public abstract class KlighdAbstractSVGGraphics extends Graphics2D implements Kl private FontData fontData = KlighdConstants.DEFAULT_FONT; - private final Map imageBuffer = Maps.newHashMap(); + private final Map imageBuffer = new HashMap<>(); private final Rectangle2D imageBoundsRect = new Rectangle2D.Double(); // the dash constants in the following definitions are copied diff --git a/plugins/de.cau.cs.kieler.klighd.piccolo/src/de/cau/cs/kieler/klighd/piccolo/internal/KlighdSWTGraphicsImpl.java b/plugins/de.cau.cs.kieler.klighd.piccolo/src/de/cau/cs/kieler/klighd/piccolo/internal/KlighdSWTGraphicsImpl.java index fd2bad6b5..46bab8f82 100644 --- a/plugins/de.cau.cs.kieler.klighd.piccolo/src/de/cau/cs/kieler/klighd/piccolo/internal/KlighdSWTGraphicsImpl.java +++ b/plugins/de.cau.cs.kieler.klighd.piccolo/src/de/cau/cs/kieler/klighd/piccolo/internal/KlighdSWTGraphicsImpl.java @@ -42,6 +42,7 @@ import java.awt.image.renderable.RenderableImage; import java.lang.ref.WeakReference; import java.text.AttributedCharacterIterator; +import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -65,8 +66,6 @@ import org.eclipse.swt.graphics.Transform; import org.eclipse.swt.widgets.Display; -import com.google.common.collect.Lists; - import de.cau.cs.kieler.klighd.Klighd; import de.cau.cs.kieler.klighd.KlighdConstants; import de.cau.cs.kieler.klighd.piccolo.internal.nodes.KlighdPaths; @@ -438,7 +437,7 @@ public FontData getFontData() { protected static final HashMap FONT_CACHE = new HashMap(); private boolean cacheFonts = true; - private List temporaryFonts = null; + private final List temporaryFonts = new ArrayList<>(); /** @@ -487,9 +486,6 @@ public void setFont(final FontData fontData, final int maxLineWidth) { curFont = font; } else { - if (temporaryFonts == null) { - temporaryFonts = Lists.newArrayList(); - } curFont = new org.eclipse.swt.graphics.Font( fontCreationDevice != null ? fontCreationDevice : device, fontData); temporaryFonts.add(curFont); diff --git a/plugins/de.cau.cs.kieler.klighd.piccolo/src/de/cau/cs/kieler/klighd/piccolo/internal/controller/AbstractKGERenderingController.java b/plugins/de.cau.cs.kieler.klighd.piccolo/src/de/cau/cs/kieler/klighd/piccolo/internal/controller/AbstractKGERenderingController.java index 533b41933..03cacef94 100644 --- a/plugins/de.cau.cs.kieler.klighd.piccolo/src/de/cau/cs/kieler/klighd/piccolo/internal/controller/AbstractKGERenderingController.java +++ b/plugins/de.cau.cs.kieler.klighd.piccolo/src/de/cau/cs/kieler/klighd/piccolo/internal/controller/AbstractKGERenderingController.java @@ -24,6 +24,7 @@ import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; +import java.util.ArrayList; import java.util.Collection; import java.util.Collections; import java.util.Iterator; @@ -796,7 +797,7 @@ private boolean isSelected(final KText kText) { */ protected List determinePropagationStyles(final List renderingStyles, final List propagatedStyles, final boolean isRenderingRef) { - final List result = Lists.newLinkedList(); + final List result = new ArrayList<>(); for (final KStyle style : isRenderingRef ? propagatedStyles : concat( propagatedStyles, renderingStyles)) { @@ -1255,7 +1256,7 @@ protected void addListener(final String property, final IKlighdNode parent, @SuppressWarnings("unchecked") List listeners = (List) nodeAsPNode.getAttribute(PROPERTY_LISTENER_KEY); if (listeners == null) { - listeners = Lists.newLinkedList(); + listeners = new ArrayList<>(); nodeAsPNode.addAttribute(PROPERTY_LISTENER_KEY, listeners); } listeners.add(new Pair(property, listener)); diff --git a/plugins/de.cau.cs.kieler.klighd.piccolo/src/de/cau/cs/kieler/klighd/piccolo/internal/controller/DiagramController.java b/plugins/de.cau.cs.kieler.klighd.piccolo/src/de/cau/cs/kieler/klighd/piccolo/internal/controller/DiagramController.java index 07f121a05..e11041307 100644 --- a/plugins/de.cau.cs.kieler.klighd.piccolo/src/de/cau/cs/kieler/klighd/piccolo/internal/controller/DiagramController.java +++ b/plugins/de.cau.cs.kieler.klighd.piccolo/src/de/cau/cs/kieler/klighd/piccolo/internal/controller/DiagramController.java @@ -19,6 +19,9 @@ import java.awt.geom.Point2D; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; +import java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Set; @@ -45,9 +48,6 @@ import com.google.common.collect.ImmutableSet; import com.google.common.collect.Iterables; import com.google.common.collect.Iterators; -import com.google.common.collect.Maps; -import com.google.common.collect.Sets; - import de.cau.cs.kieler.klighd.Klighd; import de.cau.cs.kieler.klighd.KlighdOptions; import de.cau.cs.kieler.klighd.ViewContext; @@ -156,7 +156,7 @@ public class DiagramController { private boolean record = false; /** the layout changes to graph elements while recording. */ - private final Map recordedChanges = Maps.newLinkedHashMap(); + private final Map recordedChanges = new LinkedHashMap<>(); /** indicates whether scheduled diagram element updates must be executed via this display. */ private final Display display; @@ -835,9 +835,9 @@ void recordChange(final IKGraphElementNode node, final Object change) { recordedChanges.put(node, change); } - private final Set> dirtyDiagramElements = Sets.newHashSet(); + private final Set> dirtyDiagramElements = new HashSet<>(); private final Map, ElementMovement> dirtyDiagramElementStyles = - Maps.newHashMap(); + new HashMap<>(); void scheduleRenderingUpdate(final AbstractKGERenderingController controller) { renderingUpdater.cancel(); diff --git a/plugins/de.cau.cs.kieler.klighd.piccolo/src/de/cau/cs/kieler/klighd/piccolo/internal/controller/DiagramControllerHelper.java b/plugins/de.cau.cs.kieler.klighd.piccolo/src/de/cau/cs/kieler/klighd/piccolo/internal/controller/DiagramControllerHelper.java index c12361a29..b00040a0b 100644 --- a/plugins/de.cau.cs.kieler.klighd.piccolo/src/de/cau/cs/kieler/klighd/piccolo/internal/controller/DiagramControllerHelper.java +++ b/plugins/de.cau.cs.kieler.klighd.piccolo/src/de/cau/cs/kieler/klighd/piccolo/internal/controller/DiagramControllerHelper.java @@ -19,6 +19,7 @@ import java.awt.geom.Point2D; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; +import java.util.ArrayList; import java.util.List; import org.eclipse.emf.ecore.EObject; @@ -133,7 +134,7 @@ public void propertyChange(final PropertyChangeEvent event) { edgeNode.addAttribute(EDGE_OFFSET_LISTENER_KEY, listener); // calculate the offset and register the update offset listener - List listenedNodes = Lists.newLinkedList(); + List listenedNodes = new ArrayList<>(); Point2D offset = new Point2D.Double(0, 0); PNode currentNode = relativeChildArea; while (currentNode != null && currentNode != edgeNodeParent) { diff --git a/plugins/de.cau.cs.kieler.klighd.piccolo/src/de/cau/cs/kieler/klighd/piccolo/internal/controller/DiagramZoomControllerBoundsComputer.java b/plugins/de.cau.cs.kieler.klighd.piccolo/src/de/cau/cs/kieler/klighd/piccolo/internal/controller/DiagramZoomControllerBoundsComputer.java index 341a1b66f..95b954247 100644 --- a/plugins/de.cau.cs.kieler.klighd.piccolo/src/de/cau/cs/kieler/klighd/piccolo/internal/controller/DiagramZoomControllerBoundsComputer.java +++ b/plugins/de.cau.cs.kieler.klighd.piccolo/src/de/cau/cs/kieler/klighd/piccolo/internal/controller/DiagramZoomControllerBoundsComputer.java @@ -16,6 +16,7 @@ */ package de.cau.cs.kieler.klighd.piccolo.internal.controller; +import java.util.HashSet; import java.util.Set; import org.eclipse.elk.core.math.Spacing; @@ -23,8 +24,6 @@ import com.google.common.base.Predicate; import com.google.common.collect.Iterables; -import com.google.common.collect.Sets; - import de.cau.cs.kieler.klighd.kgraph.KEdge; import de.cau.cs.kieler.klighd.kgraph.KGraphElement; import de.cau.cs.kieler.klighd.kgraph.KInsets; @@ -293,7 +292,7 @@ public PBounds toPBoundsIncludingPortsAndLabels(final KNode node, public PBounds getContainedSubDiagramsBoundingBox(final KNode node, final Predicate isDisplayedFilter) { final PBounds nodeBounds = new PBounds(); - final Set visitedEdges = Sets.newHashSet(); + final Set visitedEdges = new HashSet<>(); for (final KNode childNode : Iterables.filter(node.getChildren(), isDisplayedFilter)) { nodeBounds.add(toPBoundsIncludingPortsAndLabels(childNode, false, null, false)); diff --git a/plugins/de.cau.cs.kieler.klighd.piccolo/src/de/cau/cs/kieler/klighd/piccolo/internal/controller/KGERenderingControllerHelper.java b/plugins/de.cau.cs.kieler.klighd.piccolo/src/de/cau/cs/kieler/klighd/piccolo/internal/controller/KGERenderingControllerHelper.java index be1c3e07d..c10612320 100644 --- a/plugins/de.cau.cs.kieler.klighd.piccolo/src/de/cau/cs/kieler/klighd/piccolo/internal/controller/KGERenderingControllerHelper.java +++ b/plugins/de.cau.cs.kieler.klighd.piccolo/src/de/cau/cs/kieler/klighd/piccolo/internal/controller/KGERenderingControllerHelper.java @@ -20,6 +20,7 @@ import java.awt.geom.Point2D; import java.awt.geom.RectangularShape; import java.net.URL; +import java.util.ArrayList; import java.util.List; import org.eclipse.core.runtime.IStatus; @@ -406,7 +407,7 @@ static PNodeController createLine( // handle children if (line.getChildren().size() > 0) { - final List restChildren = Lists.newLinkedList(); + final List restChildren = new ArrayList<>(); for (final KRendering rendering : line.getChildren()) { if (DecoratorPlacementUtil.getDecoratorPlacementData(rendering) != null) { controller.handleDecoratorPlacementRendering(rendering, propagatedStyles, path); @@ -502,7 +503,7 @@ static PNodeController createPolygon( // handle children if (polygon.getChildren().size() > 0) { - final List restChildren = Lists.newLinkedList(); + final List restChildren = new ArrayList<>(); for (final KRendering rendering : polygon.getChildren()) { if (DecoratorPlacementUtil.getDecoratorPlacementData(rendering) != null) { controller.handleDecoratorPlacementRendering(rendering, propagatedStyles, path); diff --git a/plugins/de.cau.cs.kieler.klighd.piccolo/src/de/cau/cs/kieler/klighd/piccolo/internal/events/KlighdSelectionEventHandler.java b/plugins/de.cau.cs.kieler.klighd.piccolo/src/de/cau/cs/kieler/klighd/piccolo/internal/events/KlighdSelectionEventHandler.java index ed32c28ee..c35eb25bf 100644 --- a/plugins/de.cau.cs.kieler.klighd.piccolo/src/de/cau/cs/kieler/klighd/piccolo/internal/events/KlighdSelectionEventHandler.java +++ b/plugins/de.cau.cs.kieler.klighd.piccolo/src/de/cau/cs/kieler/klighd/piccolo/internal/events/KlighdSelectionEventHandler.java @@ -22,6 +22,7 @@ import java.awt.geom.Point2D; import java.awt.geom.Rectangle2D; import java.util.Collections; +import java.util.HashSet; import java.util.Iterator; import java.util.ListIterator; import java.util.Set; @@ -29,8 +30,6 @@ import org.eclipse.emf.ecore.EObject; import com.google.common.collect.Iterators; -import com.google.common.collect.Sets; - import de.cau.cs.kieler.klighd.IViewer; import de.cau.cs.kieler.klighd.kgraph.KEdge; import de.cau.cs.kieler.klighd.kgraph.KGraphElement; @@ -340,7 +339,7 @@ protected void performSelection(final PInputEvent event) { protected Set performEdgeSelection(final Set selectedElements, final KEdge edge) { final Set returnedElements = - selectedElements == null ? Sets.newHashSet() : selectedElements; + selectedElements == null ? new HashSet<>() : selectedElements; // add the currently found edge and its connected ones // to the set of elements to be selected, diff --git a/plugins/de.cau.cs.kieler.klighd.piccolo/src/de/cau/cs/kieler/klighd/piccolo/internal/nodes/KlighdImage.java b/plugins/de.cau.cs.kieler.klighd.piccolo/src/de/cau/cs/kieler/klighd/piccolo/internal/nodes/KlighdImage.java index 9d2fef737..7d58f1290 100644 --- a/plugins/de.cau.cs.kieler.klighd.piccolo/src/de/cau/cs/kieler/klighd/piccolo/internal/nodes/KlighdImage.java +++ b/plugins/de.cau.cs.kieler.klighd.piccolo/src/de/cau/cs/kieler/klighd/piccolo/internal/nodes/KlighdImage.java @@ -21,6 +21,7 @@ import java.io.IOException; import java.io.InputStream; import java.net.URL; +import java.util.ArrayList; import java.util.List; import org.eclipse.core.runtime.IStatus; @@ -30,8 +31,6 @@ import org.eclipse.swt.graphics.Image; import org.eclipse.swt.graphics.ImageData; -import com.google.common.collect.Lists; - import de.cau.cs.kieler.klighd.Klighd; import de.cau.cs.kieler.klighd.krendering.KImage; import de.cau.cs.kieler.klighd.piccolo.KlighdNode; @@ -221,7 +220,7 @@ public InputStream setImage(final InputStream input) { public void setImage(final URL url) { if (imageKey != null) { if (formerImages == null) { - formerImages = Lists.newArrayList(); + formerImages = new ArrayList<>(); } formerImages.add(imageKey); } diff --git a/plugins/de.cau.cs.kieler.klighd.piccolo/src/de/cau/cs/kieler/klighd/piccolo/internal/nodes/KlighdPath.java b/plugins/de.cau.cs.kieler.klighd.piccolo/src/de/cau/cs/kieler/klighd/piccolo/internal/nodes/KlighdPath.java index 3b38a39eb..bccfaa1e2 100644 --- a/plugins/de.cau.cs.kieler.klighd.piccolo/src/de/cau/cs/kieler/klighd/piccolo/internal/nodes/KlighdPath.java +++ b/plugins/de.cau.cs.kieler.klighd.piccolo/src/de/cau/cs/kieler/klighd/piccolo/internal/nodes/KlighdPath.java @@ -33,6 +33,7 @@ import java.awt.geom.Rectangle2D; import java.awt.geom.RoundRectangle2D; import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; import java.util.function.Supplier; import org.eclipse.swt.graphics.Device; @@ -41,8 +42,6 @@ import org.eclipse.swt.graphics.RGB; import com.google.common.base.Objects; -import com.google.common.collect.Maps; - import de.cau.cs.kieler.klighd.Klighd; import de.cau.cs.kieler.klighd.KlighdConstants; import de.cau.cs.kieler.klighd.krendering.KRendering; @@ -85,7 +84,7 @@ public class KlighdPath extends KlighdNode.KlighdFigureNode implemen private static final long serialVersionUID = 8034306769936734586L; - private static final Map RGB_CACHE = Maps.newConcurrentMap(); + private static final Map RGB_CACHE = new ConcurrentHashMap<>(); // in order to fix the windows specific issue with the monitor zoom related line width scaling // (KIPRA-1925) but avoid additional effort on other platforms, diff --git a/plugins/de.cau.cs.kieler.klighd.piccolo/src/de/cau/cs/kieler/klighd/piccolo/internal/util/PolylineUtil.java b/plugins/de.cau.cs.kieler.klighd.piccolo/src/de/cau/cs/kieler/klighd/piccolo/internal/util/PolylineUtil.java index 7c80d5fbd..641990047 100644 --- a/plugins/de.cau.cs.kieler.klighd.piccolo/src/de/cau/cs/kieler/klighd/piccolo/internal/util/PolylineUtil.java +++ b/plugins/de.cau.cs.kieler.klighd.piccolo/src/de/cau/cs/kieler/klighd/piccolo/internal/util/PolylineUtil.java @@ -25,7 +25,6 @@ import org.eclipse.swt.widgets.Display; import com.google.common.collect.Iterables; -import com.google.common.collect.Lists; import de.cau.cs.kieler.klighd.piccolo.internal.nodes.KlighdPath; import de.cau.cs.kieler.klighd.piccolo.internal.nodes.KlighdPaths; @@ -221,7 +220,7 @@ public static Path2D createSplinePath(final Path2D thePath, final Point2D[] poin public static Point2D[] createSplineApproximationPath(final Path2D path) { final float[] coords = new float[2]; - final ArrayList approxPoints2 = Lists.newArrayList(); + final ArrayList approxPoints2 = new ArrayList<>(); final PathIterator pi = path.getPathIterator(null, MAX_APPROX_DISTANCE); while (!pi.isDone()) { diff --git a/plugins/de.cau.cs.kieler.klighd.piccolo/src/de/cau/cs/kieler/klighd/piccolo/internal/util/Styles.java b/plugins/de.cau.cs.kieler.klighd.piccolo/src/de/cau/cs/kieler/klighd/piccolo/internal/util/Styles.java index 857e4d731..a64394cf6 100644 --- a/plugins/de.cau.cs.kieler.klighd.piccolo/src/de/cau/cs/kieler/klighd/piccolo/internal/util/Styles.java +++ b/plugins/de.cau.cs.kieler.klighd.piccolo/src/de/cau/cs/kieler/klighd/piccolo/internal/util/Styles.java @@ -16,12 +16,12 @@ */ package de.cau.cs.kieler.klighd.piccolo.internal.util; +import java.util.ArrayList; import java.util.Collections; import java.util.List; import com.google.common.base.Predicate; import com.google.common.collect.Iterables; -import com.google.common.collect.Lists; import de.cau.cs.kieler.klighd.KlighdConstants; import de.cau.cs.kieler.klighd.krendering.KBackground; @@ -235,7 +235,7 @@ private static List getDefaultNonTextSelectionStyles() { return defaultNonTextSelectionStyles; } - defaultNonTextSelectionStyles = Lists.newArrayList(); + defaultNonTextSelectionStyles = new ArrayList<>(); final KColor c = KlighdConstants.DEFAULT_SELECTION_HIGHLIGHTING_BACKGROUND_COLOR; final KBackground bg = KRenderingFactory.eINSTANCE.createKBackground().setColor( @@ -258,7 +258,7 @@ private static List getDefaultTextSelectionStyles() { return defaultTextSelectionStyles; } - defaultTextSelectionStyles = Lists.newArrayList(); + defaultTextSelectionStyles = new ArrayList<>(); final KColor c = KlighdConstants.DEFAULT_SELECTION_HIGHLIGHTING_BACKGROUND_COLOR; final KBackground bg = KRenderingFactory.eINSTANCE.createKBackground().setColor( diff --git a/plugins/de.cau.cs.kieler.klighd.setup/.classpath b/plugins/de.cau.cs.kieler.klighd.setup/.classpath new file mode 100644 index 000000000..7931ec26b --- /dev/null +++ b/plugins/de.cau.cs.kieler.klighd.setup/.classpath @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/plugins/de.cau.cs.kieler.klighd.setup/.project b/plugins/de.cau.cs.kieler.klighd.setup/.project new file mode 100644 index 000000000..9ea7df629 --- /dev/null +++ b/plugins/de.cau.cs.kieler.klighd.setup/.project @@ -0,0 +1,40 @@ + + + de.cau.cs.kieler.klighd.setup + + + + + + org.eclipse.xtext.ui.shared.xtextBuilder + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.xtext.ui.shared.xtextNature + org.eclipse.jdt.core.javanature + org.eclipse.pde.PluginNature + org.eclipse.m2e.core.maven2Nature + + diff --git a/plugins/de.cau.cs.kieler.klighd.setup/.settings/org.eclipse.core.resources.prefs b/plugins/de.cau.cs.kieler.klighd.setup/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 000000000..99f26c020 --- /dev/null +++ b/plugins/de.cau.cs.kieler.klighd.setup/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/plugins/de.cau.cs.kieler.klighd.setup/.settings/org.eclipse.jdt.core.prefs b/plugins/de.cau.cs.kieler.klighd.setup/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 000000000..a978652d6 --- /dev/null +++ b/plugins/de.cau.cs.kieler.klighd.setup/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,315 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=11 +org.eclipse.jdt.core.compiler.compliance=11 +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=11 +org.eclipse.jdt.core.formatter.align_type_members_on_columns=false +org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 +org.eclipse.jdt.core.formatter.alignment_for_assignment=16 +org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator=16 +org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 +org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 +org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 +org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 +org.eclipse.jdt.core.formatter.alignment_for_logical_operator=16 +org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 +org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 +org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 +org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 +org.eclipse.jdt.core.formatter.alignment_for_string_concatenation=16 +org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 +org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 +org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_after_package=1 +org.eclipse.jdt.core.formatter.blank_lines_before_field=0 +org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 +org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 +org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 +org.eclipse.jdt.core.formatter.blank_lines_before_method=1 +org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 +org.eclipse.jdt.core.formatter.blank_lines_before_package=0 +org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 +org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 +org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line +org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false +org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false +org.eclipse.jdt.core.formatter.comment.format_block_comments=true +org.eclipse.jdt.core.formatter.comment.format_header=false +org.eclipse.jdt.core.formatter.comment.format_html=true +org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true +org.eclipse.jdt.core.formatter.comment.format_line_comments=true +org.eclipse.jdt.core.formatter.comment.format_source_code=true +org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true +org.eclipse.jdt.core.formatter.comment.indent_root_tags=true +org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert +org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert +org.eclipse.jdt.core.formatter.comment.line_length=100 +org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true +org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true +org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false +org.eclipse.jdt.core.formatter.compact_else_if=true +org.eclipse.jdt.core.formatter.continuation_indentation=2 +org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 +org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off +org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on +org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false +org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true +org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true +org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_empty_lines=false +org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true +org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true +org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false +org.eclipse.jdt.core.formatter.indentation.size=4 +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert +org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=insert +org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert +org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_after_additive_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_bitwise_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert +org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert +org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert +org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_after_logical_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_after_relational_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert +org.eclipse.jdt.core.formatter.insert_space_after_shift_operator=insert +org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation=insert +org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_additive_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert +org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_bitwise_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert +org.eclipse.jdt.core.formatter.insert_space_before_logical_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert +org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert +org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert +org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert +org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_relational_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert +org.eclipse.jdt.core.formatter.insert_space_before_shift_operator=insert +org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation=insert +org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert +org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert +org.eclipse.jdt.core.formatter.join_lines_in_comments=true +org.eclipse.jdt.core.formatter.join_wrapped_lines=true +org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false +org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false +org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false +org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false +org.eclipse.jdt.core.formatter.lineSplit=100 +org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false +org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false +org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 +org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 +org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true +org.eclipse.jdt.core.formatter.tabulation.char=space +org.eclipse.jdt.core.formatter.tabulation.size=4 +org.eclipse.jdt.core.formatter.use_on_off_tags=true +org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=true +org.eclipse.jdt.core.formatter.wrap_before_additive_operator=true +org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator=true +org.eclipse.jdt.core.formatter.wrap_before_logical_operator=true +org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator=true +org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true +org.eclipse.jdt.core.formatter.wrap_before_string_concatenation=true +org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true +org.eclipse.jdt.core.javaFormatter=org.eclipse.jdt.core.defaultJavaFormatter diff --git a/plugins/de.cau.cs.kieler.klighd.standalone/.settings/org.eclipse.jdt.ui.prefs b/plugins/de.cau.cs.kieler.klighd.setup/.settings/org.eclipse.jdt.ui.prefs similarity index 100% rename from plugins/de.cau.cs.kieler.klighd.standalone/.settings/org.eclipse.jdt.ui.prefs rename to plugins/de.cau.cs.kieler.klighd.setup/.settings/org.eclipse.jdt.ui.prefs diff --git a/plugins/de.cau.cs.kieler.klighd.setup/.settings/org.eclipse.xtend.core.Xtend.prefs b/plugins/de.cau.cs.kieler.klighd.setup/.settings/org.eclipse.xtend.core.Xtend.prefs new file mode 100644 index 000000000..2b65c6b65 --- /dev/null +++ b/plugins/de.cau.cs.kieler.klighd.setup/.settings/org.eclipse.xtend.core.Xtend.prefs @@ -0,0 +1,8 @@ +BuilderConfiguration.is_project_specific=true +eclipse.preferences.version=1 +outlet.DEFAULT_OUTPUT.hideLocalSyntheticVariables=true +outlet.DEFAULT_OUTPUT.installDslAsPrimarySource=false +outlet.DEFAULT_OUTPUT.sourceFolder.src-gen.directory=xtend-gen +outlet.DEFAULT_OUTPUT.sourceFolder.src.directory=xtend-gen +outlet.DEFAULT_OUTPUT.sourceFolder.xtend-gen.directory=xtend-gen +outlet.DEFAULT_OUTPUT.userOutputPerSourceFolder=true diff --git a/plugins/de.cau.cs.kieler.klighd.setup/META-INF/MANIFEST.MF b/plugins/de.cau.cs.kieler.klighd.setup/META-INF/MANIFEST.MF new file mode 100644 index 000000000..6474ca386 --- /dev/null +++ b/plugins/de.cau.cs.kieler.klighd.setup/META-INF/MANIFEST.MF @@ -0,0 +1,22 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: KIELER Lightweight Diagrams Setup +Bundle-SymbolicName: de.cau.cs.kieler.klighd.setup +Bundle-Version: 3.0.3.qualifier +Bundle-Vendor: KIELER Lightweight Diagrams (KLighD) +Bundle-RequiredExecutionEnvironment: JavaSE-11 +Require-Bundle: org.eclipse.emf.ecore.xmi, + org.eclipse.elk.core, + de.cau.cs.kieler.klighd, + de.cau.cs.kieler.klighd.kgraph, + de.cau.cs.kieler.klighd.krendering, + de.cau.cs.kieler.klighd.piccolo, + org.eclipse.elk.alg.common;resolution:=optional, + org.eclipse.elk.alg.force;resolution:=optional, + org.eclipse.elk.alg.graphviz.dot;resolution:=optional, + org.eclipse.elk.alg.graphviz.layouter;resolution:=optional, + org.eclipse.elk.alg.layered;resolution:=optional, + org.eclipse.elk.alg.mrtree;resolution:=optional, + org.eclipse.elk.alg.radial;resolution:=optional +Export-Package: de.cau.cs.kieler.klighd.setup +Automatic-Module-Name: de.cau.cs.kieler.klighd.setup diff --git a/plugins/de.cau.cs.kieler.klighd.setup/build.properties b/plugins/de.cau.cs.kieler.klighd.setup/build.properties new file mode 100644 index 000000000..19f676e24 --- /dev/null +++ b/plugins/de.cau.cs.kieler.klighd.setup/build.properties @@ -0,0 +1,4 @@ +source.. = src/ +bin.includes = META-INF/,\ + .,\ + resources/ diff --git a/plugins/de.cau.cs.kieler.klighd.setup/pom.xml b/plugins/de.cau.cs.kieler.klighd.setup/pom.xml new file mode 100644 index 000000000..3af43af7f --- /dev/null +++ b/plugins/de.cau.cs.kieler.klighd.setup/pom.xml @@ -0,0 +1,133 @@ + + + 4.0.0 + + de.cau.cs.kieler.klighd + parent + 3.0.3-SNAPSHOT + ../../pom.xml + + + de.cau.cs.kieler.klighd.setup + eclipse-plugin + + KIELER Lightweight Diagrams Standalone Setup + KIELER Lightweight Diagrams Standalone Setup + https://github.com/kieler/KLighD + + + + com.google.inject + guice + ${guice-version} + + + com.google.guava + guava + ${guava-version} + + + org.eclipse.elk + org.eclipse.elk.core.service + ${elk-version} + + + org.eclipse.elk + org.eclipse.elk.alg.force + ${elk-version} + compile + true + + + org.eclipse.elk + org.eclipse.elk.alg.graphviz.layouter + ${elk-version} + compile + true + + + org.eclipse.elk + org.eclipse.elk.alg.layered + ${elk-version} + compile + true + + + org.eclipse.elk + org.eclipse.elk.alg.mrtree + ${elk-version} + compile + true + + + org.eclipse.elk + org.eclipse.elk.alg.radial + ${elk-version} + compile + true + + + ${project.groupId} + de.cau.cs.kieler.klighd + ${project.version} + + + ${project.groupId} + de.cau.cs.kieler.klighd.kgraph + ${project.version} + + + ${project.groupId} + de.cau.cs.kieler.klighd.krendering + ${project.version} + + + ${project.groupId} + de.cau.cs.kieler.klighd.krendering.extensions + ${project.version} + + + + + + org.eclipse.elk + org.eclipse.elk.alg.force + ${elk-version} + + + org.eclipse.elk + org.eclipse.elk.alg.graphviz.dot + ${elk-version} + + + org.eclipse.elk + org.eclipse.elk.alg.graphviz.layouter + ${elk-version} + + + org.eclipse.elk + org.eclipse.elk.alg.layered + ${elk-version} + + + org.eclipse.elk + org.eclipse.elk.alg.mrtree + ${elk-version} + + + org.eclipse.elk + org.eclipse.elk.alg.radial + ${elk-version} + + + + + + + + resources + + + + diff --git a/plugins/de.cau.cs.kieler.klighd.standalone/resources/fonts/LICENSE_FONTS.txt b/plugins/de.cau.cs.kieler.klighd.setup/resources/fonts/LICENSE_FONTS.txt similarity index 100% rename from plugins/de.cau.cs.kieler.klighd.standalone/resources/fonts/LICENSE_FONTS.txt rename to plugins/de.cau.cs.kieler.klighd.setup/resources/fonts/LICENSE_FONTS.txt diff --git a/plugins/de.cau.cs.kieler.klighd.standalone/resources/fonts/overpass-mono-regular.otf b/plugins/de.cau.cs.kieler.klighd.setup/resources/fonts/overpass-mono-regular.otf similarity index 100% rename from plugins/de.cau.cs.kieler.klighd.standalone/resources/fonts/overpass-mono-regular.otf rename to plugins/de.cau.cs.kieler.klighd.setup/resources/fonts/overpass-mono-regular.otf diff --git a/plugins/de.cau.cs.kieler.klighd.standalone/resources/fonts/overpass-regular.otf b/plugins/de.cau.cs.kieler.klighd.setup/resources/fonts/overpass-regular.otf similarity index 100% rename from plugins/de.cau.cs.kieler.klighd.standalone/resources/fonts/overpass-regular.otf rename to plugins/de.cau.cs.kieler.klighd.setup/resources/fonts/overpass-regular.otf diff --git a/plugins/de.cau.cs.kieler.klighd.standalone/src/de/cau/cs/kieler/klighd/standalone/KlighdStandaloneSetup.java b/plugins/de.cau.cs.kieler.klighd.setup/src/de/cau/cs/kieler/klighd/setup/KlighdStandaloneSetup.java similarity index 97% rename from plugins/de.cau.cs.kieler.klighd.standalone/src/de/cau/cs/kieler/klighd/standalone/KlighdStandaloneSetup.java rename to plugins/de.cau.cs.kieler.klighd.setup/src/de/cau/cs/kieler/klighd/setup/KlighdStandaloneSetup.java index 00745a80c..892954033 100644 --- a/plugins/de.cau.cs.kieler.klighd.standalone/src/de/cau/cs/kieler/klighd/standalone/KlighdStandaloneSetup.java +++ b/plugins/de.cau.cs.kieler.klighd.setup/src/de/cau/cs/kieler/klighd/setup/KlighdStandaloneSetup.java @@ -3,7 +3,7 @@ * * https://github.com/Kieler/KLighD * - * Copyright 2020-2022 by TypeFox GmbH (typefox.io) and others. + * Copyright 2020-2024 by TypeFox GmbH (typefox.io) and others. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -11,7 +11,7 @@ * * SPDX-License-Identifier: EPL-2.0 */ -package de.cau.cs.kieler.klighd.standalone; +package de.cau.cs.kieler.klighd.setup; import java.awt.Font; import java.awt.GraphicsEnvironment; diff --git a/plugins/de.cau.cs.kieler.klighd.standalone/.classpath b/plugins/de.cau.cs.kieler.klighd.standalone/.classpath index cf36b5611..f7573c1b3 100644 --- a/plugins/de.cau.cs.kieler.klighd.standalone/.classpath +++ b/plugins/de.cau.cs.kieler.klighd.standalone/.classpath @@ -1,7 +1,15 @@ - + + + + + - + + + + + diff --git a/plugins/de.cau.cs.kieler.klighd.standalone/.settings/org.eclipse.jdt.core.prefs b/plugins/de.cau.cs.kieler.klighd.standalone/.settings/org.eclipse.jdt.core.prefs index 5dddc113e..052ee6edb 100644 --- a/plugins/de.cau.cs.kieler.klighd.standalone/.settings/org.eclipse.jdt.core.prefs +++ b/plugins/de.cau.cs.kieler.klighd.standalone/.settings/org.eclipse.jdt.core.prefs @@ -1,313 +1,10 @@ eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 -org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=11 +org.eclipse.jdt.core.compiler.compliance=11 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.release=disabled -org.eclipse.jdt.core.compiler.source=1.8 -org.eclipse.jdt.core.formatter.align_type_members_on_columns=false -org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16 -org.eclipse.jdt.core.formatter.alignment_for_assignment=16 -org.eclipse.jdt.core.formatter.alignment_for_bitwise_operator=16 -org.eclipse.jdt.core.formatter.alignment_for_compact_if=16 -org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80 -org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0 -org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16 -org.eclipse.jdt.core.formatter.alignment_for_logical_operator=16 -org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0 -org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16 -org.eclipse.jdt.core.formatter.alignment_for_multiplicative_operator=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80 -org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=16 -org.eclipse.jdt.core.formatter.alignment_for_string_concatenation=16 -org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 -org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16 -org.eclipse.jdt.core.formatter.blank_lines_after_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_after_package=1 -org.eclipse.jdt.core.formatter.blank_lines_before_field=0 -org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0 -org.eclipse.jdt.core.formatter.blank_lines_before_imports=1 -org.eclipse.jdt.core.formatter.blank_lines_before_member_type=1 -org.eclipse.jdt.core.formatter.blank_lines_before_method=1 -org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=1 -org.eclipse.jdt.core.formatter.blank_lines_before_package=0 -org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1 -org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1 -org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_lambda_body=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line -org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false -org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false -org.eclipse.jdt.core.formatter.comment.format_block_comments=true -org.eclipse.jdt.core.formatter.comment.format_header=false -org.eclipse.jdt.core.formatter.comment.format_html=true -org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true -org.eclipse.jdt.core.formatter.comment.format_line_comments=true -org.eclipse.jdt.core.formatter.comment.format_source_code=true -org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true -org.eclipse.jdt.core.formatter.comment.indent_root_tags=true -org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert -org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert -org.eclipse.jdt.core.formatter.comment.line_length=100 -org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true -org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true -org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false -org.eclipse.jdt.core.formatter.compact_else_if=true -org.eclipse.jdt.core.formatter.continuation_indentation=2 -org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2 -org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off -org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on -org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false -org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true -org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true -org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_empty_lines=false -org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true -org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true -org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false -org.eclipse.jdt.core.formatter.indentation.size=4 -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert -org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=insert -org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert -org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_after_additive_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_bitwise_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert -org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert -org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert -org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_after_logical_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_multiplicative_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_after_relational_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert -org.eclipse.jdt.core.formatter.insert_space_after_shift_operator=insert -org.eclipse.jdt.core.formatter.insert_space_after_string_concatenation=insert -org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_additive_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert -org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_bitwise_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow=insert -org.eclipse.jdt.core.formatter.insert_space_before_logical_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_multiplicative_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert -org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert -org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert -org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert -org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_relational_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert -org.eclipse.jdt.core.formatter.insert_space_before_shift_operator=insert -org.eclipse.jdt.core.formatter.insert_space_before_string_concatenation=insert -org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert -org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert -org.eclipse.jdt.core.formatter.join_lines_in_comments=true -org.eclipse.jdt.core.formatter.join_wrapped_lines=true -org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false -org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false -org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false -org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false -org.eclipse.jdt.core.formatter.lineSplit=100 -org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false -org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false -org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0 -org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1 -org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true -org.eclipse.jdt.core.formatter.tabulation.char=space -org.eclipse.jdt.core.formatter.tabulation.size=4 -org.eclipse.jdt.core.formatter.use_on_off_tags=true -org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=true -org.eclipse.jdt.core.formatter.wrap_before_additive_operator=true -org.eclipse.jdt.core.formatter.wrap_before_bitwise_operator=true -org.eclipse.jdt.core.formatter.wrap_before_logical_operator=true -org.eclipse.jdt.core.formatter.wrap_before_multiplicative_operator=true -org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true -org.eclipse.jdt.core.formatter.wrap_before_string_concatenation=true -org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true -org.eclipse.jdt.core.javaFormatter=org.eclipse.jdt.core.defaultJavaFormatter +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/plugins/de.cau.cs.kieler.klighd.standalone/.settings/org.eclipse.xtend.core.Xtend.prefs b/plugins/de.cau.cs.kieler.klighd.standalone/.settings/org.eclipse.xtend.core.Xtend.prefs index 56e3bbe88..2b65c6b65 100644 --- a/plugins/de.cau.cs.kieler.klighd.standalone/.settings/org.eclipse.xtend.core.Xtend.prefs +++ b/plugins/de.cau.cs.kieler.klighd.standalone/.settings/org.eclipse.xtend.core.Xtend.prefs @@ -2,5 +2,7 @@ BuilderConfiguration.is_project_specific=true eclipse.preferences.version=1 outlet.DEFAULT_OUTPUT.hideLocalSyntheticVariables=true outlet.DEFAULT_OUTPUT.installDslAsPrimarySource=false +outlet.DEFAULT_OUTPUT.sourceFolder.src-gen.directory=xtend-gen outlet.DEFAULT_OUTPUT.sourceFolder.src.directory=xtend-gen +outlet.DEFAULT_OUTPUT.sourceFolder.xtend-gen.directory=xtend-gen outlet.DEFAULT_OUTPUT.userOutputPerSourceFolder=true diff --git a/plugins/de.cau.cs.kieler.klighd.standalone/META-INF/MANIFEST.MF b/plugins/de.cau.cs.kieler.klighd.standalone/META-INF/MANIFEST.MF index f3822bf83..d5f40f680 100644 --- a/plugins/de.cau.cs.kieler.klighd.standalone/META-INF/MANIFEST.MF +++ b/plugins/de.cau.cs.kieler.klighd.standalone/META-INF/MANIFEST.MF @@ -1,22 +1,10 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 -Bundle-Name: KIELER Lightweight Diagrams Standalone Setup +Bundle-Name: KIELER Lightweight Diagrams Standalone Bundle-SymbolicName: de.cau.cs.kieler.klighd.standalone -Bundle-Version: 2.3.1.qualifier +Bundle-Version: 3.0.3.qualifier Bundle-Vendor: KIELER Lightweight Diagrams (KLighD) -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 -Require-Bundle: org.eclipse.emf.ecore.xmi, - org.eclipse.elk.core, - de.cau.cs.kieler.klighd, - de.cau.cs.kieler.klighd.kgraph, - de.cau.cs.kieler.klighd.krendering, - de.cau.cs.kieler.klighd.piccolo, - org.eclipse.elk.alg.common;resolution:=optional, - org.eclipse.elk.alg.force;resolution:=optional, - org.eclipse.elk.alg.graphviz.dot;resolution:=optional, - org.eclipse.elk.alg.graphviz.layouter;resolution:=optional, - org.eclipse.elk.alg.layered;resolution:=optional, - org.eclipse.elk.alg.mrtree;resolution:=optional, - org.eclipse.elk.alg.radial;resolution:=optional -Export-Package: de.cau.cs.kieler.klighd.standalone +Bundle-RequiredExecutionEnvironment: JavaSE-11 +Require-Bundle: de.cau.cs.kieler.klighd.setup, + de.cau.cs.kieler.klighd.piccolo Automatic-Module-Name: de.cau.cs.kieler.klighd.standalone diff --git a/plugins/de.cau.cs.kieler.klighd.standalone/build.properties b/plugins/de.cau.cs.kieler.klighd.standalone/build.properties index 19f676e24..7594fab8d 100644 --- a/plugins/de.cau.cs.kieler.klighd.standalone/build.properties +++ b/plugins/de.cau.cs.kieler.klighd.standalone/build.properties @@ -1,4 +1,2 @@ -source.. = src/ bin.includes = META-INF/,\ - .,\ - resources/ + . diff --git a/plugins/de.cau.cs.kieler.klighd.standalone/pom.xml b/plugins/de.cau.cs.kieler.klighd.standalone/pom.xml index 9b5d953c2..9d75a50ef 100644 --- a/plugins/de.cau.cs.kieler.klighd.standalone/pom.xml +++ b/plugins/de.cau.cs.kieler.klighd.standalone/pom.xml @@ -5,131 +5,32 @@ de.cau.cs.kieler.klighd parent - 2.3.1-SNAPSHOT + 3.0.3-SNAPSHOT ../../pom.xml - de.cau.cs.kieler.klighd de.cau.cs.kieler.klighd.standalone - 2.3.1-SNAPSHOT eclipse-plugin - KIELER Lightweight Diagrams Standalone Setup - KIELER Lightweight Diagrams Standalone Setup + KIELER Lightweight Diagrams Standalone + KIELER Lightweight Diagrams Standalone https://github.com/kieler/KLighD - - com.google.inject - guice - ${guice-version} - - - com.google.guava - guava - ${guava-version} - - - org.eclipse.elk - org.eclipse.elk.core.service - ${elk-version} - - - org.eclipse.elk - org.eclipse.elk.alg.force - ${elk-version} - compile - true - - - org.eclipse.elk - org.eclipse.elk.alg.graphviz.layouter - ${elk-version} - compile - true - - - org.eclipse.elk - org.eclipse.elk.alg.layered - ${elk-version} - compile - true - - - org.eclipse.elk - org.eclipse.elk.alg.mrtree - ${elk-version} - compile - true - - - org.eclipse.elk - org.eclipse.elk.alg.radial - ${elk-version} - compile - true - ${project.groupId} - de.cau.cs.kieler.klighd + de.cau.cs.kieler.klighd.setup ${project.version} ${project.groupId} - de.cau.cs.kieler.klighd.kgraph + de.cau.cs.kieler.klighd.piccolo ${project.version} ${project.groupId} - de.cau.cs.kieler.klighd.krendering - ${project.version} - - - ${project.groupId} - de.cau.cs.kieler.klighd.krendering.extensions + de.cau.cs.kieler.klighd.piccolo.freehep ${project.version} - - - - org.eclipse.elk - org.eclipse.elk.alg.force - ${elk-version} - - - org.eclipse.elk - org.eclipse.elk.alg.graphviz.dot - ${elk-version} - - - org.eclipse.elk - org.eclipse.elk.alg.graphviz.layouter - ${elk-version} - - - org.eclipse.elk - org.eclipse.elk.alg.layered - ${elk-version} - - - org.eclipse.elk - org.eclipse.elk.alg.mrtree - ${elk-version} - - - org.eclipse.elk - org.eclipse.elk.alg.radial - ${elk-version} - - - - - - - - resources - - - diff --git a/plugins/de.cau.cs.kieler.klighd.ui.contrib3x/.classpath b/plugins/de.cau.cs.kieler.klighd.ui.contrib3x/.classpath index dc7ce67ee..19ef143f2 100644 --- a/plugins/de.cau.cs.kieler.klighd.ui.contrib3x/.classpath +++ b/plugins/de.cau.cs.kieler.klighd.ui.contrib3x/.classpath @@ -1,5 +1,5 @@ - + diff --git a/plugins/de.cau.cs.kieler.klighd.ui.contrib3x/.settings/org.eclipse.core.resources.prefs b/plugins/de.cau.cs.kieler.klighd.ui.contrib3x/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 000000000..99f26c020 --- /dev/null +++ b/plugins/de.cau.cs.kieler.klighd.ui.contrib3x/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/plugins/de.cau.cs.kieler.klighd.ui.contrib3x/META-INF/MANIFEST.MF b/plugins/de.cau.cs.kieler.klighd.ui.contrib3x/META-INF/MANIFEST.MF index f48b7252a..a65b824cf 100644 --- a/plugins/de.cau.cs.kieler.klighd.ui.contrib3x/META-INF/MANIFEST.MF +++ b/plugins/de.cau.cs.kieler.klighd.ui.contrib3x/META-INF/MANIFEST.MF @@ -2,9 +2,9 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: KLighD-specific Eclipse 3x UI contributions Bundle-SymbolicName: de.cau.cs.kieler.klighd.ui.contrib3x;singleton:=true -Bundle-Version: 2.3.1.qualifier +Bundle-Version: 3.0.3.qualifier Bundle-Vendor: Kiel University -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Bundle-RequiredExecutionEnvironment: JavaSE-11 Require-Bundle: org.eclipse.ui;bundle-version="3.105.0", de.cau.cs.kieler.klighd.ui;bundle-version="0.5.0" Automatic-Module-Name: de.cau.cs.kieler.klighd.ui.contrib3x diff --git a/plugins/de.cau.cs.kieler.klighd.ui.contrib3x/pom.xml b/plugins/de.cau.cs.kieler.klighd.ui.contrib3x/pom.xml index e8a710641..3aeb5fe65 100644 --- a/plugins/de.cau.cs.kieler.klighd.ui.contrib3x/pom.xml +++ b/plugins/de.cau.cs.kieler.klighd.ui.contrib3x/pom.xml @@ -5,13 +5,11 @@ de.cau.cs.kieler.klighd parent - 2.3.1-SNAPSHOT + 3.0.3-SNAPSHOT ../../pom.xml - de.cau.cs.kieler.klighd de.cau.cs.kieler.klighd.ui.contrib3x - 2.3.1-SNAPSHOT eclipse-plugin KLighD-specific Eclipse 3x UI contributions diff --git a/plugins/de.cau.cs.kieler.klighd.ui.emf/.classpath b/plugins/de.cau.cs.kieler.klighd.ui.emf/.classpath index eca7bdba8..e801ebfb4 100644 --- a/plugins/de.cau.cs.kieler.klighd.ui.emf/.classpath +++ b/plugins/de.cau.cs.kieler.klighd.ui.emf/.classpath @@ -1,6 +1,6 @@ - + diff --git a/plugins/de.cau.cs.kieler.klighd.ui.emf/.settings/org.eclipse.core.resources.prefs b/plugins/de.cau.cs.kieler.klighd.ui.emf/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 000000000..99f26c020 --- /dev/null +++ b/plugins/de.cau.cs.kieler.klighd.ui.emf/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/plugins/de.cau.cs.kieler.klighd.ui.emf/META-INF/MANIFEST.MF b/plugins/de.cau.cs.kieler.klighd.ui.emf/META-INF/MANIFEST.MF index 380259f9c..07be9b4d5 100644 --- a/plugins/de.cau.cs.kieler.klighd.ui.emf/META-INF/MANIFEST.MF +++ b/plugins/de.cau.cs.kieler.klighd.ui.emf/META-INF/MANIFEST.MF @@ -2,9 +2,9 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: KLighD Model Modification Extensions for EMF Domains Bundle-SymbolicName: de.cau.cs.kieler.klighd.ui.emf;singleton:=true -Bundle-Version: 2.3.1.qualifier +Bundle-Version: 3.0.3.qualifier Fragment-Host: de.cau.cs.kieler.klighd.ui -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Bundle-RequiredExecutionEnvironment: JavaSE-11 Require-Bundle: org.eclipse.emf.transaction, org.eclipse.emf.workspace Bundle-Vendor: Kiel University diff --git a/plugins/de.cau.cs.kieler.klighd.ui.emf/pom.xml b/plugins/de.cau.cs.kieler.klighd.ui.emf/pom.xml index cf5e4012e..b069eeafe 100644 --- a/plugins/de.cau.cs.kieler.klighd.ui.emf/pom.xml +++ b/plugins/de.cau.cs.kieler.klighd.ui.emf/pom.xml @@ -5,13 +5,11 @@ de.cau.cs.kieler.klighd parent - 2.3.1-SNAPSHOT + 3.0.3-SNAPSHOT ../../pom.xml - de.cau.cs.kieler.klighd de.cau.cs.kieler.klighd.ui.emf - 2.3.1-SNAPSHOT eclipse-plugin KLighD Model Modification Extensions for EMF Domains diff --git a/plugins/de.cau.cs.kieler.klighd.ui.view/.classpath b/plugins/de.cau.cs.kieler.klighd.ui.view/.classpath index eca7bdba8..e801ebfb4 100644 --- a/plugins/de.cau.cs.kieler.klighd.ui.view/.classpath +++ b/plugins/de.cau.cs.kieler.klighd.ui.view/.classpath @@ -1,6 +1,6 @@ - + diff --git a/plugins/de.cau.cs.kieler.klighd.ui.view/.settings/org.eclipse.core.resources.prefs b/plugins/de.cau.cs.kieler.klighd.ui.view/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 000000000..99f26c020 --- /dev/null +++ b/plugins/de.cau.cs.kieler.klighd.ui.view/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/plugins/de.cau.cs.kieler.klighd.ui.view/META-INF/MANIFEST.MF b/plugins/de.cau.cs.kieler.klighd.ui.view/META-INF/MANIFEST.MF index fceca165a..642f410a8 100644 --- a/plugins/de.cau.cs.kieler.klighd.ui.view/META-INF/MANIFEST.MF +++ b/plugins/de.cau.cs.kieler.klighd.ui.view/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: KIELER Diagram View Bundle-SymbolicName: de.cau.cs.kieler.klighd.ui.view;singleton:=true -Bundle-Version: 2.3.1.qualifier +Bundle-Version: 3.0.3.qualifier Automatic-Module-Name: de.cau.cs.kieler.klighd.ui.view Bundle-Activator: de.cau.cs.kieler.klighd.ui.view.KlighdViewPlugin Require-Bundle: org.eclipse.emf, @@ -15,7 +15,7 @@ Require-Bundle: org.eclipse.emf, org.eclipse.elk.alg.layered, de.cau.cs.kieler.klighd.kgraph, de.cau.cs.kieler.klighd.ide -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Bundle-RequiredExecutionEnvironment: JavaSE-11 Bundle-ActivationPolicy: lazy Bundle-Vendor: Kiel University Export-Package: de.cau.cs.kieler.klighd.ui.view, diff --git a/plugins/de.cau.cs.kieler.klighd.ui.view/pom.xml b/plugins/de.cau.cs.kieler.klighd.ui.view/pom.xml index 5fb6d6705..0cd20ab0a 100644 --- a/plugins/de.cau.cs.kieler.klighd.ui.view/pom.xml +++ b/plugins/de.cau.cs.kieler.klighd.ui.view/pom.xml @@ -5,13 +5,11 @@ de.cau.cs.kieler.klighd parent - 2.3.1-SNAPSHOT + 3.0.3-SNAPSHOT ../../pom.xml - de.cau.cs.kieler.klighd de.cau.cs.kieler.klighd.ui.view - 2.3.1-SNAPSHOT eclipse-plugin KIELER Diagram View diff --git a/plugins/de.cau.cs.kieler.klighd.ui.view/src/de/cau/cs/kieler/klighd/ui/view/DiagramView.java b/plugins/de.cau.cs.kieler.klighd.ui.view/src/de/cau/cs/kieler/klighd/ui/view/DiagramView.java index 3e62ef77c..fa0441f65 100644 --- a/plugins/de.cau.cs.kieler.klighd.ui.view/src/de/cau/cs/kieler/klighd/ui/view/DiagramView.java +++ b/plugins/de.cau.cs.kieler.klighd.ui.view/src/de/cau/cs/kieler/klighd/ui/view/DiagramView.java @@ -26,7 +26,6 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; - import org.eclipse.core.runtime.IAdaptable; import org.eclipse.core.runtime.IProgressMonitor; import org.eclipse.core.runtime.IStatus; @@ -69,9 +68,6 @@ import com.google.common.base.Predicate; import com.google.common.collect.Iterables; import com.google.common.collect.Lists; -import com.google.common.collect.Maps; -import com.google.common.collect.Sets; - import de.cau.cs.kieler.klighd.Klighd; import de.cau.cs.kieler.klighd.KlighdDataManager; import de.cau.cs.kieler.klighd.LightDiagramLayoutConfig; @@ -148,10 +144,10 @@ public final class DiagramView extends DiagramViewPart implements ISelectionChan /** Stores used synthesis options. */ private final Map recentSynthesisOptions = - Collections.synchronizedMap(Maps.newHashMap()); + Collections.synchronizedMap(new HashMap<>()); /** Stores displayed syntheses. */ - private final Set usedSyntheses = Collections.synchronizedSet(Sets.newHashSet()); + private final Set usedSyntheses = Collections.synchronizedSet(new HashSet<>()); /** The responsible controller performing model updates. */ private AbstractViewUpdateController controller = null; @@ -220,7 +216,7 @@ public boolean apply(final DiagramView view) { * @return List of all {@link DiagramView}s */ public static List getAllDiagramViews() { - return Lists.newArrayList(views); + return new ArrayList<>(views); } // -- Constructor and Initialization diff --git a/plugins/de.cau.cs.kieler.klighd.ui.view/src/de/cau/cs/kieler/klighd/ui/view/controller/ViewUpdateControllerFactory.java b/plugins/de.cau.cs.kieler.klighd.ui.view/src/de/cau/cs/kieler/klighd/ui/view/controller/ViewUpdateControllerFactory.java index 40f4052ad..1369966fe 100644 --- a/plugins/de.cau.cs.kieler.klighd.ui.view/src/de/cau/cs/kieler/klighd/ui/view/controller/ViewUpdateControllerFactory.java +++ b/plugins/de.cau.cs.kieler.klighd.ui.view/src/de/cau/cs/kieler/klighd/ui/view/controller/ViewUpdateControllerFactory.java @@ -16,11 +16,11 @@ */ package de.cau.cs.kieler.klighd.ui.view.controller; -import java.util.Collections; import java.util.Comparator; import java.util.HashMap; -import java.util.List; import java.util.Map; +import java.util.Optional; +import java.util.Set; import org.eclipse.core.runtime.IConfigurationElement; import org.eclipse.core.runtime.IStatus; @@ -30,7 +30,6 @@ import com.google.common.base.Predicate; import com.google.common.collect.Iterables; -import com.google.common.collect.Lists; import de.cau.cs.kieler.klighd.Klighd; import de.cau.cs.kieler.klighd.ui.view.DiagramView; @@ -358,18 +357,15 @@ public boolean apply(final Class supportedEditorClass) { */ private static String getFallbackController(final IEditorPart editor) { final Class editorClass = editor.getClass(); - List> validControllers = - Lists.newArrayList(Iterables.filter( - ViewUpdateControllerFactory.getInstance().fallbackControllerMapping.keySet(), - new Predicate>() { - public boolean apply(final Class supportedEditorClass) { - return supportedEditorClass.isAssignableFrom(editorClass); - } - })); - if (!validControllers.isEmpty()) { - Collections.sort(validControllers, TYPE_SORTER); - // Return most specific controller - return ViewUpdateControllerFactory.getInstance().fallbackControllerMapping.get(validControllers.get(0)); + Set> allClasses = + ViewUpdateControllerFactory.getInstance().fallbackControllerMapping.keySet(); + Optional> firstValidController = allClasses.stream() + .filter(supportedEditorClass -> supportedEditorClass.isAssignableFrom(editorClass)) + .min(TYPE_SORTER); + if (firstValidController.isPresent()) { + // Return most specific controller + return ViewUpdateControllerFactory.getInstance().fallbackControllerMapping + .get(firstValidController.get()); } else { return null; } diff --git a/plugins/de.cau.cs.kieler.klighd.ui.wizard/.classpath b/plugins/de.cau.cs.kieler.klighd.ui.wizard/.classpath index 428337e56..47ce7cd07 100644 --- a/plugins/de.cau.cs.kieler.klighd.ui.wizard/.classpath +++ b/plugins/de.cau.cs.kieler.klighd.ui.wizard/.classpath @@ -1,6 +1,6 @@ - + diff --git a/plugins/de.cau.cs.kieler.klighd.ui.wizard/.settings/org.eclipse.core.resources.prefs b/plugins/de.cau.cs.kieler.klighd.ui.wizard/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 000000000..99f26c020 --- /dev/null +++ b/plugins/de.cau.cs.kieler.klighd.ui.wizard/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/plugins/de.cau.cs.kieler.klighd.ui.wizard/META-INF/MANIFEST.MF b/plugins/de.cau.cs.kieler.klighd.ui.wizard/META-INF/MANIFEST.MF index 45a32a9ab..4a1524fb0 100644 --- a/plugins/de.cau.cs.kieler.klighd.ui.wizard/META-INF/MANIFEST.MF +++ b/plugins/de.cau.cs.kieler.klighd.ui.wizard/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: KIELER Plug-In Wizard for KLighD-Based Projects Bundle-SymbolicName: de.cau.cs.kieler.klighd.ui.wizard;singleton:=true -Bundle-Version: 2.3.1.qualifier +Bundle-Version: 3.0.3.qualifier Bundle-Activator: de.cau.cs.kieler.klighd.ui.wizard.KlighdWizardPlugin Require-Bundle: org.apache.log4j, org.eclipse.core.expressions, @@ -19,7 +19,7 @@ Require-Bundle: org.apache.log4j, org.eclipse.xtext.xbase.lib, org.eclipse.xtext.ui, org.eclipse.xtext.ui.shared -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Bundle-RequiredExecutionEnvironment: JavaSE-11 Bundle-ActivationPolicy: lazy Bundle-Vendor: Kiel University Automatic-Module-Name: de.cau.cs.kieler.klighd.ui.wizard diff --git a/plugins/de.cau.cs.kieler.klighd.ui.wizard/build.properties b/plugins/de.cau.cs.kieler.klighd.ui.wizard/build.properties index f07c6a911..f9b252e9c 100644 --- a/plugins/de.cau.cs.kieler.klighd.ui.wizard/build.properties +++ b/plugins/de.cau.cs.kieler.klighd.ui.wizard/build.properties @@ -7,3 +7,5 @@ bin.includes = META-INF/,\ plugin.xml,\ about.html src.includes = about.html +bin.excludes = **/*.xtend,\ + **/*.java._trace diff --git a/plugins/de.cau.cs.kieler.klighd.ui.wizard/pom.xml b/plugins/de.cau.cs.kieler.klighd.ui.wizard/pom.xml index 74fab9893..24f7f7a4e 100644 --- a/plugins/de.cau.cs.kieler.klighd.ui.wizard/pom.xml +++ b/plugins/de.cau.cs.kieler.klighd.ui.wizard/pom.xml @@ -5,13 +5,11 @@ de.cau.cs.kieler.klighd parent - 2.3.1-SNAPSHOT + 3.0.3-SNAPSHOT ../../pom.xml - de.cau.cs.kieler.klighd de.cau.cs.kieler.klighd.ui.wizard - 2.3.1-SNAPSHOT eclipse-plugin KIELER Plug-In Wizard for KLighD-Based Projects diff --git a/plugins/de.cau.cs.kieler.klighd.ui.wizard/src/de/cau/cs/kieler/klighd/ui/wizard/KlighdProjectContributor.xtend b/plugins/de.cau.cs.kieler.klighd.ui.wizard/src/de/cau/cs/kieler/klighd/ui/wizard/KlighdProjectContributor.xtend index c1a37ba46..3c3db23b0 100644 --- a/plugins/de.cau.cs.kieler.klighd.ui.wizard/src/de/cau/cs/kieler/klighd/ui/wizard/KlighdProjectContributor.xtend +++ b/plugins/de.cau.cs.kieler.klighd.ui.wizard/src/de/cau/cs/kieler/klighd/ui/wizard/KlighdProjectContributor.xtend @@ -64,7 +64,8 @@ class KlighdProjectContributor implements IProjectFactoryContributor { case "JavaSE-1.6": "1.6" case "JavaSE-1.7": "1.7" case "JavaSE-1.8": "1.8" - default: "1.8" + case "JavaSE-11" : "11" + default: "11" } ''' @@ -88,7 +89,7 @@ class KlighdProjectContributor implements IProjectFactoryContributor { ''' package «projectInfo.transformationPackage» - import javax.inject.Inject + import com.google.inject.Inject import de.cau.cs.kieler.klighd.kgraph.KNode import de.cau.cs.kieler.klighd.krendering.KRenderingFactory @@ -455,7 +456,7 @@ class KlighdProjectContributor implements IProjectFactoryContributor { }; } - private static final Map selectionListeners = Maps.newHashMap(); + private static final Map selectionListeners = new HashMap<>(); /** diff --git a/plugins/de.cau.cs.kieler.klighd.ui.wizard/src/de/cau/cs/kieler/klighd/ui/wizard/KlighdProjectCreator.java b/plugins/de.cau.cs.kieler.klighd.ui.wizard/src/de/cau/cs/kieler/klighd/ui/wizard/KlighdProjectCreator.java index b2d003168..7937a1b37 100644 --- a/plugins/de.cau.cs.kieler.klighd.ui.wizard/src/de/cau/cs/kieler/klighd/ui/wizard/KlighdProjectCreator.java +++ b/plugins/de.cau.cs.kieler.klighd.ui.wizard/src/de/cau/cs/kieler/klighd/ui/wizard/KlighdProjectCreator.java @@ -17,6 +17,7 @@ package de.cau.cs.kieler.klighd.ui.wizard; import java.lang.reflect.InvocationTargetException; +import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -39,7 +40,6 @@ import com.google.common.base.Predicate; import com.google.common.collect.Iterables; -import com.google.common.collect.Lists; import com.google.inject.Inject; import com.google.inject.Provider; @@ -191,7 +191,7 @@ protected ProjectFactory createAndConfigureProjectFactory() { ppf.addProjectNatures(getProjectNatures()); ppf.addBuilderIds(getBuilders()); if (info.isCreateXtendFile()) { - ppf.addFolders(Lists.newArrayList("xtend-gen")); + ppf.addFolders(List.of("xtend-gen")); } ppf.setBreeToUse(info.getExecutionEnvironment()); @@ -253,9 +253,9 @@ protected List getImportedPackages() { info.getSourceModelClassFullyQualified().substring(0, info.getSourceModelClassFullyQualified().lastIndexOf('.')); if (packageString.startsWith("java.")) { - return Lists.newArrayList(); + return new ArrayList<>(); } else { - return Lists.newArrayList(packageString); + return List.of(packageString); } } @@ -294,7 +294,7 @@ protected List getRequiredBundles() { * @return the folders being created within the project */ protected List getAllFolders() { - return Lists.newArrayList(KlighdWizardSetup.SRC_FOLDER); + return List.of(KlighdWizardSetup.SRC_FOLDER); } /** diff --git a/plugins/de.cau.cs.kieler.klighd.ui/.classpath b/plugins/de.cau.cs.kieler.klighd.ui/.classpath index eca7bdba8..e801ebfb4 100644 --- a/plugins/de.cau.cs.kieler.klighd.ui/.classpath +++ b/plugins/de.cau.cs.kieler.klighd.ui/.classpath @@ -1,6 +1,6 @@ - + diff --git a/plugins/de.cau.cs.kieler.klighd.ui/.settings/org.eclipse.core.resources.prefs b/plugins/de.cau.cs.kieler.klighd.ui/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 000000000..99f26c020 --- /dev/null +++ b/plugins/de.cau.cs.kieler.klighd.ui/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/plugins/de.cau.cs.kieler.klighd.ui/META-INF/MANIFEST.MF b/plugins/de.cau.cs.kieler.klighd.ui/META-INF/MANIFEST.MF index 36762da7f..cf74763d2 100644 --- a/plugins/de.cau.cs.kieler.klighd.ui/META-INF/MANIFEST.MF +++ b/plugins/de.cau.cs.kieler.klighd.ui/META-INF/MANIFEST.MF @@ -2,11 +2,13 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: KIELER Lightweight Diagrams UI Components Bundle-SymbolicName: de.cau.cs.kieler.klighd.ui;singleton:=true -Bundle-Version: 2.3.1.qualifier +Bundle-Version: 3.0.3.qualifier Bundle-Activator: de.cau.cs.kieler.klighd.ui.KlighdUIPlugin Require-Bundle: org.eclipse.core.expressions;bundle-version="3.4.400", org.eclipse.core.resources;bundle-version="3.8.0", org.eclipse.emf.edit;bundle-version="2.9.0", + org.eclipse.elk.core, + org.eclipse.elk.core.service, org.eclipse.jface.text;bundle-version="3.8.100";visibility:=reexport, org.eclipse.ui;bundle-version="3.103.0", org.eclipse.ui.forms;bundle-version="3.5.200", @@ -18,10 +20,10 @@ Require-Bundle: org.eclipse.core.expressions;bundle-version="3.4.400", org.eclipse.core.databinding;bundle-version="1.4.1", org.eclipse.core.databinding.beans;bundle-version="1.2.200", org.eclipse.jface.databinding;bundle-version="1.6.200", - org.eclipse.elk.core.service;bundle-version="0.1.0", - org.eclipse.core.databinding.property;bundle-version="1.8.0" + org.eclipse.core.databinding.property;bundle-version="1.8.0", + com.google.inject Bundle-ActivationPolicy: lazy -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Bundle-RequiredExecutionEnvironment: JavaSE-11 Bundle-Vendor: Kiel University Export-Package: de.cau.cs.kieler.klighd.ui, de.cau.cs.kieler.klighd.ui.internal;x-friends:="de.cau.cs.kieler.klighd.ui.contrib3x", diff --git a/plugins/de.cau.cs.kieler.klighd.ui/pom.xml b/plugins/de.cau.cs.kieler.klighd.ui/pom.xml index 5de1dd2d4..198b185cf 100644 --- a/plugins/de.cau.cs.kieler.klighd.ui/pom.xml +++ b/plugins/de.cau.cs.kieler.klighd.ui/pom.xml @@ -5,13 +5,11 @@ de.cau.cs.kieler.klighd parent - 2.3.1-SNAPSHOT + 3.0.3-SNAPSHOT ../../pom.xml - de.cau.cs.kieler.klighd de.cau.cs.kieler.klighd.ui - 2.3.1-SNAPSHOT eclipse-plugin KIELER Lightweight Diagrams UI Components diff --git a/plugins/de.cau.cs.kieler.klighd.ui/src/de/cau/cs/kieler/klighd/ui/DiagramViewManager.java b/plugins/de.cau.cs.kieler.klighd.ui/src/de/cau/cs/kieler/klighd/ui/DiagramViewManager.java index d68fec7d4..ddafb730f 100644 --- a/plugins/de.cau.cs.kieler.klighd.ui/src/de/cau/cs/kieler/klighd/ui/DiagramViewManager.java +++ b/plugins/de.cau.cs.kieler.klighd.ui/src/de/cau/cs/kieler/klighd/ui/DiagramViewManager.java @@ -16,6 +16,7 @@ */ package de.cau.cs.kieler.klighd.ui; +import java.util.HashMap; import java.util.Map; import org.eclipse.core.runtime.IStatus; @@ -30,8 +31,6 @@ import org.eclipse.ui.PartInitException; import org.eclipse.ui.PlatformUI; -import com.google.common.collect.Maps; - import de.cau.cs.kieler.klighd.IDiagramWorkbenchPart; import de.cau.cs.kieler.klighd.Klighd; import de.cau.cs.kieler.klighd.LightDiagramLayoutConfig; @@ -58,10 +57,10 @@ public final class DiagramViewManager implements IPartListener { private boolean registered = false; /** the mapping of diagram view identifiers on workbench parts. */ - private Map idPartMapping = Maps.newHashMap(); + private Map idPartMapping = new HashMap<>(); /** the mapping of diagram view identifiers on view contexts. */ - private Map idContextMapping = Maps.newHashMap(); + private Map idContextMapping = new HashMap<>(); /** * Returns the singleton instance. diff --git a/plugins/de.cau.cs.kieler.klighd.ui/src/de/cau/cs/kieler/klighd/ui/internal/handlers/ExportKGraphHelper.java b/plugins/de.cau.cs.kieler.klighd.ui/src/de/cau/cs/kieler/klighd/ui/internal/handlers/ExportKGraphHelper.java index 400ad1963..40f598fe0 100644 --- a/plugins/de.cau.cs.kieler.klighd.ui/src/de/cau/cs/kieler/klighd/ui/internal/handlers/ExportKGraphHelper.java +++ b/plugins/de.cau.cs.kieler.klighd.ui/src/de/cau/cs/kieler/klighd/ui/internal/handlers/ExportKGraphHelper.java @@ -17,6 +17,8 @@ package de.cau.cs.kieler.klighd.ui.internal.handlers; import java.io.IOException; +import java.util.HashMap; +import java.util.HashSet; import java.util.Iterator; import java.util.Map; import java.util.Map.Entry; @@ -38,9 +40,6 @@ import org.eclipse.emf.ecore.util.EcoreUtil.Copier; import com.google.common.collect.Iterators; -import com.google.common.collect.Maps; -import com.google.common.collect.Sets; - import de.cau.cs.kieler.klighd.Klighd; import de.cau.cs.kieler.klighd.internal.util.KlighdInternalProperties; import de.cau.cs.kieler.klighd.kgraph.KEdge; @@ -147,7 +146,7 @@ public static void export(final KNode graph, final URI fileOutputURI, final bool try { // We need to sanitize the graph a bit - Set populatedNodes = Sets.newHashSet(); + Set populatedNodes = new HashSet<>(); // Remove transient KlighD state // Care: do not iterate over the elements of the 'copy' as the subgraph // was already removed from its original containment @@ -287,7 +286,7 @@ public static void export(final KNode graph, final URI fileOutputURI, final bool // remove any edges that do not have a target anymore recursivelyRemoveInvalidEdges((KNode) copier.get(graph)); - Map saveOpts = Maps.newHashMap(); + Map saveOpts = new HashMap<>(); // we have to drop several elements if only a subgraph // is exported ... just let the emf deal with it. // FIXME use constants @@ -331,9 +330,9 @@ private static void removeNonLayoutProperties(final KGraphElement kge) { private static boolean isLayoutProperty(final IProperty prop) { Set> goodProperties = - Sets.newHashSet(KlighdProperties.EXPAND, KlighdProperties.MINIMAL_NODE_SIZE); + Set.of(KlighdProperties.EXPAND, KlighdProperties.MINIMAL_NODE_SIZE); Set> badProperties = - Sets.newHashSet(CoreOptions.LABEL_MANAGER, LabelManagementOptions.LABEL_MANAGER); + Set.of(CoreOptions.LABEL_MANAGER, LabelManagementOptions.LABEL_MANAGER); return (prop.getId().startsWith("org.eclipse.elk") && !badProperties.contains(prop)) || goodProperties.contains(prop); } diff --git a/plugins/de.cau.cs.kieler.klighd.ui/src/de/cau/cs/kieler/klighd/ui/internal/handlers/SaveKGraphHandler.java b/plugins/de.cau.cs.kieler.klighd.ui/src/de/cau/cs/kieler/klighd/ui/internal/handlers/SaveKGraphHandler.java index ae6922f9c..97bb233f4 100644 --- a/plugins/de.cau.cs.kieler.klighd.ui/src/de/cau/cs/kieler/klighd/ui/internal/handlers/SaveKGraphHandler.java +++ b/plugins/de.cau.cs.kieler.klighd.ui/src/de/cau/cs/kieler/klighd/ui/internal/handlers/SaveKGraphHandler.java @@ -17,6 +17,7 @@ package de.cau.cs.kieler.klighd.ui.internal.handlers; import java.io.File; +import java.util.ArrayDeque; import java.util.Arrays; import java.util.Queue; @@ -37,8 +38,6 @@ import org.eclipse.ui.dialogs.ContainerSelectionDialog; import org.eclipse.ui.handlers.HandlerUtil; -import com.google.common.collect.Lists; - import de.cau.cs.kieler.klighd.IDiagramWorkbenchPart; import de.cau.cs.kieler.klighd.IViewer; import de.cau.cs.kieler.klighd.Klighd; @@ -214,8 +213,8 @@ private void exportRecursivelyChunky(final KNode subgraph, final String destinat final ViewContext viewContext) { // collect all subgraph s - final Queue flatNodes = Lists.newLinkedList(); - final Queue expandedNodes = Lists.newLinkedList(); + final Queue flatNodes = new ArrayDeque<>(); + final Queue expandedNodes = new ArrayDeque<>(); String path = destination + File.separator; flatNodes.add(subgraph); @@ -261,7 +260,7 @@ private void exportRecursivelyChunky(final KNode subgraph, final String destinat viewContext.getViewer().collapse(node); } } - final Queue increaseHierarchy = Lists.newLinkedList(); + final Queue increaseHierarchy = new ArrayDeque<>(); increaseHierarchy.add(subgraph); new LightDiagramLayoutConfig(viewContext).animate(false).performLayout(); int i = 0; diff --git a/plugins/de.cau.cs.kieler.klighd.ui/src/de/cau/cs/kieler/klighd/ui/internal/options/ActionControlFactory.java b/plugins/de.cau.cs.kieler.klighd.ui/src/de/cau/cs/kieler/klighd/ui/internal/options/ActionControlFactory.java index e512e140f..90ac857fb 100644 --- a/plugins/de.cau.cs.kieler.klighd.ui/src/de/cau/cs/kieler/klighd/ui/internal/options/ActionControlFactory.java +++ b/plugins/de.cau.cs.kieler.klighd.ui/src/de/cau/cs/kieler/klighd/ui/internal/options/ActionControlFactory.java @@ -17,6 +17,7 @@ package de.cau.cs.kieler.klighd.ui.internal.options; import java.util.Collection; +import java.util.HashMap; import java.util.LinkedList; import java.util.Map; @@ -32,8 +33,6 @@ import org.eclipse.swt.widgets.Control; import org.eclipse.ui.forms.widgets.FormToolkit; -import com.google.common.collect.Maps; - import de.cau.cs.kieler.klighd.DisplayedActionData; import de.cau.cs.kieler.klighd.IAction; import de.cau.cs.kieler.klighd.IAction.ActionContext; @@ -95,7 +94,7 @@ public void clear() { actionDataControlMap.clear(); } - private Map actionDataControlMap = Maps.newHashMap(); + private Map actionDataControlMap = new HashMap<>(); /** * Factory method for creating a check button related to a 'check' option. diff --git a/plugins/de.cau.cs.kieler.klighd.ui/src/de/cau/cs/kieler/klighd/ui/internal/options/SynthesisOptionControlFactory.java b/plugins/de.cau.cs.kieler.klighd.ui/src/de/cau/cs/kieler/klighd/ui/internal/options/SynthesisOptionControlFactory.java index 30c5fff6e..dbb8229bc 100644 --- a/plugins/de.cau.cs.kieler.klighd.ui/src/de/cau/cs/kieler/klighd/ui/internal/options/SynthesisOptionControlFactory.java +++ b/plugins/de.cau.cs.kieler.klighd.ui/src/de/cau/cs/kieler/klighd/ui/internal/options/SynthesisOptionControlFactory.java @@ -16,8 +16,10 @@ */ package de.cau.cs.kieler.klighd.ui.internal.options; +import java.util.ArrayList; import java.util.Collection; import java.util.Collections; +import java.util.HashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; @@ -49,9 +51,6 @@ import org.eclipse.ui.forms.widgets.FormToolkit; import org.eclipse.ui.forms.widgets.Section; -import com.google.common.collect.Lists; -import com.google.common.collect.Maps; - import de.cau.cs.kieler.klighd.IAction; import de.cau.cs.kieler.klighd.IAction.ActionContext; import de.cau.cs.kieler.klighd.IAction.ActionResult; @@ -78,18 +77,18 @@ public class SynthesisOptionControlFactory { /** the form toolkit used to create controls. */ private FormToolkit formToolkit; /** The set of controls to be disposed when {@link #clear()} is called. */ - private final Collection controls = Lists.newArrayList(); + private final Collection controls = new ArrayList<>(); /** This flag is true if this factory is factory for options of a subordinate synthesis. */ private boolean isSubFactory = false; /** The title text of the parent form. */ private final String parentTitle; /** The list of {SynthesisOptionControlFactory} for synthesis specific sections. */ - private final List subFactories = Lists.newArrayList(); + private final List subFactories = new ArrayList<>(); /** If set, the category this factory is responsible for. */ private SynthesisOption factoryCategory = null; /** The list of {SynthesisOptionControlFactory} for categories directly nested. */ private final Map subCategoryFactories = - Maps.newHashMap(); + new HashMap<>(); /** Preference prefix for sub-factory. */ private static final String SUB_FACTORY_PREFIX = "sidebar.synthesis.expansion."; diff --git a/plugins/de.cau.cs.kieler.klighd.ui/src/de/cau/cs/kieler/klighd/ui/internal/preferences/KlighdPlatformPreferenceStore.java b/plugins/de.cau.cs.kieler.klighd.ui/src/de/cau/cs/kieler/klighd/ui/internal/preferences/KlighdPlatformPreferenceStore.java index 7bbc2445b..9c5085484 100644 --- a/plugins/de.cau.cs.kieler.klighd.ui/src/de/cau/cs/kieler/klighd/ui/internal/preferences/KlighdPlatformPreferenceStore.java +++ b/plugins/de.cau.cs.kieler.klighd.ui/src/de/cau/cs/kieler/klighd/ui/internal/preferences/KlighdPlatformPreferenceStore.java @@ -13,6 +13,7 @@ */ package de.cau.cs.kieler.klighd.ui.internal.preferences; +import java.util.HashMap; import java.util.Map; import org.eclipse.core.runtime.preferences.IEclipsePreferences; @@ -22,8 +23,6 @@ import org.eclipse.jface.util.IPropertyChangeListener; import org.eclipse.ui.preferences.ScopedPreferenceStore; -import com.google.common.collect.Maps; - import de.cau.cs.kieler.klighd.IKlighdPreferenceStore; import de.cau.cs.kieler.klighd.Klighd; @@ -250,7 +249,7 @@ public void setDefault(String name, String defaultObject) { delegate.setDefault(name, defaultObject); } - private final Map listeners = Maps.newHashMap(); + private final Map listeners = new HashMap<>(); /** * {@inheritDoc} diff --git a/plugins/de.cau.cs.kieler.klighd.ui/src/de/cau/cs/kieler/klighd/ui/modifymodel/ModelModificationHandlerProvider.java b/plugins/de.cau.cs.kieler.klighd.ui/src/de/cau/cs/kieler/klighd/ui/modifymodel/ModelModificationHandlerProvider.java index 6c117ccf7..0de7c3411 100644 --- a/plugins/de.cau.cs.kieler.klighd.ui/src/de/cau/cs/kieler/klighd/ui/modifymodel/ModelModificationHandlerProvider.java +++ b/plugins/de.cau.cs.kieler.klighd.ui/src/de/cau/cs/kieler/klighd/ui/modifymodel/ModelModificationHandlerProvider.java @@ -16,6 +16,7 @@ */ package de.cau.cs.kieler.klighd.ui.modifymodel; +import java.util.ArrayList; import java.util.List; import org.eclipse.core.runtime.CoreException; @@ -23,8 +24,6 @@ import org.eclipse.core.runtime.RegistryFactory; import org.eclipse.ui.IWorkbenchPart; -import com.google.common.collect.Lists; - import de.cau.cs.kieler.klighd.IModelModificationHandler; /** @@ -79,7 +78,7 @@ public IModelModificationHandler getFittingHandler(final IWorkbenchPart part) { * Parse the extension point and generate handler instances. */ private void readHandlerExtensionPoint() { - handlers = Lists.newLinkedList(); + handlers = new ArrayList<>(); // read extension point IConfigurationElement[] elements = RegistryFactory.getRegistry().getConfigurationElementsFor( diff --git a/plugins/de.cau.cs.kieler.klighd/.classpath b/plugins/de.cau.cs.kieler.klighd/.classpath index 6122403cc..1d45a8a9f 100644 --- a/plugins/de.cau.cs.kieler.klighd/.classpath +++ b/plugins/de.cau.cs.kieler.klighd/.classpath @@ -1,6 +1,6 @@ - + diff --git a/plugins/de.cau.cs.kieler.klighd/.settings/org.eclipse.jdt.core.prefs b/plugins/de.cau.cs.kieler.klighd/.settings/org.eclipse.jdt.core.prefs index de96c6c21..64c1012f9 100644 --- a/plugins/de.cau.cs.kieler.klighd/.settings/org.eclipse.jdt.core.prefs +++ b/plugins/de.cau.cs.kieler.klighd/.settings/org.eclipse.jdt.core.prefs @@ -1,14 +1,19 @@ eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 -org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate +org.eclipse.jdt.core.compiler.codegen.targetPlatform=11 +org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve +org.eclipse.jdt.core.compiler.compliance=11 +org.eclipse.jdt.core.compiler.debug.lineNumber=generate +org.eclipse.jdt.core.compiler.debug.localVariable=generate +org.eclipse.jdt.core.compiler.debug.sourceFile=generate 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.forbiddenReference=warning -org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore -org.eclipse.jdt.core.compiler.release=disabled -org.eclipse.jdt.core.compiler.source=1.8 +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false org.eclipse.jdt.core.formatter.alignment_for_additive_operator=16 org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16 diff --git a/plugins/de.cau.cs.kieler.klighd/META-INF/MANIFEST.MF b/plugins/de.cau.cs.kieler.klighd/META-INF/MANIFEST.MF index d718971e1..00761e426 100644 --- a/plugins/de.cau.cs.kieler.klighd/META-INF/MANIFEST.MF +++ b/plugins/de.cau.cs.kieler.klighd/META-INF/MANIFEST.MF @@ -2,13 +2,14 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: KIELER Lightweight Diagrams (KLighD) Bundle-SymbolicName: de.cau.cs.kieler.klighd;singleton:=true -Bundle-Version: 2.3.1.qualifier +Bundle-Version: 3.0.3.qualifier Bundle-Vendor: Kiel University -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Bundle-RequiredExecutionEnvironment: JavaSE-11 Require-Bundle: de.cau.cs.kieler.klighd.kgraph, de.cau.cs.kieler.klighd.krendering;visibility:=reexport, org.eclipse.core.runtime;bundle-version="3.6.0";visibility:=reexport, - org.eclipse.elk.core.service;bundle-version="0.1.0", + org.eclipse.elk.core, + org.eclipse.elk.core.service, org.eclipse.emf.ecore;bundle-version="2.8.0";visibility:=reexport, org.eclipse.emf.edit;bundle-version="2.8.0";resolution:=optional, org.eclipse.jface;bundle-version="3.8.0";visibility:=reexport, @@ -16,7 +17,7 @@ Require-Bundle: de.cau.cs.kieler.klighd.kgraph, org.eclipse.ui.workbench;bundle-version="3.103.0";visibility:=reexport, com.google.guava;bundle-version="10.0.0";visibility:=reexport, com.google.inject;bundle-version="3.0.0", - javax.inject;bundle-version="1.0.0";visibility:=reexport + jakarta.inject.jakarta.inject-api;bundle-version="2.0.1";visibility:=reexport Bundle-ActivationPolicy: lazy Bundle-Activator: de.cau.cs.kieler.klighd.KlighdPlugin Export-Package: de.cau.cs.kieler.klighd, diff --git a/plugins/de.cau.cs.kieler.klighd/pom.eclipse.xml b/plugins/de.cau.cs.kieler.klighd/pom.eclipse.xml index 046c8845d..a076e4afd 100644 --- a/plugins/de.cau.cs.kieler.klighd/pom.eclipse.xml +++ b/plugins/de.cau.cs.kieler.klighd/pom.eclipse.xml @@ -5,15 +5,13 @@ de.cau.cs.kieler.klighd parent - 2.2.1-SNAPSHOT + 3.0.3-SNAPSHOT ../../pom.xml - de.cau.cs.kieler.klighd de.cau.cs.kieler.klighd - 2.2.1-SNAPSHOT eclipse-plugin KIELER Lightweight Diagrams (KLighD) diff --git a/plugins/de.cau.cs.kieler.klighd/pom.lsp.xml b/plugins/de.cau.cs.kieler.klighd/pom.lsp.xml index a6f3792cb..2afc0000d 100644 --- a/plugins/de.cau.cs.kieler.klighd/pom.lsp.xml +++ b/plugins/de.cau.cs.kieler.klighd/pom.lsp.xml @@ -5,7 +5,7 @@ de.cau.cs.kieler.klighd parent - 2.2.1-SNAPSHOT + 3.0.3-SNAPSHOT ../../pom.xml @@ -21,9 +21,7 @@ This file should be the same as the pom.eclipse.xml and the pom.xml, without the tag and with SWT mock deps. --> - de.cau.cs.kieler.klighd de.cau.cs.kieler.klighd - 2.2.1-SNAPSHOT KIELER Lightweight Diagrams (KLighD) KIELER Lightweight Diagrams (KLighD) diff --git a/plugins/de.cau.cs.kieler.klighd/pom.xml b/plugins/de.cau.cs.kieler.klighd/pom.xml index 49723fb51..a076e4afd 100644 --- a/plugins/de.cau.cs.kieler.klighd/pom.xml +++ b/plugins/de.cau.cs.kieler.klighd/pom.xml @@ -5,15 +5,13 @@ de.cau.cs.kieler.klighd parent - 2.3.1-SNAPSHOT + 3.0.3-SNAPSHOT ../../pom.xml - de.cau.cs.kieler.klighd de.cau.cs.kieler.klighd - 2.3.1-SNAPSHOT eclipse-plugin KIELER Lightweight Diagrams (KLighD) diff --git a/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/IViewChangeListener.java b/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/IViewChangeListener.java index 99948d893..c45a5259f 100644 --- a/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/IViewChangeListener.java +++ b/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/IViewChangeListener.java @@ -17,14 +17,13 @@ package de.cau.cs.kieler.klighd; import java.awt.geom.Rectangle2D; +import java.util.Arrays; import java.util.Collections; +import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; -import com.google.common.collect.Lists; -import com.google.common.collect.Maps; - import de.cau.cs.kieler.klighd.kgraph.KGraphElement; import de.cau.cs.kieler.klighd.kgraph.KNode; @@ -251,7 +250,7 @@ public ViewChange suppressSubsequentNotifications(final Iterable */ public ViewChange suppressSubsequentNotifications(final int durationInMS, final ViewChangeType... changeTypes) { - return suppressSubsequentNotifications(durationInMS, Lists.newArrayList(changeTypes)); + return suppressSubsequentNotifications(durationInMS, Arrays.asList(changeTypes)); } /** @@ -274,7 +273,7 @@ public ViewChange suppressSubsequentNotifications(final int durationInMS, final Iterable changeTypes) { if (notificationSuppressions == null) { - notificationSuppressions = Maps.newHashMap(); + notificationSuppressions = new HashMap<>(); } for (final ViewChangeType type : changeTypes) { diff --git a/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/KlighdDataManager.java b/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/KlighdDataManager.java index 5e7e5f8dd..3f2de9f39 100644 --- a/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/KlighdDataManager.java +++ b/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/KlighdDataManager.java @@ -18,10 +18,13 @@ import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; +import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.Comparator; +import java.util.HashMap; +import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.Map.Entry; @@ -50,7 +53,6 @@ import com.google.common.collect.ImmutableList.Builder; import com.google.common.collect.Iterables; import com.google.common.collect.Lists; -import com.google.common.collect.Maps; import com.google.common.collect.Multimap; import de.cau.cs.kieler.klighd.internal.ISynthesis; @@ -193,7 +195,7 @@ public static KlighdDataManager getInstance() { } /** the mapping of ids to the corresponding instances of {@link ISynthesis}. */ - private final Map idSynthesisMapping = Maps.newLinkedHashMap(); + private final Map idSynthesisMapping = new LinkedHashMap<>(); /** the mapping of types to the corresponding instances of {@link ISynthesis}. */ private final Multimap, ISynthesis> typeSynthesisMapping = ArrayListMultimap.create(); @@ -201,48 +203,48 @@ public static KlighdDataManager getInstance() { /** * A caching map that avoids the effort of determining the correct syntheses for a given type * each time. */ - private final Map, Iterable> concreteTypeSynthesisMapping = Maps.newHashMap(); + private final Map, Iterable> concreteTypeSynthesisMapping = new HashMap<>(); /** the mapping of ids on the associated viewer providers. */ - private Map idViewerProviderMapping = Maps.newHashMap(); + private Map idViewerProviderMapping = new HashMap<>(); /** the mapping of ids on the associated update strategies. */ - private Map idUpdateStrategyMapping = Maps.newHashMap(); + private Map idUpdateStrategyMapping = new HashMap<>(); /** the mapping of priorities on the associated update strategies, sorted by priority. */ - private TreeMap priorityUpdateStrategyMapping = Maps.newTreeMap(); + private TreeMap priorityUpdateStrategyMapping = new TreeMap<>(); private IUpdateStrategy highestPriorityUpdateStrategy = null; /** the mapping of ids to the associated style modifiers. */ - private final Map idStyleModifierMapping = Maps.newHashMap(); + private final Map idStyleModifierMapping = new HashMap<>(); /** the mapping of ids to the associated actions. */ private final BiMap idActionMapping = HashBiMap.create(); /** the mapping of ids to the associated configuration elements describing the exporters. */ - private final Map exportersMap = Maps.newHashMap(); + private final Map exportersMap = new HashMap<>(); /** the list of the available exporters' descriptors. */ - private final List descriptors = Lists.newArrayList(); + private final List descriptors = new ArrayList<>(); /** the mapping of ids to the associated export branding descriptors. */ - private final Map idExportBrandingMapping = Maps.newHashMap(); + private final Map idExportBrandingMapping = new HashMap<>(); /** the mapping of ids to the associated off-screen renderer descriptors. */ - private final Map idOffscreenRendererMapping = Maps.newHashMap(); + private final Map idOffscreenRendererMapping = new HashMap<>(); /** the mapping of custom figure types to wrapper figure type being supported by KLighD. */ - private final List customFigureWrapperMapping = Lists.newArrayList(); + private final List customFigureWrapperMapping = new ArrayList<>(); /** the properties that shall be preserved from the layout graph to the kgraph */ - private final List> preservedProperties = Lists.newArrayList(); + private final List> preservedProperties = new ArrayList<>(); /** the properties that are not allowed to be preserved when sending the skgraph to the client */ - private final List> blacklistedProperties = Lists.newArrayList(); + private final List> blacklistedProperties = new ArrayList<>(); /** the properties that are outside the klighd/elk namespace that are explicitly allowed to be sent to the client */ - private final List> whitelistedProperties = Lists.newArrayList(); + private final List> whitelistedProperties = new ArrayList<>(); /** * A private constructor to prevent instantiation. @@ -1117,7 +1119,7 @@ public Set getActionIds() { * @return return a copy of the original list */ public List getAvailableExporters() { - return Lists.newLinkedList(descriptors); + return new ArrayList<>(descriptors); } /** @@ -1162,7 +1164,7 @@ public Iterable getExportBrandingByFormat(final String format, descr -> descr.supportedFormats.contains(format) ); - final List result = Lists.newArrayList(); + final List result = new ArrayList<>(); for (final ExportBrandingDescriptor descr : descriptors) { final IExportBranding branding = descr.supplier.get(); diff --git a/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/KlighdSetup.java b/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/KlighdSetup.java index 8baa308cb..fd58a23d8 100644 --- a/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/KlighdSetup.java +++ b/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/KlighdSetup.java @@ -33,7 +33,7 @@ public class KlighdSetup implements IKlighdStartupHook { @Override public void execute() { KlighdDataManager.getInstance() - .registerBlacklistedProperty(KlighdInternalProperties.MODEL_ELEMEMT) + .registerBlacklistedProperty(KlighdInternalProperties.MODEL_ELEMENT) .registerBlacklistedProperty(LabelManagementOptions.LABEL_MANAGER) .registerBlacklistedProperty(GridPlacementUtil.ESTIMATED_GRID_DATA) .registerBlacklistedProperty(GridPlacementUtil.CHILD_AREA_POSITION); diff --git a/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/LightDiagramServices.java b/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/LightDiagramServices.java index 18fd28191..cab05b525 100644 --- a/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/LightDiagramServices.java +++ b/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/LightDiagramServices.java @@ -40,8 +40,6 @@ import com.google.common.base.Predicates; import com.google.common.collect.Collections2; import com.google.common.collect.Iterables; -import com.google.common.collect.Lists; - import de.cau.cs.kieler.klighd.KlighdDataManager.OffscreenRendererDescriptor; import de.cau.cs.kieler.klighd.internal.ILayoutConfigProvider; import de.cau.cs.kieler.klighd.internal.ILayoutRecorder; @@ -58,7 +56,7 @@ public final class LightDiagramServices { private static final List> GLOBALOPTIONS = - Lists.newArrayList(CoreOptions.ANIMATE, CoreOptions.ANIM_TIME_FACTOR, + List.of(CoreOptions.ANIMATE, CoreOptions.ANIM_TIME_FACTOR, CoreOptions.MIN_ANIM_TIME, CoreOptions.MAX_ANIM_TIME); /** diff --git a/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/ViewContext.java b/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/ViewContext.java index 892c4fa78..b8b9caacf 100644 --- a/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/ViewContext.java +++ b/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/ViewContext.java @@ -16,8 +16,10 @@ */ package de.cau.cs.kieler.klighd; +import java.util.ArrayList; import java.util.Collection; import java.util.Collections; +import java.util.HashMap; import java.util.List; import java.util.Map; @@ -36,9 +38,6 @@ import com.google.common.base.Function; import com.google.common.base.Predicate; import com.google.common.collect.Iterables; -import com.google.common.collect.Lists; -import com.google.common.collect.Maps; - import de.cau.cs.kieler.klighd.internal.ILayoutRecorder; import de.cau.cs.kieler.klighd.internal.ISynthesis; import de.cau.cs.kieler.klighd.internal.util.KlighdInternalProperties; @@ -659,10 +658,10 @@ public void setZoomStyle(final ZoomStyle zoomStyle) { */ public void associateSourceTargetPair(final Object source, final EObject target) { if (KGraphPackage.eINSTANCE.getKGraphData().isInstance(target)) { - ((KGraphData) target).setProperty(KlighdInternalProperties.MODEL_ELEMEMT, source); + ((KGraphData) target).setProperty(KlighdInternalProperties.MODEL_ELEMENT, source); } else if (KGraphPackage.eINSTANCE.getKGraphElement().isInstance(target)) { - ((KGraphElement) target).setProperty(KlighdInternalProperties.MODEL_ELEMEMT, source); + ((KGraphElement) target).setProperty(KlighdInternalProperties.MODEL_ELEMENT, source); } } @@ -751,10 +750,10 @@ public T getTargetElement(final Object element, final Class< // ---------------------------------------------------------------------------------- // // Synthesis option handling - private List synthesisOptions = Lists.newLinkedList(); + private List synthesisOptions = new ArrayList<>(); /** Memory of the configured transformation options to be evaluated by the transformation. */ - private Map synthesisOptionConfig = Maps.newHashMap(); + private Map synthesisOptionConfig = new HashMap<>(); /** @@ -879,7 +878,7 @@ public List getAdditionalLayoutConfigs() { // ---------------------------------------------------------------------------------- // // Child ViewContext handling - private final List childViewContexts = Lists.newLinkedList(); + private final List childViewContexts = new ArrayList<>(); /** * Returns the list of registered child {@link ViewContext}.
@@ -894,7 +893,7 @@ public List getAdditionalLayoutConfigs() { */ public List getChildViewContexts(final boolean recursive) { if (recursive) { - List recursiveVCs = Lists.newLinkedList(); + List recursiveVCs = new ArrayList<>(); for (ViewContext vc : childViewContexts) { recursiveVCs.add(vc); recursiveVCs.addAll(vc.getChildViewContexts(true)); diff --git a/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/actions/FocusAndContextAction.java b/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/actions/FocusAndContextAction.java index 691df7732..e30de92fb 100644 --- a/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/actions/FocusAndContextAction.java +++ b/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/actions/FocusAndContextAction.java @@ -16,12 +16,11 @@ */ package de.cau.cs.kieler.klighd.actions; +import java.util.ArrayList; import java.util.List; import org.eclipse.elk.core.options.CoreOptions; -import com.google.common.collect.Lists; - import de.cau.cs.kieler.klighd.IAction; import de.cau.cs.kieler.klighd.KlighdOptions; import de.cau.cs.kieler.klighd.kgraph.KEdge; @@ -128,7 +127,7 @@ protected List determineFocussedElements(final KGraphElement elem if (element instanceof KNode) { KNode node = (KNode) element; - List result = Lists.newArrayList(); + List result = new ArrayList<>(); // Include all ports result.addAll(node.getPorts()); diff --git a/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/internal/ILayoutRecorder.java b/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/internal/ILayoutRecorder.java index 38fe7e916..aeff7d6a7 100644 --- a/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/internal/ILayoutRecorder.java +++ b/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/internal/ILayoutRecorder.java @@ -20,7 +20,6 @@ import de.cau.cs.kieler.klighd.ZoomStyle; import de.cau.cs.kieler.klighd.kgraph.KGraphElement; -import de.cau.cs.kieler.klighd.kgraph.KNode; /** * A dedicated interface enable the separation of the features provided by diff --git a/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/internal/macrolayout/KlighdDiagramLayoutConnector.java b/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/internal/macrolayout/KlighdDiagramLayoutConnector.java index 077b07c98..fa53f9803 100644 --- a/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/internal/macrolayout/KlighdDiagramLayoutConnector.java +++ b/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/internal/macrolayout/KlighdDiagramLayoutConnector.java @@ -3,7 +3,7 @@ * * http://rtsys.informatik.uni-kiel.de/kieler * - * Copyright ${year} by + * Copyright 2013-2024 by * + Kiel University * + Department of Computer Science * + Real-Time and Embedded Systems Group @@ -16,6 +16,7 @@ */ package de.cau.cs.kieler.klighd.internal.macrolayout; +import java.util.ArrayList; import java.util.LinkedList; import java.util.List; import java.util.ListIterator; @@ -54,7 +55,6 @@ import com.google.common.collect.BiMap; import com.google.common.collect.Iterables; import com.google.common.collect.Iterators; -import com.google.common.collect.Lists; import de.cau.cs.kieler.klighd.IDiagramWorkbenchPart; import de.cau.cs.kieler.klighd.IViewer; @@ -682,7 +682,7 @@ private void applyLayout(final LayoutMapping mapping, final boolean suppressEdge // We need to process labels after the edges because during edge handling // the insets are handled and the source data adjusted accordingly. // We store the labels here to have them ready after the main switch. - List graphLabels = Lists.newArrayList(); + List graphLabels = new ArrayList<>(); // apply the layout of all mapped layout elements back to the associated element for (final Entry elementMapping : elementMappings) { @@ -764,7 +764,7 @@ public Boolean caseElkLabel(final ElkLabel layoutLabel) { // special property LabelManagementResult managementResult = layoutLabel.getProperty(KlighdOptions.LABELS_MANAGEMENT_RESULT); - if (managementResult != LabelManagementResult.UNMANAGED) { + if (managementResult == LabelManagementResult.MANAGED_MODIFIED) { // TODO: This may in the future set the KText's text instead. // However, doing so now doesn't do anything yet... label.setProperty(KlighdOptions.LABELS_TEXT_OVERRIDE, @@ -1216,7 +1216,9 @@ private void handleExcludedEdge(final KEdge edge) { -sourceNode.getInsets().getTop()); } } else { - sourcePoint.add(sourceNode.getXpos(), sourceNode.getYpos()); + // TODO: this probably only works for edges crossing at most one hierarchy level + sourcePoint.add(sourceNode.getXpos() * sourceNode.getProperty(CoreOptions.TOPDOWN_SCALE_FACTOR), + sourceNode.getYpos() * sourceNode.getProperty(CoreOptions.TOPDOWN_SCALE_FACTOR)); } KPoint sourceKPoint = edge.getSourcePoint(); @@ -1228,7 +1230,9 @@ private void handleExcludedEdge(final KEdge edge) { // determine the target point final KVector targetPoint = toElementBorder(targetNode, targetPort, sourceNode, sourcePort); - targetPoint.add(targetNode.getXpos(), targetNode.getYpos()); + // TODO: this probably only works for edges crossing at most one hierarchy level + targetPoint.add(targetNode.getXpos() * targetNode.getParent().getProperty(CoreOptions.TOPDOWN_SCALE_FACTOR), + targetNode.getYpos() * targetNode.getParent().getProperty(CoreOptions.TOPDOWN_SCALE_FACTOR)); if (targetInSource) { KGraphUtil.toAbsolute(targetPoint, targetNode.getParent()); KGraphUtil.toRelative(targetPoint, sourceNode); diff --git a/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/internal/macrolayout/KlighdLayoutConfigurationStore.java b/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/internal/macrolayout/KlighdLayoutConfigurationStore.java index 552ab7bef..d44e5fe2b 100644 --- a/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/internal/macrolayout/KlighdLayoutConfigurationStore.java +++ b/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/internal/macrolayout/KlighdLayoutConfigurationStore.java @@ -283,7 +283,7 @@ public Collection getAffectedOptions() { final String msg = "Concurrent modification in KGraphPropertyLayoutConfig:" + Klighd.LINE_SEPARATOR + " element == " + graphElement + Klighd.LINE_SEPARATOR + " sourceElement == " - + graphElement.getProperty(KlighdInternalProperties.MODEL_ELEMEMT); + + graphElement.getProperty(KlighdInternalProperties.MODEL_ELEMENT); Klighd.log(new Status(IStatus.ERROR, Klighd.PLUGIN_ID, msg)); } diff --git a/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/internal/preferences/KlighdPlainPreferenceStore.java b/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/internal/preferences/KlighdPlainPreferenceStore.java index 4b5a667ee..be9df549e 100644 --- a/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/internal/preferences/KlighdPlainPreferenceStore.java +++ b/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/internal/preferences/KlighdPlainPreferenceStore.java @@ -17,15 +17,13 @@ import org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener; -import com.google.common.collect.Maps; - import de.cau.cs.kieler.klighd.IKlighdPreferenceStore; public class KlighdPlainPreferenceStore implements IKlighdPreferenceStore { - private final HashMap values = Maps.newHashMap(); + private final HashMap values = new HashMap<>(); - private final HashMap defaults = Maps.newHashMap(); + private final HashMap defaults = new HashMap<>(); public KlighdPlainPreferenceStore() { new PreferenceInitializer().initializeDefaultPreferences(this); diff --git a/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/internal/util/KlighdInternalProperties.java b/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/internal/util/KlighdInternalProperties.java index c7dada30a..570c9f0d5 100644 --- a/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/internal/util/KlighdInternalProperties.java +++ b/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/internal/util/KlighdInternalProperties.java @@ -47,7 +47,14 @@ private KlighdInternalProperties() { * KGraphData}, for {@link de.cau.cs.kieler.klighd.kgraph.KGraphElement KGraphElements} it is to * be attached to their layout data. */ - public static final IProperty MODEL_ELEMEMT = new Property("klighd.modelElement"); + public static final IProperty MODEL_ELEMENT = new Property("klighd.modelElement"); + + /** + * Deprecated property with a typo, see {@link #MODEL_ELEMENT} as the replacement. + * + * @deprecated + */ + public static final IProperty MODEL_ELEMEMT = MODEL_ELEMENT; /** * Property indicating that the node has been populated. A node is populated, if and only if the diff --git a/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/internal/util/SourceModelTrackingAdapter.java b/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/internal/util/SourceModelTrackingAdapter.java index 809a5ecae..8385dc79a 100644 --- a/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/internal/util/SourceModelTrackingAdapter.java +++ b/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/internal/util/SourceModelTrackingAdapter.java @@ -18,6 +18,7 @@ import java.util.Collection; import java.util.Collections; +import java.util.HashMap; import java.util.Iterator; import java.util.Map; @@ -32,7 +33,6 @@ import com.google.common.collect.ArrayListMultimap; import com.google.common.collect.Iterables; import com.google.common.collect.Iterators; -import com.google.common.collect.Maps; import com.google.common.collect.Multimap; import de.cau.cs.kieler.klighd.kgraph.EMapPropertyHolder; @@ -53,11 +53,11 @@ public class SourceModelTrackingAdapter extends EContentAdapter { private static final Predicate CANDIDATES = KlighdPredicates.instanceOf( KGraphElement.class, KRendering.class, IPropertyToObjectMapImpl.class); - private static final IProperty MODEL_ELEMENT = KlighdInternalProperties.MODEL_ELEMEMT; + private static final IProperty MODEL_ELEMENT = KlighdInternalProperties.MODEL_ELEMENT; private Object mapsMonitor = this; private Multimap sourceTargetsMap = ArrayListMultimap.create(); - private Map targetSourceMap = Maps.newHashMap(); + private Map targetSourceMap = new HashMap<>(); /** diff --git a/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/krendering/KCustomRenderingWrapperFactory.java b/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/krendering/KCustomRenderingWrapperFactory.java index bf97ed5ce..5fc1ff3a5 100644 --- a/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/krendering/KCustomRenderingWrapperFactory.java +++ b/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/krendering/KCustomRenderingWrapperFactory.java @@ -18,6 +18,7 @@ import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; +import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; @@ -56,7 +57,7 @@ public final class KCustomRenderingWrapperFactory { * The wrapper look-up dictionary: * The keys are the wrapped types, the values are the concrete wrapping implementations. */ - private final Map, Class> typeWrapperMap = Maps.newHashMap(); + private final Map, Class> typeWrapperMap = new HashMap<>(); /** * Provides the single instance of the class. diff --git a/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/krendering/SimpleUpdateStrategy.java b/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/krendering/SimpleUpdateStrategy.java index 72e604833..8088cb1aa 100644 --- a/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/krendering/SimpleUpdateStrategy.java +++ b/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/krendering/SimpleUpdateStrategy.java @@ -16,6 +16,7 @@ */ package de.cau.cs.kieler.klighd.krendering; +import java.util.ArrayList; import java.util.List; import com.google.common.collect.Iterables; @@ -63,8 +64,8 @@ public boolean requiresDiagramSynthesisReRun(final ViewContext viewContext) { */ public void update(final KNode baseModel, final KNode newModel, final ViewContext viewContext) { - final List newChildren = Lists.newArrayList(newModel.getChildren()); - final List newData = Lists.newArrayList(newModel.getData()); + final List newChildren = new ArrayList<>(newModel.getChildren()); + final List newData = new ArrayList<>(newModel.getData()); newModel.getChildren().clear(); newModel.getData().clear(); diff --git a/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/labels/decoration/LabelDecorationConfigurator.java b/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/labels/decoration/LabelDecorationConfigurator.java index 0a48c533a..797edca67 100644 --- a/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/labels/decoration/LabelDecorationConfigurator.java +++ b/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/labels/decoration/LabelDecorationConfigurator.java @@ -16,6 +16,7 @@ */ package de.cau.cs.kieler.klighd.labels.decoration; +import java.util.ArrayList; import java.util.List; import java.util.ListIterator; import java.util.Objects; @@ -25,8 +26,6 @@ import org.eclipse.elk.core.options.CoreOptions; import org.eclipse.elk.core.options.EdgeLabelPlacement; -import com.google.common.collect.Lists; - import de.cau.cs.kieler.klighd.kgraph.KEdge; import de.cau.cs.kieler.klighd.kgraph.KGraphData; import de.cau.cs.kieler.klighd.kgraph.KLabel; @@ -118,7 +117,7 @@ public final class LabelDecorationConfigurator { /** The layout mode to use. */ private LayoutMode layoutMode = LayoutMode.BOTH; /** Rendering providers that contribute decorations. */ - private List decoratorRenderingProviders = Lists.newArrayList(); + private List decoratorRenderingProviders = new ArrayList<>(); /** Default decoration if there's nothing else available. */ private IDecoratorRenderingProvider defaultDecorator = RectangleDecorator.create(); /** Rendering provider for the actual label text. */ diff --git a/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/labels/management/LabelManagementUtil.java b/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/labels/management/LabelManagementUtil.java index 273d7a671..6a56b03a6 100644 --- a/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/labels/management/LabelManagementUtil.java +++ b/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/labels/management/LabelManagementUtil.java @@ -23,7 +23,6 @@ import com.google.common.collect.Iterators; -import de.cau.cs.kieler.klighd.KlighdOptions; import de.cau.cs.kieler.klighd.krendering.KRendering; import de.cau.cs.kieler.klighd.krendering.KRenderingOptions; import de.cau.cs.kieler.klighd.krendering.KRenderingUtil; diff --git a/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/labels/management/ListLabelManager.java b/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/labels/management/ListLabelManager.java index 0c86fbd72..a243ba59b 100644 --- a/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/labels/management/ListLabelManager.java +++ b/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/labels/management/ListLabelManager.java @@ -16,13 +16,12 @@ */ package de.cau.cs.kieler.klighd.labels.management; +import java.util.ArrayList; import java.util.List; import java.util.Objects; import org.eclipse.elk.graph.ElkLabel; -import com.google.common.collect.Lists; - /** * Takes a list of label managers that do the work of resizing labels. The label managers are asked * to manage a given label in the order they appear in in the list. If a label manager actually does @@ -40,7 +39,7 @@ public class ListLabelManager extends AbstractKlighdLabelManager { /** The label managers used to manage the labels in the graph. */ - private final List labelManagers = Lists.newArrayList(); + private final List labelManagers = new ArrayList<>(); /** Whether only the first label manager that actually changes the label's text is executed. */ private boolean stopOnFirstHit = true; diff --git a/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/microlayout/GridPlacementUtil.java b/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/microlayout/GridPlacementUtil.java index de9b593ab..8269eb6a6 100644 --- a/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/microlayout/GridPlacementUtil.java +++ b/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/microlayout/GridPlacementUtil.java @@ -21,8 +21,9 @@ import static de.cau.cs.kieler.klighd.krendering.KRenderingUtil.getPlacementData; import static de.cau.cs.kieler.klighd.microlayout.PlacementUtil.basicEstimateSize; +import java.util.ArrayDeque; import java.util.Arrays; -import java.util.LinkedList; +import java.util.Deque; import java.util.List; import org.eclipse.elk.core.math.ElkMath; @@ -30,8 +31,6 @@ import org.eclipse.elk.graph.properties.IProperty; import org.eclipse.elk.graph.properties.Property; -import com.google.common.collect.Lists; - import de.cau.cs.kieler.klighd.krendering.KContainerRendering; import de.cau.cs.kieler.klighd.krendering.KGridPlacement; import de.cau.cs.kieler.klighd.krendering.KGridPlacementData; @@ -478,7 +477,7 @@ public static Bounds estimateGridSize(final KContainerRendering container, final int row = k / numColumns; final int col = k - row * numColumns; - final LinkedList path = Lists.newLinkedList(); + final Deque path = new ArrayDeque<>(); if (PlacementUtil.findChildArea(currentChild, path)) { // if a childArea is contained in the current child (or the child itself is a childarea) // remember the position of the area to be able to calculate diff --git a/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/microlayout/PlacementUtil.java b/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/microlayout/PlacementUtil.java index 43d400f9f..f97e316f3 100644 --- a/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/microlayout/PlacementUtil.java +++ b/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/microlayout/PlacementUtil.java @@ -29,6 +29,10 @@ import java.awt.geom.Point2D; import java.awt.geom.Rectangle2D; import java.awt.image.BufferedImage; +import java.util.ArrayDeque; +import java.util.ArrayList; +import java.util.Deque; +import java.util.HashMap; import java.util.Iterator; import java.util.LinkedList; import java.util.List; @@ -48,8 +52,6 @@ import com.google.common.base.Strings; import com.google.common.collect.Iterables; import com.google.common.collect.Iterators; -import com.google.common.collect.Lists; -import com.google.common.collect.Maps; import de.cau.cs.kieler.klighd.Klighd; import de.cau.cs.kieler.klighd.KlighdConstants; @@ -843,7 +845,7 @@ private static FontData fontDataFor(final KText kText, final KGraphElement graph if (kText != null) { // the following lines look for font styles propagated from parents // TODO also make allowance of styles propagated via KRenderingRefs - final List styles = Lists.newLinkedList(kText.getStyles()); + final List styles = new ArrayList<>(kText.getStyles()); for (final KRendering k : Iterables2.toIterable(Iterators.filter( ModelingUtil.eAllContainers(kText), KRendering.class))) { Iterables.addAll(styles, Iterables.filter(k.getStyles(), FILTER)); @@ -1017,7 +1019,7 @@ public static Bounds getTestingTextSize(final KText kText) { * A font cache preserving requested font configurations in order to avoid re-instantiation of * {@link Font}, which is assumed to be much more expensive than {@link FontData}. */ - private static final Map FONT_CACHE = Maps.newHashMap(); + private static final Map FONT_CACHE = new HashMap<>(); /** * Two instances of {@link GC} that the text size estimation is delegated to. @@ -1520,7 +1522,7 @@ public static void calculateInsets(final KRendering rootRendering, final KInsets } // find the path to the child area - final LinkedList path = Lists.newLinkedList(); + final Deque path = new ArrayDeque<>(); if (!findChildArea(rootRendering, path)) { // no child area so the whole node is the child area @@ -1673,6 +1675,13 @@ private static Bounds evaluatePolylineBounds(final KPolyline line, final Bounds return Bounds.max(Bounds.of(maxX, maxY), givenBounds); } + /** + * @deprecated Use {@link #findChildArea(KRendering, Deque)} + */ + @Deprecated(forRemoval = true) + public static boolean findChildArea(KRendering rendering, LinkedList path) { + return findChildArea(rendering, (Deque) path); + } /** * Searches the rendering for a child area and records the path in the given list of renderings. @@ -1683,8 +1692,7 @@ private static Bounds evaluatePolylineBounds(final KPolyline line, final Bounds * the list of renderings which will contain the path of renderings to the child area * @return true if a child area has been found; false else */ - public static boolean findChildArea(final KRendering rendering, - final LinkedList path) { + public static boolean findChildArea(final KRendering rendering, final Deque path) { path.addLast(rendering); if (rendering instanceof KChildArea) { return true; diff --git a/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/syntheses/AbstractDiagramSynthesis.java b/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/syntheses/AbstractDiagramSynthesis.java index e446eda77..38d806383 100644 --- a/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/syntheses/AbstractDiagramSynthesis.java +++ b/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/syntheses/AbstractDiagramSynthesis.java @@ -58,7 +58,7 @@ * e.g. for accessing the transformation context, this can be realized by means of Guice, too. The * helper transformation implementation must declare an injected field of type * AbstractDiagramSynthesis<?>, the actual {@link AbstractDiagramSynthesis} implementation - * must be annotated with {@link javax.inject.Singleton @Singleton} on class level. This way the + * must be annotated with {@link com.google.inject.Singleton @Singleton} on class level. This way the * helper classes are provided with the current instance of the main transformation.
*
* Furthermore, diagram syntheses may leverage other ones, e.g. for realizing composed views. This @@ -68,7 +68,7 @@ * {@link com.google.inject.Provider Provider<yourTransformationClass>} can be declared. Each * time calling {@link com.google.inject.Provider#get() get()} on this provider a new instance will * be obtained as long as the provided class is not declared as singleton (via - * {@link javax.inject.Singleton @Singleton}). The + * {@link com.google.inject.Singleton @Singleton}). The * {@link de.cau.cs.kieler.klighd.krendering.ViewSynthesisShared ViewSynthesisShared} * annotation helps if the described feature of employing helper classes is required. * diff --git a/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/syntheses/ReinitializingDiagramSynthesisProxy.java b/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/syntheses/ReinitializingDiagramSynthesisProxy.java index 2d0f293ec..9559966d9 100644 --- a/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/syntheses/ReinitializingDiagramSynthesisProxy.java +++ b/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/syntheses/ReinitializingDiagramSynthesisProxy.java @@ -16,6 +16,7 @@ */ package de.cau.cs.kieler.klighd.syntheses; +import java.util.HashSet; import java.util.List; import java.util.Set; @@ -28,7 +29,6 @@ import com.google.common.base.Function; import com.google.common.collect.Iterables; -import com.google.common.collect.Sets; import com.google.inject.Binder; import com.google.inject.Guice; import com.google.inject.Key; @@ -143,7 +143,7 @@ private class ViewSynthesisScope implements Scope { } private Class> mainTransformationClazz = null; - private Set instances = Sets.newHashSet(); + private Set instances = new HashSet<>(); private void clear() { this.instances.clear(); diff --git a/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/util/Iterables2.java b/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/util/Iterables2.java index c9c526398..bd19851a1 100644 --- a/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/util/Iterables2.java +++ b/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/util/Iterables2.java @@ -16,17 +16,15 @@ */ package de.cau.cs.kieler.klighd.util; +import java.util.ArrayDeque; +import java.util.Collection; import java.util.Iterator; -import java.util.List; import java.util.Queue; +import java.util.stream.Stream; +import java.util.stream.StreamSupport; -import org.eclipse.elk.core.util.Pair; - -import com.google.common.base.Function; import com.google.common.base.Preconditions; -import com.google.common.collect.ImmutableList; import com.google.common.collect.Iterators; -import com.google.common.collect.Lists; /** * This class provides some convenience methods that I miss in @@ -77,39 +75,6 @@ public Iterator iterator() { }; } - /** - * Returns an {@link Iterable} containing only {@code value}.
- * This is a counterpart to {@link com.google.common.collect.Iterators#singletonIterator(Object) - * Iterators#singletonIterator(Object)}.
- * In case {@code value} is {@code null} an empty {@link Iterable} is returned. - * - * @param - * the type of value - * @param value - * the value to be encapsulated - * @return the required {@link Iterable} - */ - public static Iterable singletonIterable(final T value) { - return singletonList(value); - } - - /** - * Returns a {@link List} containing only {@code value}.
- * This is a counterpart to - * {@link com.google.common.collect.Iterators#singletonIterator(Object) - * Iterators#singletonIterator(Object)}.
- * In case {@code value} is {@code null} an empty {@link List} is returned. - * - * @param - * the type of value - * @param value - * the value to be encapsulated, may be null - * @return the required {@link Iterable} - */ - public static List singletonList(final T value) { - return value != null ? ImmutableList.of(value) : ImmutableList.of(); - } - /** * Constructs a new {@link Iterable} containing all elements of iterable except the * last count ones. The provided iterable is lazily evaluated, the @@ -212,7 +177,7 @@ private boolean initialize() { srcIterator = src.iterator(); } - queue = Lists.newLinkedList(); + queue = new ArrayDeque<>(); int i = count; while ((i--) != 0) { @@ -266,34 +231,15 @@ public String toString() { } /** - * Performs a fold operation on the elements of the provided {@link Iterable} by applying - * the provided {@link Function Function<Pair<R, E>, R>} onto each element. + * Returns a sequential {@code Stream} with the given {@link Iterable} as its source. * - * @param - * type of {@code iterable}'s elements - * @param - * type of the result determined by {@code function} - * @param iterable - * the {@link Iterable} containing the particular elements - * @param function - * the {@link Function} to be applied, is called with a {@link Pair} providing the - * value of the previous application ({@link Pair#getFirst() first}, is {@code null} - * for first time), and the particular element of {@code iterable} ( - * {@link Pair#getSecond() second}) - * @return the accumulated result obtained by consecutively applying {@code function} on the - * elements of {@code iterable} and the preliminary result of previous application, - * starting with {@code null} + * @param the type of elements + * @param iterable the iterable + * @return a stream backed by the iterable */ - public static R fold(final Iterable iterable, final Function, R> function) { - - final Pair pair = new Pair(); - R result = null; - - for (final E element : iterable) { - pair.setFirst(result); - pair.setSecond(element); - result = function.apply(pair); - } - return result; + public static Stream stream(Iterable iterable) { + return iterable instanceof Collection // + ? ((Collection) iterable).stream() + : StreamSupport.stream(iterable.spliterator(), false); } } diff --git a/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/util/KlighdSemanticDiagramData.java b/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/util/KlighdSemanticDiagramData.java index 8b74007a0..e37936ee9 100644 --- a/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/util/KlighdSemanticDiagramData.java +++ b/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/util/KlighdSemanticDiagramData.java @@ -18,6 +18,7 @@ import java.util.Collections; import java.util.Iterator; +import java.util.LinkedHashMap; import java.util.Map; import org.eclipse.emf.ecore.EObject; @@ -208,7 +209,7 @@ public KlighdSemanticDiagramData put(final String key, final String value) { } if (strStr == null && value != null) { - strStr = Maps.newLinkedHashMap(); + strStr = new LinkedHashMap<>(); } if (strFun != null && strFun.containsKey(key)) { @@ -259,7 +260,7 @@ public KlighdSemanticDiagramData put(final String key, final Function(); } if (strStr != null && strStr.containsKey(key)) { @@ -319,7 +320,7 @@ public KlighdSemanticDiagramData putAtTextLine( } if (strFunTextLine == null && fun != null) { - strFunTextLine = Maps.newLinkedHashMap(); + strFunTextLine = new LinkedHashMap<>(); } if (strFunTextLine != null) { diff --git a/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/util/KlighdSynthesisProperties.java b/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/util/KlighdSynthesisProperties.java index 015037e21..ff86391e7 100644 --- a/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/util/KlighdSynthesisProperties.java +++ b/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/util/KlighdSynthesisProperties.java @@ -16,6 +16,7 @@ */ package de.cau.cs.kieler.klighd.util; +import java.util.HashMap; import java.util.Map; import org.eclipse.elk.graph.properties.IProperty; @@ -23,8 +24,6 @@ import org.eclipse.elk.graph.properties.MapPropertyHolder; import org.eclipse.elk.graph.properties.Property; -import com.google.common.collect.Maps; - import de.cau.cs.kieler.klighd.SynthesisOption; import de.cau.cs.kieler.klighd.krendering.SimpleUpdateStrategy; @@ -359,7 +358,7 @@ public KlighdSynthesisProperties configureSynthesisOptionValue( final SynthesisOption option, final Object value) { Map optionConfig = this.getProperty(SYNTHESIS_OPTION_CONFIG); if (optionConfig == null) { - optionConfig = Maps.newHashMap(); + optionConfig = new HashMap<>(); this.setProperty(SYNTHESIS_OPTION_CONFIG, optionConfig); } optionConfig.put(option, value); @@ -378,7 +377,7 @@ public KlighdSynthesisProperties configureSynthesisOptionValues( final Map options) { Map optionConfig = this.getProperty(SYNTHESIS_OPTION_CONFIG); if (optionConfig == null) { - optionConfig = Maps.newHashMap(); + optionConfig = new HashMap<>(); this.setProperty(SYNTHESIS_OPTION_CONFIG, optionConfig); } optionConfig.putAll(options); diff --git a/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/viewers/AbstractViewer.java b/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/viewers/AbstractViewer.java index db7e06b34..1d25d2359 100644 --- a/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/viewers/AbstractViewer.java +++ b/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/viewers/AbstractViewer.java @@ -19,6 +19,7 @@ import java.awt.geom.Rectangle2D; import java.util.Arrays; import java.util.EnumSet; +import java.util.HashMap; import java.util.Iterator; import java.util.Map; import java.util.Set; @@ -28,7 +29,6 @@ import com.google.common.base.Predicates; import com.google.common.collect.HashMultimap; import com.google.common.collect.Iterables; -import com.google.common.collect.Maps; import com.google.common.collect.Multimap; import com.google.common.collect.Multimaps; import com.google.common.collect.SetMultimap; @@ -133,7 +133,7 @@ private void addViewChangeListener(final IViewChangeListener listener, // implemented by HashMultiMap. // It is guaranteed in the API and clients rely on that! viewChangeListeners = HashMultimap.create(); - notificationSuppressions = Maps.newHashMap(); + notificationSuppressions = new HashMap<>(); } for (final ViewChangeType t : eventTypes) { diff --git a/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/viewers/ContextViewer.java b/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/viewers/ContextViewer.java index f1eb247e3..f2598b498 100644 --- a/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/viewers/ContextViewer.java +++ b/plugins/de.cau.cs.kieler.klighd/src/de/cau/cs/kieler/klighd/viewers/ContextViewer.java @@ -28,6 +28,7 @@ import java.util.Collections; import java.util.EnumSet; import java.util.Iterator; +import java.util.LinkedHashSet; import java.util.List; import java.util.Set; @@ -948,7 +949,7 @@ protected void createSelection(final Collection elements) { /** the selection listeners registered on this view. */ // don't change the type to a collection type violating the Set property // see doc of 'ISelectionProvider.addSelectionChangedListener(...)' - private Set selectionListeners = Sets.newLinkedHashSet(); + private Set selectionListeners = new LinkedHashSet<>(); /** * Notifies the registered {@link ISelectionChangedListener ISelectionChangedListeners}. Such diff --git a/plugins/pom.xml b/plugins/pom.xml index 1a1fb1332..34f08178d 100644 --- a/plugins/pom.xml +++ b/plugins/pom.xml @@ -9,7 +9,7 @@ de.cau.cs.kieler.klighd parent - 2.3.1-SNAPSHOT + 3.0.3-SNAPSHOT diff --git a/pom.xml b/pom.xml index 3d7756eb3..cf2591e64 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 de.cau.cs.kieler.klighd parent - 2.3.1-SNAPSHOT + 3.0.3-SNAPSHOT pom @@ -23,6 +23,7 @@ plugins/de.cau.cs.kieler.klighd.krendering.extensions plugins/de.cau.cs.kieler.klighd.lsp plugins/de.cau.cs.kieler.klighd.piccolo + plugins/de.cau.cs.kieler.klighd.setup plugins/de.cau.cs.kieler.klighd.standalone test/de.cau.cs.kieler.klighd.test test/de.cau.cs.kieler.klighd.piccolo.test @@ -51,24 +52,26 @@ - 3.18.0 - 3.26.0 - 0.8.1 - 2.26.0 - 2.28.0 - 2.17.0 - 2.9.0 - 31.1-jre - 5.1.0 - 3.27.0 - 0.15.0 - 0.9.0 + 0.9.1 + 2.10.1 + 32.1.3-jre + 7.0.0 + 3.32.0 + 0.22.0 + 1.1.2 0.1.0 - 3.121.0 + 3.124.200 2.7.3 - 3.126.0 - 2.28.0 - 2.28.0 + 2.33.0 + 2.33.0 + + + 3.20.0 + 3.30.0 + 2.29.0 + 2.35.0 + 2.20.0 + 3.131.0 @@ -80,12 +83,10 @@ UTF-8 UTF-8 - - 1.8 + + 11 - - + 11 @@ -155,6 +156,7 @@ https://s01.oss.sonatype.org/ false + 10 @@ -189,7 +191,7 @@ org.eclipse.platform org.eclipse.ui.workbench - 3.110.0 + ${ui-workbench-version} org.eclipse.platform @@ -217,12 +219,18 @@ org.eclipse.platform org.eclipse.e4.ui.workbench.renderers.swt - 0.15.600 + 0.16.100 org.eclipse.emf org.eclipse.emf.ecore.change - 2.14.0 + 2.15.0 + + + + xml-apis + xml-apis-ext + 1.3.04 @@ -251,6 +259,15 @@ + + + . + + META-INF/services/** + + + + src @@ -288,7 +305,7 @@ de.cau.cs.kieler.klighd de.cau.cs.kieler.klighd.targetplatform - 2.3.1-SNAPSHOT + 3.0.3-SNAPSHOT @@ -331,7 +348,7 @@ org.eclipse.xtend xtend-maven-plugin - ${xtext-version} + ${xtend-version} @@ -373,7 +390,7 @@ org.codehaus.mojo build-helper-maven-plugin - 1.3 + 3.5.0 add-source @@ -397,6 +414,7 @@ maven-javadoc-plugin 3.5.0 + 8 diff --git a/test/de.cau.cs.kieler.klighd.piccolo.test/.classpath b/test/de.cau.cs.kieler.klighd.piccolo.test/.classpath index 428337e56..47ce7cd07 100644 --- a/test/de.cau.cs.kieler.klighd.piccolo.test/.classpath +++ b/test/de.cau.cs.kieler.klighd.piccolo.test/.classpath @@ -1,6 +1,6 @@ - + diff --git a/test/de.cau.cs.kieler.klighd.piccolo.test/.settings/org.eclipse.core.resources.prefs b/test/de.cau.cs.kieler.klighd.piccolo.test/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 000000000..99f26c020 --- /dev/null +++ b/test/de.cau.cs.kieler.klighd.piccolo.test/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/test/de.cau.cs.kieler.klighd.piccolo.test/META-INF/MANIFEST.MF b/test/de.cau.cs.kieler.klighd.piccolo.test/META-INF/MANIFEST.MF index 20a66716d..50ab023f9 100644 --- a/test/de.cau.cs.kieler.klighd.piccolo.test/META-INF/MANIFEST.MF +++ b/test/de.cau.cs.kieler.klighd.piccolo.test/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: KLighD Piccolo2D Binding Tests Bundle-SymbolicName: de.cau.cs.kieler.klighd.piccolo.test;singleton:=true -Bundle-Version: 2.3.1.qualifier +Bundle-Version: 3.0.3.qualifier Bundle-Vendor: Kiel University Bundle-RequiredExecutionEnvironment: JavaSE-11 Require-Bundle: org.junit;bundle-version="4.8.0", diff --git a/test/de.cau.cs.kieler.klighd.piccolo.test/pom.xml b/test/de.cau.cs.kieler.klighd.piccolo.test/pom.xml index 6e48ffc5a..ea31b464f 100644 --- a/test/de.cau.cs.kieler.klighd.piccolo.test/pom.xml +++ b/test/de.cau.cs.kieler.klighd.piccolo.test/pom.xml @@ -5,11 +5,10 @@ de.cau.cs.kieler.klighd test - 2.3.1-SNAPSHOT + 3.0.3-SNAPSHOT - de.cau.cs.kieler.klighd + de.cau.cs.kieler.klighd.piccolo.test - 2.3.1-SNAPSHOT eclipse-test-plugin src @@ -34,6 +33,12 @@ de.cau.cs.kieler.klighd.piccolo.freehep 0.0.0 + + + eclipse-plugin + javax.annotation + 0.0.0 + diff --git a/test/de.cau.cs.kieler.klighd.piccolo.test/runConfigs/AdapterTest.launch b/test/de.cau.cs.kieler.klighd.piccolo.test/runConfigs/AdapterTest.launch index c8f09e5ab..eccfcc1b8 100644 --- a/test/de.cau.cs.kieler.klighd.piccolo.test/runConfigs/AdapterTest.launch +++ b/test/de.cau.cs.kieler.klighd.piccolo.test/runConfigs/AdapterTest.launch @@ -1,45 +1,185 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/de.cau.cs.kieler.klighd.piccolo.test/runConfigs/DiagramClipGlobalPortLabelVisiblityConfigTest.launch b/test/de.cau.cs.kieler.klighd.piccolo.test/runConfigs/DiagramClipGlobalPortLabelVisiblityConfigTest.launch index d4eb4e7ed..7ae5919f5 100644 --- a/test/de.cau.cs.kieler.klighd.piccolo.test/runConfigs/DiagramClipGlobalPortLabelVisiblityConfigTest.launch +++ b/test/de.cau.cs.kieler.klighd.piccolo.test/runConfigs/DiagramClipGlobalPortLabelVisiblityConfigTest.launch @@ -1,45 +1,185 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/de.cau.cs.kieler.klighd.piccolo.test/runConfigs/DiagramClipPortLabelVisibilityTest.launch b/test/de.cau.cs.kieler.klighd.piccolo.test/runConfigs/DiagramClipPortLabelVisibilityTest.launch index bae5b84aa..366712e58 100644 --- a/test/de.cau.cs.kieler.klighd.piccolo.test/runConfigs/DiagramClipPortLabelVisibilityTest.launch +++ b/test/de.cau.cs.kieler.klighd.piccolo.test/runConfigs/DiagramClipPortLabelVisibilityTest.launch @@ -1,45 +1,185 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/de.cau.cs.kieler.klighd.piccolo.test/runConfigs/DiagramClipTest.launch b/test/de.cau.cs.kieler.klighd.piccolo.test/runConfigs/DiagramClipTest.launch index 100cc1857..6a2478e9f 100644 --- a/test/de.cau.cs.kieler.klighd.piccolo.test/runConfigs/DiagramClipTest.launch +++ b/test/de.cau.cs.kieler.klighd.piccolo.test/runConfigs/DiagramClipTest.launch @@ -1,45 +1,185 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/de.cau.cs.kieler.klighd.piccolo.test/runConfigs/DiagramZoomControllerBoundsComputerTest.launch b/test/de.cau.cs.kieler.klighd.piccolo.test/runConfigs/DiagramZoomControllerBoundsComputerTest.launch index 5d418e96a..7729d79ed 100644 --- a/test/de.cau.cs.kieler.klighd.piccolo.test/runConfigs/DiagramZoomControllerBoundsComputerTest.launch +++ b/test/de.cau.cs.kieler.klighd.piccolo.test/runConfigs/DiagramZoomControllerBoundsComputerTest.launch @@ -1,45 +1,185 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/de.cau.cs.kieler.klighd.piccolo.test/runConfigs/FreeHEPSVGOffscreenRenderingTest.launch b/test/de.cau.cs.kieler.klighd.piccolo.test/runConfigs/FreeHEPSVGOffscreenRenderingTest.launch index 3a6c88b70..ed23bf4cc 100644 --- a/test/de.cau.cs.kieler.klighd.piccolo.test/runConfigs/FreeHEPSVGOffscreenRenderingTest.launch +++ b/test/de.cau.cs.kieler.klighd.piccolo.test/runConfigs/FreeHEPSVGOffscreenRenderingTest.launch @@ -15,6 +15,7 @@ + @@ -25,8 +26,10 @@ + + - + @@ -36,21 +39,23 @@ + - - + + + - + @@ -65,11 +70,8 @@ - - - @@ -90,9 +92,9 @@ + - @@ -113,21 +115,20 @@ + + + - - - + - - @@ -138,26 +139,40 @@ - + + + - - - - + + + + + + + + + + + + + + + + + - diff --git a/test/de.cau.cs.kieler.klighd.piccolo.test/runConfigs/HighlightedEdgeToForegroundTest.launch b/test/de.cau.cs.kieler.klighd.piccolo.test/runConfigs/HighlightedEdgeToForegroundTest.launch index 1eaf256d3..cee8dc0da 100644 --- a/test/de.cau.cs.kieler.klighd.piccolo.test/runConfigs/HighlightedEdgeToForegroundTest.launch +++ b/test/de.cau.cs.kieler.klighd.piccolo.test/runConfigs/HighlightedEdgeToForegroundTest.launch @@ -15,6 +15,7 @@ + @@ -25,8 +26,10 @@ + + - + @@ -36,21 +39,23 @@ + - - + + + - + @@ -65,12 +70,9 @@ - - - @@ -90,9 +92,9 @@ + - @@ -113,21 +115,20 @@ + + + - - - + - - @@ -138,20 +139,35 @@ - + + + - - - - + + + + + + + + + + + + + + + + + diff --git a/test/de.cau.cs.kieler.klighd.piccolo.test/runConfigs/RenderingTest.launch b/test/de.cau.cs.kieler.klighd.piccolo.test/runConfigs/RenderingTest.launch index 291428ba0..3f01f996a 100644 --- a/test/de.cau.cs.kieler.klighd.piccolo.test/runConfigs/RenderingTest.launch +++ b/test/de.cau.cs.kieler.klighd.piccolo.test/runConfigs/RenderingTest.launch @@ -1,45 +1,185 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/de.cau.cs.kieler.klighd.piccolo.test/runConfigs/de.cau.cs.kieler.klighd.piccolo.test.launch b/test/de.cau.cs.kieler.klighd.piccolo.test/runConfigs/de.cau.cs.kieler.klighd.piccolo.test.launch index acc444dc5..2ae7622ee 100644 --- a/test/de.cau.cs.kieler.klighd.piccolo.test/runConfigs/de.cau.cs.kieler.klighd.piccolo.test.launch +++ b/test/de.cau.cs.kieler.klighd.piccolo.test/runConfigs/de.cau.cs.kieler.klighd.piccolo.test.launch @@ -1,45 +1,185 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/de.cau.cs.kieler.klighd.piccolo.test/src/de/cau/cs/kieler/klighd/piccolo/test/ApplyBendPointsActivityTest.java b/test/de.cau.cs.kieler.klighd.piccolo.test/src/de/cau/cs/kieler/klighd/piccolo/test/ApplyBendPointsActivityTest.java index 3ef0ac00f..412c3a593 100644 --- a/test/de.cau.cs.kieler.klighd.piccolo.test/src/de/cau/cs/kieler/klighd/piccolo/test/ApplyBendPointsActivityTest.java +++ b/test/de.cau.cs.kieler.klighd.piccolo.test/src/de/cau/cs/kieler/klighd/piccolo/test/ApplyBendPointsActivityTest.java @@ -18,12 +18,11 @@ import java.awt.geom.Point2D; import java.util.Arrays; +import java.util.List; import org.junit.Assert; import org.junit.Test; -import com.google.common.collect.Lists; - import de.cau.cs.kieler.klighd.kgraph.KEdge; import de.cau.cs.kieler.klighd.kgraph.KNode; import de.cau.cs.kieler.klighd.kgraph.util.KGraphUtil; @@ -49,7 +48,7 @@ private KEdgeNode prepareEdge(final Point2D[] currentBends) { KNode node0 = KGraphUtil.createInitializedNode(); KNode node1 = KGraphUtil.createInitializedNode(); KNode node2 = KGraphUtil.createInitializedNode(); - node0.getChildren().addAll(Lists.newArrayList(node1, node2)); + node0.getChildren().addAll(List.of(node1, node2)); KEdge edge = KGraphUtil.createInitializedEdge(); edge.setSource(node1); diff --git a/test/de.cau.cs.kieler.klighd.piccolo.test/src/de/cau/cs/kieler/klighd/piccolo/test/DiagramClipGlobalPortLabelVisiblityConfigTest.java b/test/de.cau.cs.kieler.klighd.piccolo.test/src/de/cau/cs/kieler/klighd/piccolo/test/DiagramClipGlobalPortLabelVisiblityConfigTest.java index 6aea78f73..e3fb969b4 100644 --- a/test/de.cau.cs.kieler.klighd.piccolo.test/src/de/cau/cs/kieler/klighd/piccolo/test/DiagramClipGlobalPortLabelVisiblityConfigTest.java +++ b/test/de.cau.cs.kieler.klighd.piccolo.test/src/de/cau/cs/kieler/klighd/piccolo/test/DiagramClipGlobalPortLabelVisiblityConfigTest.java @@ -53,8 +53,6 @@ import org.junit.runners.Parameterized.Parameters; import com.google.common.collect.Iterables; -import com.google.common.collect.Lists; - import de.cau.cs.kieler.klighd.IDiagramWorkbenchPart; import de.cau.cs.kieler.klighd.IViewer; import de.cau.cs.kieler.klighd.ViewContext; @@ -136,7 +134,7 @@ public static Iterable getParameters() { final KNode orOp = circuitGraph.getChildren().get(0).getChildren().get(0).getChildren().get(1); final KNode notOp = circuitGraph.getChildren().get(0).getChildren().get(1); - final List clips = Lists.newArrayList( + final List clips = List.of( /** in circuit content ports are set invisible by default in view model */ clip(circuitContent, EXPECT_PORTS_INVISIBLE), clip(circuitContent, SHOW_PORTS, EXPECT_PORTS_VISIBLE), diff --git a/test/de.cau.cs.kieler.klighd.piccolo.test/src/de/cau/cs/kieler/klighd/piccolo/test/DiagramClipPortLabelVisibilityTest.java b/test/de.cau.cs.kieler.klighd.piccolo.test/src/de/cau/cs/kieler/klighd/piccolo/test/DiagramClipPortLabelVisibilityTest.java index 6c2a25f62..a18202acf 100644 --- a/test/de.cau.cs.kieler.klighd.piccolo.test/src/de/cau/cs/kieler/klighd/piccolo/test/DiagramClipPortLabelVisibilityTest.java +++ b/test/de.cau.cs.kieler.klighd.piccolo.test/src/de/cau/cs/kieler/klighd/piccolo/test/DiagramClipPortLabelVisibilityTest.java @@ -53,7 +53,6 @@ import org.junit.runners.Parameterized.Parameters; import com.google.common.collect.Iterables; -import com.google.common.collect.Lists; import de.cau.cs.kieler.klighd.IDiagramWorkbenchPart; import de.cau.cs.kieler.klighd.IViewer; @@ -136,7 +135,7 @@ public static Iterable getParameters() { compoundOp.setProperty(SHOW_CLIPPED_LABELS, false); andOp.setProperty(SHOW_CLIPPED_PORTS, false); - final List clips = Lists.newArrayList( + final List clips = List.of( clip(circuitGraph), /** in circuit content ports are set invisible by default in view model */ diff --git a/test/de.cau.cs.kieler.klighd.piccolo.test/src/de/cau/cs/kieler/klighd/piccolo/test/DiagramClipTest.java b/test/de.cau.cs.kieler.klighd.piccolo.test/src/de/cau/cs/kieler/klighd/piccolo/test/DiagramClipTest.java index e18909ecb..49597ba45 100644 --- a/test/de.cau.cs.kieler.klighd.piccolo.test/src/de/cau/cs/kieler/klighd/piccolo/test/DiagramClipTest.java +++ b/test/de.cau.cs.kieler.klighd.piccolo.test/src/de/cau/cs/kieler/klighd/piccolo/test/DiagramClipTest.java @@ -40,8 +40,6 @@ import com.google.common.base.Function; import com.google.common.collect.Iterables; -import com.google.common.collect.Lists; - import de.cau.cs.kieler.klighd.IDiagramWorkbenchPart; import de.cau.cs.kieler.klighd.IViewer; import de.cau.cs.kieler.klighd.ViewContext; @@ -108,7 +106,7 @@ public static Iterable getParameters() { final KNode notOp = circuitGraph.getChildren().get(0).getChildren().get(1); final List clips = - Lists.newArrayList(andOp, orOp, notOp, circuitGraph, notOp, andOp, orOp, notOp, + List.of(andOp, orOp, notOp, circuitGraph, notOp, andOp, orOp, notOp, circuitGraph, notOp, orOp, andOp, circuitGraph, FINISH); final Iterable result = Iterables.transform(clips, new Function() { diff --git a/test/de.cau.cs.kieler.klighd.piccolo.test/src/de/cau/cs/kieler/klighd/piccolo/test/DiagramZoomControllerBoundsComputerTest.java b/test/de.cau.cs.kieler.klighd.piccolo.test/src/de/cau/cs/kieler/klighd/piccolo/test/DiagramZoomControllerBoundsComputerTest.java index 4fb68707c..3d669732b 100644 --- a/test/de.cau.cs.kieler.klighd.piccolo.test/src/de/cau/cs/kieler/klighd/piccolo/test/DiagramZoomControllerBoundsComputerTest.java +++ b/test/de.cau.cs.kieler.klighd.piccolo.test/src/de/cau/cs/kieler/klighd/piccolo/test/DiagramZoomControllerBoundsComputerTest.java @@ -22,6 +22,7 @@ import java.awt.Rectangle; import java.awt.geom.Rectangle2D; +import java.util.List; import org.eclipse.elk.core.math.KVector; import org.eclipse.elk.core.util.Maybe; @@ -109,7 +110,7 @@ public static Iterable getParameters() { final KNode compoundOp = circuitGraph.getChildren().get(0).getChildren().get(0); // x=94.0, y=22.0 width=111.0, height=122.0, label at y=127.0, height=10.0 final KNode andOp = circuitGraph.getChildren().get(0).getChildren().get(0).getChildren().get(0); // x=46.0, y=76.67, width=40.0, height=30.0 - final Iterable clips = Lists.newArrayList( + final Iterable clips = List.of( // node instruction bb fit content bb fit entirely // the andOp has no children and and no node labels, // so clipping with ports + labels yields the ports' bounding box for 'fit content', and an enlarged bb for 'fit entirely' diff --git a/test/de.cau.cs.kieler.klighd.piccolo.test/src/de/cau/cs/kieler/klighd/piccolo/test/highlightedEdgeToForeground/HighlightedEdgeToForegroundTestModelGen.xtend b/test/de.cau.cs.kieler.klighd.piccolo.test/src/de/cau/cs/kieler/klighd/piccolo/test/highlightedEdgeToForeground/HighlightedEdgeToForegroundTestModelGen.xtend index f84ca0981..6f32a8ee4 100644 --- a/test/de.cau.cs.kieler.klighd.piccolo.test/src/de/cau/cs/kieler/klighd/piccolo/test/highlightedEdgeToForeground/HighlightedEdgeToForegroundTestModelGen.xtend +++ b/test/de.cau.cs.kieler.klighd.piccolo.test/src/de/cau/cs/kieler/klighd/piccolo/test/highlightedEdgeToForeground/HighlightedEdgeToForegroundTestModelGen.xtend @@ -16,6 +16,7 @@ */ package de.cau.cs.kieler.klighd.piccolo.test.highlightedEdgeToForeground +import com.google.inject.Inject import de.cau.cs.kieler.klighd.kgraph.KNode import de.cau.cs.kieler.klighd.kgraph.KPort import de.cau.cs.kieler.klighd.krendering.Colors @@ -23,7 +24,6 @@ import de.cau.cs.kieler.klighd.krendering.extensions.KEdgeExtensions import de.cau.cs.kieler.klighd.krendering.extensions.KNodeExtensions import de.cau.cs.kieler.klighd.krendering.extensions.KPortExtensions import de.cau.cs.kieler.klighd.krendering.extensions.KRenderingExtensions -import javax.inject.Inject import org.eclipse.elk.core.options.EdgeRouting import org.eclipse.elk.core.options.PortConstraints import org.eclipse.elk.core.options.PortSide diff --git a/test/de.cau.cs.kieler.klighd.test/.classpath b/test/de.cau.cs.kieler.klighd.test/.classpath index eca7bdba8..e801ebfb4 100644 --- a/test/de.cau.cs.kieler.klighd.test/.classpath +++ b/test/de.cau.cs.kieler.klighd.test/.classpath @@ -1,6 +1,6 @@ - + diff --git a/test/de.cau.cs.kieler.klighd.test/.settings/org.eclipse.core.resources.prefs b/test/de.cau.cs.kieler.klighd.test/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 000000000..99f26c020 --- /dev/null +++ b/test/de.cau.cs.kieler.klighd.test/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding/=UTF-8 diff --git a/test/de.cau.cs.kieler.klighd.test/META-INF/MANIFEST.MF b/test/de.cau.cs.kieler.klighd.test/META-INF/MANIFEST.MF index abf2acd1e..b7296cae0 100644 --- a/test/de.cau.cs.kieler.klighd.test/META-INF/MANIFEST.MF +++ b/test/de.cau.cs.kieler.klighd.test/META-INF/MANIFEST.MF @@ -2,16 +2,17 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: KLighD Tests Bundle-SymbolicName: de.cau.cs.kieler.klighd.test;singleton:=true -Bundle-Version: 2.3.1.qualifier -Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Bundle-Version: 3.0.3.qualifier +Bundle-RequiredExecutionEnvironment: JavaSE-11 Require-Bundle: org.junit;bundle-version="4.8.0", org.eclipse.core.runtime, org.eclipse.elk.core.service, - org.hamcrest.library, + org.hamcrest.library;bundle-version="[0.0.0,2.0.0)", + org.hamcrest.core;bundle-version="[0.0.0,2.0.0)", de.cau.cs.kieler.klighd, de.cau.cs.kieler.klighd.incremental;resolution:=optional, de.cau.cs.kieler.klighd.piccolo;resolution:=optional, - de.cau.cs.kieler.klighd.standalone;resolution:=optional;visibility:=reexport, + de.cau.cs.kieler.klighd.setup;resolution:=optional;visibility:=reexport, de.cau.cs.kieler.kgraph.text Export-Package: de.cau.cs.kieler.klighd.test, de.cau.cs.kieler.klighd.test.runners diff --git a/test/de.cau.cs.kieler.klighd.test/pom.xml b/test/de.cau.cs.kieler.klighd.test/pom.xml index 05c1bd1f0..6c2da6385 100644 --- a/test/de.cau.cs.kieler.klighd.test/pom.xml +++ b/test/de.cau.cs.kieler.klighd.test/pom.xml @@ -5,11 +5,10 @@ de.cau.cs.kieler.klighd test - 2.3.1-SNAPSHOT + 3.0.3-SNAPSHOT - de.cau.cs.kieler.klighd + de.cau.cs.kieler.klighd.test - 2.3.1-SNAPSHOT eclipse-test-plugin @@ -26,6 +25,12 @@ org.eclipse.elk.alg.layered ${elk-version} + + + eclipse-plugin + javax.annotation + 0.0.0 + diff --git a/test/de.cau.cs.kieler.klighd.test/runConfigs/ConnectedEdgesTest.launch b/test/de.cau.cs.kieler.klighd.test/runConfigs/ConnectedEdgesTest.launch index b0cc24401..13b08295a 100644 --- a/test/de.cau.cs.kieler.klighd.test/runConfigs/ConnectedEdgesTest.launch +++ b/test/de.cau.cs.kieler.klighd.test/runConfigs/ConnectedEdgesTest.launch @@ -1,45 +1,184 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/de.cau.cs.kieler.klighd.test/runConfigs/IncrementalUpdateTest.launch b/test/de.cau.cs.kieler.klighd.test/runConfigs/IncrementalUpdateTest.launch index 635496efb..c18cf4ef5 100644 --- a/test/de.cau.cs.kieler.klighd.test/runConfigs/IncrementalUpdateTest.launch +++ b/test/de.cau.cs.kieler.klighd.test/runConfigs/IncrementalUpdateTest.launch @@ -1,153 +1,177 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/de.cau.cs.kieler.klighd.test/runConfigs/Iterables2Test.launch b/test/de.cau.cs.kieler.klighd.test/runConfigs/Iterables2Test.launch index 2acd2050d..c41fa7c4f 100644 --- a/test/de.cau.cs.kieler.klighd.test/runConfigs/Iterables2Test.launch +++ b/test/de.cau.cs.kieler.klighd.test/runConfigs/Iterables2Test.launch @@ -1,45 +1,184 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/de.cau.cs.kieler.klighd.test/runConfigs/KGraphUtilTest.launch b/test/de.cau.cs.kieler.klighd.test/runConfigs/KGraphUtilTest.launch index 12b9c64bc..947408325 100644 --- a/test/de.cau.cs.kieler.klighd.test/runConfigs/KGraphUtilTest.launch +++ b/test/de.cau.cs.kieler.klighd.test/runConfigs/KGraphUtilTest.launch @@ -1,45 +1,184 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/de.cau.cs.kieler.klighd.test/runConfigs/ModelingUtilTest.launch b/test/de.cau.cs.kieler.klighd.test/runConfigs/ModelingUtilTest.launch index aad6b0db1..156c447c2 100644 --- a/test/de.cau.cs.kieler.klighd.test/runConfigs/ModelingUtilTest.launch +++ b/test/de.cau.cs.kieler.klighd.test/runConfigs/ModelingUtilTest.launch @@ -1,45 +1,184 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/de.cau.cs.kieler.klighd.test/runConfigs/SizeEstimationTest.launch b/test/de.cau.cs.kieler.klighd.test/runConfigs/SizeEstimationTest.launch index 9b3cb36fd..9a9ab3be5 100644 --- a/test/de.cau.cs.kieler.klighd.test/runConfigs/SizeEstimationTest.launch +++ b/test/de.cau.cs.kieler.klighd.test/runConfigs/SizeEstimationTest.launch @@ -1,45 +1,184 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/de.cau.cs.kieler.klighd.test/runConfigs/SizeEstimationTestWithFailings.launch b/test/de.cau.cs.kieler.klighd.test/runConfigs/SizeEstimationTestWithFailings.launch index 9b27a8b7c..002d29cea 100644 --- a/test/de.cau.cs.kieler.klighd.test/runConfigs/SizeEstimationTestWithFailings.launch +++ b/test/de.cau.cs.kieler.klighd.test/runConfigs/SizeEstimationTestWithFailings.launch @@ -1,45 +1,184 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/de.cau.cs.kieler.klighd.test/runConfigs/ViewChangedNotificationSuppressionTest.launch b/test/de.cau.cs.kieler.klighd.test/runConfigs/ViewChangedNotificationSuppressionTest.launch index 8014f08cb..66b7db84d 100644 --- a/test/de.cau.cs.kieler.klighd.test/runConfigs/ViewChangedNotificationSuppressionTest.launch +++ b/test/de.cau.cs.kieler.klighd.test/runConfigs/ViewChangedNotificationSuppressionTest.launch @@ -1,45 +1,184 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/de.cau.cs.kieler.klighd.test/runConfigs/ViewChangedNotificationTest.launch b/test/de.cau.cs.kieler.klighd.test/runConfigs/ViewChangedNotificationTest.launch index 4067eb61c..1a302c429 100644 --- a/test/de.cau.cs.kieler.klighd.test/runConfigs/ViewChangedNotificationTest.launch +++ b/test/de.cau.cs.kieler.klighd.test/runConfigs/ViewChangedNotificationTest.launch @@ -15,6 +15,7 @@ + @@ -25,8 +26,10 @@ + + - + @@ -36,21 +39,23 @@ + - - + + + - + @@ -65,12 +70,9 @@ - - - @@ -90,9 +92,9 @@ + - @@ -113,21 +115,20 @@ + + + - - - + - - @@ -138,20 +139,36 @@ - + + + - - - - + + + + + + + + + + + + + + + + + + diff --git a/test/de.cau.cs.kieler.klighd.test/runConfigs/ViewContextSourceModelTrackingTest.launch b/test/de.cau.cs.kieler.klighd.test/runConfigs/ViewContextSourceModelTrackingTest.launch index 796e576ff..9e75b4db3 100644 --- a/test/de.cau.cs.kieler.klighd.test/runConfigs/ViewContextSourceModelTrackingTest.launch +++ b/test/de.cau.cs.kieler.klighd.test/runConfigs/ViewContextSourceModelTrackingTest.launch @@ -1,45 +1,185 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/de.cau.cs.kieler.klighd.test/runConfigs/de.cau.cs.kieler.klighd.test.launch b/test/de.cau.cs.kieler.klighd.test/runConfigs/de.cau.cs.kieler.klighd.test.launch index 1a19cb1f7..52f6d0faf 100644 --- a/test/de.cau.cs.kieler.klighd.test/runConfigs/de.cau.cs.kieler.klighd.test.launch +++ b/test/de.cau.cs.kieler.klighd.test/runConfigs/de.cau.cs.kieler.klighd.test.launch @@ -12,8 +12,10 @@ + + @@ -24,8 +26,10 @@ + + - + @@ -34,8 +38,144 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/de.cau.cs.kieler.klighd.test/src/de/cau/cs/kieler/klighd/test/IncrementalUpdateTest.java b/test/de.cau.cs.kieler.klighd.test/src/de/cau/cs/kieler/klighd/test/IncrementalUpdateTest.java index 7e8d0e492..3fac91d95 100644 --- a/test/de.cau.cs.kieler.klighd.test/src/de/cau/cs/kieler/klighd/test/IncrementalUpdateTest.java +++ b/test/de.cau.cs.kieler.klighd.test/src/de/cau/cs/kieler/klighd/test/IncrementalUpdateTest.java @@ -3,7 +3,7 @@ * * http://rtsys.informatik.uni-kiel.de/kieler * - * Copyright 2020 by + * Copyright 2020-2023 by * + Kiel University * + Department of Computer Science * + Real-Time and Embedded Systems Group @@ -51,6 +51,34 @@ private ViewContext createViewContext() { return new ViewContext((IDiagramWorkbenchPart) null, null); } + /* + * method for programatically creating the following KGraph in kgt notion: + * + * kgraph nodeRoot + * + * knode nodeA { + * kport portA1 + * kport portA2 + * + * klabel labelA1 "labelA1" + * klabel labelA2 "labelA2" + * + * kedge (->nodeB) // edgeAB + * kedge (->nodeC) // edgeAC + * + * kedge (:portA1->nodeB:portB1) // edgeA1B1 + * kedge (:portA1->nodeB:portB1) // edgeA1B1_2 + * } + * knode nodeB { + * kport portB1 + * + * kedge (->nodeC) // edgeBC + * } + * knode nodeC { + * kedge (->nodeB) // edgeCB + * } + * + */ private KNode createTestGraph() { final KNode nodeRoot = KGraphUtil.createInitializedNode(); addIdentifier(nodeRoot, "nodeRoot"); @@ -140,7 +168,7 @@ public void testAddNode() { final KNode newNode = KGraphUtil.createInitializedNode(); final EObject newNodeSource = new EObjectImpl() { }; - newNode.setProperty(KlighdInternalProperties.MODEL_ELEMEMT, newNodeSource); + newNode.setProperty(KlighdInternalProperties.MODEL_ELEMENT, newNodeSource); final int newNodePosition = 0; newGraph.getChildren().add(newNodePosition, newNode); @@ -180,9 +208,9 @@ public void testAddMultipleNodes() { final EObject newNodeSource0 = new EObjectImpl() { }; final EObject newNodeSource1 = new EObjectImpl() { }; final EObject newNodeSource2 = new EObjectImpl() { }; - newNode0.setProperty(KlighdInternalProperties.MODEL_ELEMEMT, newNodeSource0); - newNode1.setProperty(KlighdInternalProperties.MODEL_ELEMEMT, newNodeSource1); - newNode2.setProperty(KlighdInternalProperties.MODEL_ELEMEMT, newNodeSource2); + newNode0.setProperty(KlighdInternalProperties.MODEL_ELEMENT, newNodeSource0); + newNode1.setProperty(KlighdInternalProperties.MODEL_ELEMENT, newNodeSource1); + newNode2.setProperty(KlighdInternalProperties.MODEL_ELEMENT, newNodeSource2); final int newNode0Position = 0; final int newNode1Position = 1; final int newNode2Position = 2; @@ -225,7 +253,7 @@ public void testRemoveNode() { final KNode baseGraph = createTestGraph(); final KNode baseNodeToRemove = baseGraph.getChildren().get(toRemovePosition); final EObject baseNodeToRemoveSource = new EObjectImpl() { }; - baseNodeToRemove.setProperty(KlighdInternalProperties.MODEL_ELEMEMT, baseNodeToRemoveSource); + baseNodeToRemove.setProperty(KlighdInternalProperties.MODEL_ELEMENT, baseNodeToRemoveSource); final KNode newGraph = createTestGraph(); @@ -253,11 +281,11 @@ public void testUpdateNodePosition() { final KNode baseGraph = createTestGraph(); final KNode baseNodeToMove = baseGraph.getChildren().get(oldPosition); final EObject nodeToMoveSource = new EObjectImpl() { }; - baseNodeToMove.setProperty(KlighdInternalProperties.MODEL_ELEMEMT, nodeToMoveSource); + baseNodeToMove.setProperty(KlighdInternalProperties.MODEL_ELEMENT, nodeToMoveSource); final KNode newGraph = createTestGraph(); final KNode newNodeToMove = newGraph.getChildren().get(oldPosition); - newNodeToMove.setProperty(KlighdInternalProperties.MODEL_ELEMEMT, nodeToMoveSource); + newNodeToMove.setProperty(KlighdInternalProperties.MODEL_ELEMENT, nodeToMoveSource); newGraph.getChildren().move(newPosition, newNodeToMove); @@ -286,7 +314,7 @@ public void testAddPort() { final KPort newPort = KGraphUtil.createInitializedPort(); final EObject newPortSource = new EObjectImpl() { }; - newPort.setProperty(KlighdInternalProperties.MODEL_ELEMEMT, newPortSource); + newPort.setProperty(KlighdInternalProperties.MODEL_ELEMENT, newPortSource); final int parentNodePosition = 0; final int newPortPosition = 0; @@ -318,7 +346,7 @@ public void testRemovePort() { final KNode baseGraph = createTestGraph(); final KPort basePortToRemove = baseGraph.getChildren().get(parentNodePosition).getPorts().get(toRemovePosition); final EObject basePortToRemoveSource = new EObjectImpl() { }; - basePortToRemove.setProperty(KlighdInternalProperties.MODEL_ELEMEMT, basePortToRemoveSource); + basePortToRemove.setProperty(KlighdInternalProperties.MODEL_ELEMENT, basePortToRemoveSource); final KNode newGraph = createTestGraph(); @@ -347,11 +375,11 @@ public void testUpdatePortPosition() { final KNode baseGraph = createTestGraph(); final KPort basePortToMove = baseGraph.getChildren().get(parentNodePosition).getPorts().get(oldPosition); final EObject portToMoveSource = new EObjectImpl() { }; - basePortToMove.setProperty(KlighdInternalProperties.MODEL_ELEMEMT, portToMoveSource); + basePortToMove.setProperty(KlighdInternalProperties.MODEL_ELEMENT, portToMoveSource); final KNode newGraph = createTestGraph(); final KPort newPortToMove = newGraph.getChildren().get(parentNodePosition).getPorts().get(oldPosition); - newPortToMove.setProperty(KlighdInternalProperties.MODEL_ELEMEMT, portToMoveSource); + newPortToMove.setProperty(KlighdInternalProperties.MODEL_ELEMENT, portToMoveSource); newGraph.getChildren().get(parentNodePosition).getPorts().move(newPosition, newPortToMove); @@ -384,7 +412,7 @@ public void testAddLabel() { final KNode parentNode = newGraph.getChildren().get(parentNodePosition); final KLabel newLabel = KGraphUtil.createInitializedLabel(parentNode); final EObject newLabelSource = new EObjectImpl() { }; - newLabel.setProperty(KlighdInternalProperties.MODEL_ELEMEMT, newLabelSource); + newLabel.setProperty(KlighdInternalProperties.MODEL_ELEMENT, newLabelSource); parentNode.getLabels().move(newLabelPosition, newLabel); final ViewContext viewContext = createViewContext(); @@ -413,7 +441,7 @@ public void testRemoveLabel() { final KNode baseGraph = createTestGraph(); final KLabel baseLabelToRemove = baseGraph.getChildren().get(parentNodePosition).getLabels().get(toRemovePosition); final EObject baseLabelToRemoveSource = new EObjectImpl() { }; - baseLabelToRemove.setProperty(KlighdInternalProperties.MODEL_ELEMEMT, baseLabelToRemoveSource); + baseLabelToRemove.setProperty(KlighdInternalProperties.MODEL_ELEMENT, baseLabelToRemoveSource); final KNode newGraph = createTestGraph(); @@ -442,11 +470,11 @@ public void testUpdateLabelPosition() { final KNode baseGraph = createTestGraph(); final KLabel baseLabelToMove = baseGraph.getChildren().get(parentNodePosition).getLabels().get(oldPosition); final EObject labelToMoveSource = new EObjectImpl() { }; - baseLabelToMove.setProperty(KlighdInternalProperties.MODEL_ELEMEMT, labelToMoveSource); + baseLabelToMove.setProperty(KlighdInternalProperties.MODEL_ELEMENT, labelToMoveSource); final KNode newGraph = createTestGraph(); final KLabel newLabelToMove = newGraph.getChildren().get(parentNodePosition).getLabels().get(oldPosition); - newLabelToMove.setProperty(KlighdInternalProperties.MODEL_ELEMEMT, labelToMoveSource); + newLabelToMove.setProperty(KlighdInternalProperties.MODEL_ELEMENT, labelToMoveSource); newGraph.getChildren().get(parentNodePosition).getLabels().move(newPosition, newLabelToMove); @@ -477,7 +505,7 @@ public void testAddEdgePlain() { final KEdge newEdge = KGraphUtil.createInitializedEdge(); final EObject newEdgeSource = new EObjectImpl() { }; - newEdge.setProperty(KlighdInternalProperties.MODEL_ELEMEMT, newEdgeSource); + newEdge.setProperty(KlighdInternalProperties.MODEL_ELEMENT, newEdgeSource); final int sourceNodePosition = 0; final int targetNodePosition = 1; @@ -520,7 +548,7 @@ public void testAddEdgeOnPort() { final KEdge newEdge = KGraphUtil.createInitializedEdge(); final EObject newEdgeSource = new EObjectImpl() { }; - newEdge.setProperty(KlighdInternalProperties.MODEL_ELEMEMT, newEdgeSource); + newEdge.setProperty(KlighdInternalProperties.MODEL_ELEMENT, newEdgeSource); final int sourceNodePosition = 0; final int targetNodePosition = 1; @@ -558,6 +586,93 @@ public void testAddEdgeOnPort() { Assert.assertSame(newEdgeTargetPosition, baseEdgeTargetPosition); } + /** + * Tests adding an edge to an added port of an added node. Checks if the elements are added and if the edge is + * connected to the new port at the correct positions in various reference lists. + */ + @Test + public void testAddEdgeNewNodeToNewTargetPort() { + final KNode baseGraph = createTestGraph(); + final KNode newGraph = createTestGraph(); + + // Create a new source node on index 0. + final KNode newSourceNode = KGraphUtil.createInitializedNode(); + final EObject newSourceNodeSource = new EObjectImpl() { }; + newSourceNode.setProperty(KlighdInternalProperties.MODEL_ELEMENT, newSourceNodeSource); + final int newSourceNodePosition = 0; + + newGraph.getChildren().add(newSourceNodePosition, newSourceNode); + + // Create the new target port on another node with index 1. + final KPort newTargetPort = KGraphUtil.createInitializedPort(); + final EObject newTargetPortSource = new EObjectImpl() { }; + newTargetPort.setProperty(KlighdInternalProperties.MODEL_ELEMENT, newTargetPortSource); + final int targetNodePosition = 1; + final int newTargetPortPosition = 0; + + final KNode targetNode = newGraph.getChildren().get(targetNodePosition); + targetNode.getPorts().add(newTargetPortPosition, newTargetPort); + + // Create a new edge from the new source node to the new target port. + final KEdge newEdge = KGraphUtil.createInitializedEdge(); + final EObject newEdgeSource = new EObjectImpl() { }; + newEdge.setProperty(KlighdInternalProperties.MODEL_ELEMENT, newEdgeSource); + + newEdge.setSource(newSourceNode); + newEdge.setTargetPort(newTargetPort); + newEdge.setTarget(targetNode); + final int newEdgeSourcePosition = 0; + final int newEdgeTargetPortPosition = 0; + final int newEdgeTargetPosition = 0; + newSourceNode.getOutgoingEdges().move(newEdgeSourcePosition, newEdge); + newTargetPort.getEdges().move(newEdgeTargetPortPosition, newEdge); + targetNode.getIncomingEdges().move(newEdgeTargetPosition, newEdge); + + final ViewContext viewContext = createViewContext(); + // Initialize the view context with the base graph. + INCREMENTAL_UPDATE_STRATEGY.update(viewContext.getViewModel(), baseGraph, viewContext); + // Update with the new graph. + INCREMENTAL_UPDATE_STRATEGY.update(viewContext.getViewModel(), newGraph, viewContext); + + // Assert the new node is in the updated base model. + EObject baseNewNode = viewContext.getTargetElements(newSourceNodeSource).stream().findFirst().orElse(null); + Assert.assertNotNull(baseNewNode); + Assert.assertTrue(baseNewNode instanceof KNode); + + // Assert the new port is in the updated base model. + EObject baseNewPort = viewContext.getTargetElements(newTargetPortSource).stream().findFirst().orElse(null); + Assert.assertNotNull(baseNewPort); + Assert.assertTrue(baseNewPort instanceof KPort); + + // Assert the new edge is in the updated base model. + EObject baseNewEdge = viewContext.getTargetElements(newEdgeSource).stream().findFirst().orElse(null); + Assert.assertNotNull(baseNewEdge); + Assert.assertTrue(baseNewEdge instanceof KEdge); + // Assert the new edge also connects to the new port correctly. + Assert.assertSame(baseNewPort, ((KEdge) baseNewEdge).getTargetPort()); + + + // Assert that the new node is in the same positions in the updated base graph as it is in the new graph. + int baseNodePosition = viewContext.getViewModel().getChildren().indexOf(baseNewNode); + Assert.assertSame(newSourceNodePosition, baseNodePosition); + + // Assert that the new port is in the same positions in the updated base graph as it is in the new graph. + int basePortPosition = viewContext.getViewModel().getChildren().get(targetNodePosition).getPorts() + .indexOf(baseNewPort); + Assert.assertSame(newTargetPortPosition, basePortPosition); + + // Assert that the new edge is in the same positions in the updated base graph as it is in the new graph. + int baseEdgeSourcePosition = viewContext.getViewModel().getChildren().get(newSourceNodePosition) + .getOutgoingEdges().indexOf(baseNewEdge); + Assert.assertSame(newEdgeSourcePosition, baseEdgeSourcePosition); + int baseEdgeTargetPosition = viewContext.getViewModel().getChildren().get(targetNodePosition).getIncomingEdges() + .indexOf(baseNewEdge); + Assert.assertSame(newEdgeTargetPosition, baseEdgeTargetPosition); + int baseEdgeTargetPortPosition = viewContext.getViewModel().getChildren().get(targetNodePosition).getPorts() + .get(newTargetPortPosition).getEdges().indexOf(baseNewEdge); + Assert.assertSame(newEdgeTargetPortPosition, baseEdgeTargetPortPosition); + } + /** * Tests removing an edge plainly on a node. */ @@ -569,7 +684,7 @@ public void testRemoveEdgePlain() { final KEdge baseEdgeToRemove = baseGraph.getChildren().get(sourceNodePosition).getOutgoingEdges() .get(toRemovePosition); final EObject baseEdgeToRemoveSource = new EObjectImpl() { }; - baseEdgeToRemove.setProperty(KlighdInternalProperties.MODEL_ELEMEMT, baseEdgeToRemoveSource); + baseEdgeToRemove.setProperty(KlighdInternalProperties.MODEL_ELEMENT, baseEdgeToRemoveSource); final KNode newGraph = createTestGraph(); @@ -599,7 +714,7 @@ public void testRemoveEdgeOnPort() { final KEdge baseEdgeToRemove = baseGraph.getChildren().get(sourceNodePosition).getPorts() .get(sourceNodePortPosition).getEdges().get(toRemovePosition); final EObject baseEdgeToRemoveSource = new EObjectImpl() { }; - baseEdgeToRemove.setProperty(KlighdInternalProperties.MODEL_ELEMEMT, baseEdgeToRemoveSource); + baseEdgeToRemove.setProperty(KlighdInternalProperties.MODEL_ELEMENT, baseEdgeToRemoveSource); final KNode newGraph = createTestGraph(); @@ -631,12 +746,12 @@ public void testUpdateEdgePositionPlain() { final KEdge baseEdgeToMove = baseGraph.getChildren().get(sourceNodePosition).getOutgoingEdges() .get(oldSourcePosition); final EObject edgeToMoveSource = new EObjectImpl() { }; - baseEdgeToMove.setProperty(KlighdInternalProperties.MODEL_ELEMEMT, edgeToMoveSource); + baseEdgeToMove.setProperty(KlighdInternalProperties.MODEL_ELEMENT, edgeToMoveSource); final KNode newGraph = createTestGraph(); final KEdge newEdgeToMove = newGraph.getChildren().get(sourceNodePosition).getOutgoingEdges() .get(oldSourcePosition); - newEdgeToMove.setProperty(KlighdInternalProperties.MODEL_ELEMEMT, edgeToMoveSource); + newEdgeToMove.setProperty(KlighdInternalProperties.MODEL_ELEMENT, edgeToMoveSource); final KNode newTargetNode = newEdgeToMove.getTarget(); newGraph.getChildren().get(sourceNodePosition).getOutgoingEdges().move(newSourcePosition, newEdgeToMove); newTargetNode.getIncomingEdges().move(newTargetPosition, newEdgeToMove); @@ -674,12 +789,12 @@ public void testUpdateEdgePositionOnPort() { final KEdge baseEdgeToMove = baseGraph.getChildren().get(sourceNodePosition).getPorts() .get(sourceNodePortPosition).getEdges().get(oldSourcePosition); final EObject edgeToMoveSource = new EObjectImpl() { }; - baseEdgeToMove.setProperty(KlighdInternalProperties.MODEL_ELEMEMT, edgeToMoveSource); + baseEdgeToMove.setProperty(KlighdInternalProperties.MODEL_ELEMENT, edgeToMoveSource); final KNode newGraph = createTestGraph(); final KEdge newEdgeToMove = newGraph.getChildren().get(sourceNodePosition).getPorts() .get(sourceNodePortPosition).getEdges().get(oldSourcePosition); - newEdgeToMove.setProperty(KlighdInternalProperties.MODEL_ELEMEMT, edgeToMoveSource); + newEdgeToMove.setProperty(KlighdInternalProperties.MODEL_ELEMENT, edgeToMoveSource); final KPort newTargetPort = newEdgeToMove.getTargetPort(); newGraph.getChildren().get(sourceNodePosition).getPorts().get(sourceNodePortPosition).getEdges() .move(newSourcePosition, newEdgeToMove); @@ -782,11 +897,11 @@ public void testIssue48() { final EObject newNodeSource3 = new EObjectImpl() { }; final EObject newNodeSourceL = new EObjectImpl() { }; final EObject newNodeSource2 = new EObjectImpl() { }; - newNodeC.setProperty(KlighdInternalProperties.MODEL_ELEMEMT, newNodeSourceC); - newNode1.setProperty(KlighdInternalProperties.MODEL_ELEMEMT, newNodeSource1); - newNode3.setProperty(KlighdInternalProperties.MODEL_ELEMEMT, newNodeSource3); - newNodeL.setProperty(KlighdInternalProperties.MODEL_ELEMEMT, newNodeSourceL); - newNode2.setProperty(KlighdInternalProperties.MODEL_ELEMEMT, newNodeSource2); + newNodeC.setProperty(KlighdInternalProperties.MODEL_ELEMENT, newNodeSourceC); + newNode1.setProperty(KlighdInternalProperties.MODEL_ELEMENT, newNodeSource1); + newNode3.setProperty(KlighdInternalProperties.MODEL_ELEMENT, newNodeSource3); + newNodeL.setProperty(KlighdInternalProperties.MODEL_ELEMENT, newNodeSourceL); + newNode2.setProperty(KlighdInternalProperties.MODEL_ELEMENT, newNodeSource2); final KPort newPortCOut = KGraphUtil.createInitializedPort(); newPortCOut.setNode(newNodeC); diff --git a/test/de.cau.cs.kieler.klighd.test/src/de/cau/cs/kieler/klighd/test/KlighdTestPlugin.java b/test/de.cau.cs.kieler.klighd.test/src/de/cau/cs/kieler/klighd/test/KlighdTestPlugin.java index 2b09da931..bf08df79a 100644 --- a/test/de.cau.cs.kieler.klighd.test/src/de/cau/cs/kieler/klighd/test/KlighdTestPlugin.java +++ b/test/de.cau.cs.kieler.klighd.test/src/de/cau/cs/kieler/klighd/test/KlighdTestPlugin.java @@ -32,7 +32,7 @@ import de.cau.cs.kieler.klighd.Klighd; import de.cau.cs.kieler.klighd.kgraph.KNode; import de.cau.cs.kieler.klighd.kgraph.util.KGraphDataUtil; -import de.cau.cs.kieler.klighd.standalone.KlighdStandaloneSetup; +import de.cau.cs.kieler.klighd.setup.KlighdStandaloneSetup; /** * The activator class controls the plug-in life cycle. diff --git a/test/de.cau.cs.kieler.klighd.test/src/de/cau/cs/kieler/klighd/test/ViewChangedNotificationSuppressionTest.java b/test/de.cau.cs.kieler.klighd.test/src/de/cau/cs/kieler/klighd/test/ViewChangedNotificationSuppressionTest.java index bac718844..0cbf737f3 100644 --- a/test/de.cau.cs.kieler.klighd.test/src/de/cau/cs/kieler/klighd/test/ViewChangedNotificationSuppressionTest.java +++ b/test/de.cau.cs.kieler.klighd.test/src/de/cau/cs/kieler/klighd/test/ViewChangedNotificationSuppressionTest.java @@ -18,6 +18,7 @@ import java.util.ArrayList; import java.util.Collections; +import java.util.HashMap; import java.util.List; import java.util.Map; @@ -41,8 +42,6 @@ import com.google.common.collect.ImmutableMap; import com.google.common.collect.Iterables; import com.google.common.collect.Iterators; -import com.google.common.collect.Lists; -import com.google.common.collect.Maps; import de.cau.cs.kieler.klighd.IDiagramWorkbenchPart; import de.cau.cs.kieler.klighd.IViewChangeListener; @@ -146,13 +145,13 @@ public void run() { } - private Map> suppressNotificationConfig01 = - Maps.newHashMap(); - private ArrayList expectedNotifications01 = null; + private Map> suppressNotificationConfig01 = + new HashMap<>(); + private List expectedNotifications01 = null; private Map> suppressNotificationConfig02 = - Maps.newHashMap(); - private ArrayList expectedNotifications02 = null; + new HashMap<>(); + private List expectedNotifications02 = null; private Iterable observedNotifications01 = null; private Iterable observedNotifications02 = null; @@ -164,7 +163,7 @@ public void run() { private final List changes; /* Constructor */ { - this.changes = Collections.synchronizedList(Lists.newArrayList()); + this.changes = Collections.synchronizedList(new ArrayList<>()); ViewChangedNotificationSuppressionTest.this.observedNotifications01 = Iterables.unmodifiableIterable(changes); } @@ -172,7 +171,7 @@ public void run() { public void viewChanged(final ViewChange change) { changes.add(change.getType()); - final ArrayList suppressed = + final List suppressed = suppressNotificationConfig01.get(change.getType()); if (suppressed != null) { change.suppressSubsequentNotifications(suppressed.toArray(new ViewChangeType[0])); @@ -190,7 +189,7 @@ public void viewChanged(final ViewChange change) { private final List changes; /* Constructor */ { - this.changes = Collections.synchronizedList(Lists.newArrayList()); + this.changes = Collections.synchronizedList(new ArrayList<>()); ViewChangedNotificationSuppressionTest.this.observedNotifications02 = Iterables.unmodifiableIterable(changes); } @@ -255,7 +254,7 @@ public Object apply(final ViewContext input) { public void test00() { employFirstListener(); - expectedNotifications01 = Lists.newArrayList(ViewChangeType.COLLAPSE, + expectedNotifications01 = List.of(ViewChangeType.COLLAPSE, ViewChangeType.VIEW_PORT, ViewChangeType.EXPAND, ViewChangeType.VIEW_PORT); expectedNotifications02 = expectedNotifications01; @@ -279,9 +278,9 @@ public void test01a() { employFirstListener(); suppressNotificationConfig01.put( - ViewChangeType.COLLAPSE, Lists.newArrayList(ViewChangeType.VIEW_PORT)); + ViewChangeType.COLLAPSE, List.of(ViewChangeType.VIEW_PORT)); - expectedNotifications01 = Lists.newArrayList( + expectedNotifications01 = List.of( ViewChangeType.COLLAPSE, ViewChangeType.EXPAND, ViewChangeType.VIEW_PORT); final Object modelElement = MODEL_QUERY.apply(viewContext); @@ -303,8 +302,8 @@ public void test01b() { employFirstListener(); suppressNotificationConfig01.put( - ViewChangeType.EXPAND, Lists.newArrayList(ViewChangeType.VIEW_PORT)); - expectedNotifications01 = Lists.newArrayList( + ViewChangeType.EXPAND, List.of(ViewChangeType.VIEW_PORT)); + expectedNotifications01 = List.of( ViewChangeType.COLLAPSE, ViewChangeType.VIEW_PORT, ViewChangeType.EXPAND); final Object modelElement = MODEL_QUERY.apply(viewContext); @@ -327,10 +326,10 @@ public void test01c() { employFirstListener(); suppressNotificationConfig01.put( - ViewChangeType.COLLAPSE, Lists.newArrayList(ViewChangeType.VIEW_PORT)); + ViewChangeType.COLLAPSE, List.of(ViewChangeType.VIEW_PORT)); suppressNotificationConfig01.put( - ViewChangeType.EXPAND, Lists.newArrayList(ViewChangeType.VIEW_PORT)); - expectedNotifications01 = Lists.newArrayList( + ViewChangeType.EXPAND, List.of(ViewChangeType.VIEW_PORT)); + expectedNotifications01 = List.of( ViewChangeType.COLLAPSE, ViewChangeType.EXPAND); final Object modelElement = MODEL_QUERY.apply(viewContext); @@ -384,7 +383,7 @@ public void test02base() { public void test02a() { employFirstListener(); - expectedNotifications01 = Lists.newArrayList(ViewChangeType.VIEW_PORT, + expectedNotifications01 = List.of(ViewChangeType.VIEW_PORT, ViewChangeType.COLLAPSE, ViewChangeType.VIEW_PORT, ViewChangeType.CLIP, ViewChangeType.VIEW_PORT, ViewChangeType.EXPAND, ViewChangeType.VIEW_PORT, @@ -398,11 +397,11 @@ public void test02b() { employFirstListener(); suppressNotificationConfig01.put( - ViewChangeType.COLLAPSE, Lists.newArrayList(ViewChangeType.VIEW_PORT)); + ViewChangeType.COLLAPSE, List.of(ViewChangeType.VIEW_PORT)); suppressNotificationConfig01.put( - ViewChangeType.EXPAND, Lists.newArrayList(ViewChangeType.VIEW_PORT)); + ViewChangeType.EXPAND, List.of(ViewChangeType.VIEW_PORT)); - expectedNotifications01 = Lists.newArrayList(ViewChangeType.VIEW_PORT, + expectedNotifications01 = List.of(ViewChangeType.VIEW_PORT, ViewChangeType.COLLAPSE, ViewChangeType.CLIP, ViewChangeType.VIEW_PORT, ViewChangeType.EXPAND, ViewChangeType.CLIP, ViewChangeType.VIEW_PORT); @@ -414,13 +413,13 @@ public void test02c() { employFirstListener(); suppressNotificationConfig01.put( - ViewChangeType.CLIP, Lists.newArrayList(ViewChangeType.VIEW_PORT)); + ViewChangeType.CLIP, List.of(ViewChangeType.VIEW_PORT)); suppressNotificationConfig01.put( - ViewChangeType.COLLAPSE, Lists.newArrayList(ViewChangeType.VIEW_PORT)); + ViewChangeType.COLLAPSE, List.of(ViewChangeType.VIEW_PORT)); suppressNotificationConfig01.put( - ViewChangeType.EXPAND, Lists.newArrayList(ViewChangeType.VIEW_PORT)); + ViewChangeType.EXPAND, List.of(ViewChangeType.VIEW_PORT)); - expectedNotifications01 = Lists.newArrayList(ViewChangeType.VIEW_PORT, + expectedNotifications01 = List.of(ViewChangeType.VIEW_PORT, ViewChangeType.COLLAPSE, ViewChangeType.CLIP, ViewChangeType.EXPAND, ViewChangeType.CLIP); @@ -432,13 +431,13 @@ public void test02d() { employFirstListener(); suppressNotificationConfig01.put(ViewChangeType.CLIP, - Lists.newArrayList(ViewChangeType.VIEW_PORT, ViewChangeType.EXPAND)); + List.of(ViewChangeType.VIEW_PORT, ViewChangeType.EXPAND)); suppressNotificationConfig01.put( - ViewChangeType.COLLAPSE, Lists.newArrayList(ViewChangeType.VIEW_PORT)); + ViewChangeType.COLLAPSE, List.of(ViewChangeType.VIEW_PORT)); suppressNotificationConfig01.put( - ViewChangeType.EXPAND, Lists.newArrayList(ViewChangeType.VIEW_PORT)); + ViewChangeType.EXPAND, List.of(ViewChangeType.VIEW_PORT)); - expectedNotifications01 = Lists.newArrayList(ViewChangeType.VIEW_PORT, + expectedNotifications01 = List.of(ViewChangeType.VIEW_PORT, ViewChangeType.COLLAPSE, ViewChangeType.CLIP, ViewChangeType.CLIP); test02base(); @@ -455,11 +454,11 @@ public void test03base() { } suppressNotificationConfig01.put( - ViewChangeType.COLLAPSE, Lists.newArrayList(ViewChangeType.VIEW_PORT)); + ViewChangeType.COLLAPSE, List.of(ViewChangeType.VIEW_PORT)); suppressNotificationConfig01.put( - ViewChangeType.EXPAND, Lists.newArrayList(ViewChangeType.VIEW_PORT)); + ViewChangeType.EXPAND, List.of(ViewChangeType.VIEW_PORT)); - expectedNotifications01 = Lists.newArrayList(ViewChangeType.VIEW_PORT, + expectedNotifications01 = List.of(ViewChangeType.VIEW_PORT, ViewChangeType.COLLAPSE, ViewChangeType.CLIP, ViewChangeType.VIEW_PORT, ViewChangeType.EXPAND, @@ -473,7 +472,7 @@ public void test03a() { suppressNotificationConfig02.put( ViewChangeType.COLLAPSE, ImmutableMap.of(ViewChangeType.VIEW_PORT, LONG_WAIT_DELAY)); - expectedNotifications02 = Lists.newArrayList(ViewChangeType.VIEW_PORT, + expectedNotifications02 = List.of(ViewChangeType.VIEW_PORT, ViewChangeType.COLLAPSE, ViewChangeType.CLIP, ViewChangeType.VIEW_PORT, ViewChangeType.EXPAND, ViewChangeType.VIEW_PORT, @@ -493,7 +492,7 @@ public void test03c() { suppressNotificationConfig02.put( ViewChangeType.COLLAPSE, ImmutableMap.of(ViewChangeType.VIEW_PORT, 2 * LONG_WAIT_DELAY)); - expectedNotifications02 = Lists.newArrayList(ViewChangeType.VIEW_PORT, + expectedNotifications02 = List.of(ViewChangeType.VIEW_PORT, ViewChangeType.COLLAPSE, ViewChangeType.CLIP, ViewChangeType.EXPAND, ViewChangeType.VIEW_PORT, @@ -513,7 +512,7 @@ public void test03e() { suppressNotificationConfig02.put( ViewChangeType.COLLAPSE, ImmutableMap.of(ViewChangeType.VIEW_PORT, 4 * LONG_WAIT_DELAY)); - expectedNotifications02 = Lists.newArrayList(ViewChangeType.VIEW_PORT, + expectedNotifications02 = List.of(ViewChangeType.VIEW_PORT, ViewChangeType.COLLAPSE, ViewChangeType.CLIP, ViewChangeType.EXPAND, @@ -533,7 +532,7 @@ public void test03g() { suppressNotificationConfig02.put( ViewChangeType.CLIP, ImmutableMap.of(ViewChangeType.VIEW_PORT, LONG_WAIT_DELAY)); - expectedNotifications02 = Lists.newArrayList(ViewChangeType.VIEW_PORT, + expectedNotifications02 = List.of(ViewChangeType.VIEW_PORT, ViewChangeType.COLLAPSE, ViewChangeType.VIEW_PORT, ViewChangeType.CLIP, ViewChangeType.EXPAND, ViewChangeType.VIEW_PORT, @@ -553,7 +552,7 @@ public void test03i() { suppressNotificationConfig02.put( ViewChangeType.CLIP, ImmutableMap.of(ViewChangeType.VIEW_PORT, 2 * LONG_WAIT_DELAY)); - expectedNotifications02 = Lists.newArrayList(ViewChangeType.VIEW_PORT, + expectedNotifications02 = List.of(ViewChangeType.VIEW_PORT, ViewChangeType.COLLAPSE, ViewChangeType.VIEW_PORT, ViewChangeType.CLIP, ViewChangeType.EXPAND, @@ -574,7 +573,7 @@ public void test03k() { ViewChangeType.CLIP, ImmutableMap.of( ViewChangeType.VIEW_PORT, 2 * LONG_WAIT_DELAY, ViewChangeType.EXPAND, 0)); - expectedNotifications02 = Lists.newArrayList(ViewChangeType.VIEW_PORT, + expectedNotifications02 = List.of(ViewChangeType.VIEW_PORT, ViewChangeType.COLLAPSE, ViewChangeType.VIEW_PORT, ViewChangeType.CLIP, @@ -598,7 +597,7 @@ public void test03m() { // COLLAPSE to EXPAND takes more than 2sec ... ViewChangeType.CLIP, 0)); - expectedNotifications02 = Lists.newArrayList(ViewChangeType.VIEW_PORT, + expectedNotifications02 = List.of(ViewChangeType.VIEW_PORT, ViewChangeType.COLLAPSE, ViewChangeType.EXPAND, // ... hence the notification must occur @@ -621,7 +620,7 @@ public void test03o() { ViewChangeType.EXPAND, 3 * LONG_WAIT_DELAY, ViewChangeType.CLIP, 0)); - expectedNotifications02 = Lists.newArrayList(ViewChangeType.VIEW_PORT, + expectedNotifications02 = List.of(ViewChangeType.VIEW_PORT, ViewChangeType.COLLAPSE, // because of the 3 seconds the EXPAND notification is blocked here diff --git a/test/de.cau.cs.kieler.klighd.test/src/de/cau/cs/kieler/klighd/test/ViewContextSourceModelTrackingTest.java b/test/de.cau.cs.kieler.klighd.test/src/de/cau/cs/kieler/klighd/test/ViewContextSourceModelTrackingTest.java index db2f4f725..550f9bd98 100644 --- a/test/de.cau.cs.kieler.klighd.test/src/de/cau/cs/kieler/klighd/test/ViewContextSourceModelTrackingTest.java +++ b/test/de.cau.cs.kieler.klighd.test/src/de/cau/cs/kieler/klighd/test/ViewContextSourceModelTrackingTest.java @@ -108,11 +108,11 @@ private void checkTracerMaps(final ViewContext viewContext, final int expectedEn public void test00() { final Object elementB = new Object(); final KNode nodeB = KGraphUtil.createInitializedNode(); - nodeB.setProperty(KlighdInternalProperties.MODEL_ELEMEMT, elementB); + nodeB.setProperty(KlighdInternalProperties.MODEL_ELEMENT, elementB); final Object elementA = new Object(); final KNode nodeA = KGraphUtil.createInitializedNode(); - nodeA.setProperty(KlighdInternalProperties.MODEL_ELEMEMT, elementA); + nodeA.setProperty(KlighdInternalProperties.MODEL_ELEMENT, elementA); nodeA.getChildren().add(nodeB); final KNode root = KGraphUtil.createInitializedNode(); @@ -160,7 +160,7 @@ private ViewContext updateViewModelRootSourceElement(final ViewContext viewConte final EObject sourceModel = new EObjectImpl() { }; final KNode newModel = KGraphUtil.createInitializedNode(); - newModel.setProperty(KlighdInternalProperties.MODEL_ELEMEMT, sourceModel); + newModel.setProperty(KlighdInternalProperties.MODEL_ELEMENT, sourceModel); UPDATE_STRATEGY.update(viewModel, newModel, viewContext); @@ -484,8 +484,8 @@ public void testIncrementalUpdate() { final EObject rootSource = new EObjectImpl() { }; final EObject childSource = new EObjectImpl() { }; - rootNode.setProperty(KlighdInternalProperties.MODEL_ELEMEMT, rootSource); - childNode.setProperty(KlighdInternalProperties.MODEL_ELEMEMT, childSource); + rootNode.setProperty(KlighdInternalProperties.MODEL_ELEMENT, rootSource); + childNode.setProperty(KlighdInternalProperties.MODEL_ELEMENT, childSource); final ViewContext viewContext = createViewContext(); INCREMENTAL_UPDATE_STRATEGY.update(viewContext.getViewModel(), rootNode, viewContext); @@ -498,8 +498,8 @@ public void testIncrementalUpdate() { final KNode newRoot = createSimpleNetwork(); final KNode newChildNode = newRoot.getChildren().get(1); - newRoot.setProperty(KlighdInternalProperties.MODEL_ELEMEMT, rootSource); - newChildNode.setProperty(KlighdInternalProperties.MODEL_ELEMEMT, childSource); + newRoot.setProperty(KlighdInternalProperties.MODEL_ELEMENT, rootSource); + newChildNode.setProperty(KlighdInternalProperties.MODEL_ELEMENT, childSource); final ViewContext newViewContext = createViewContext(); INCREMENTAL_UPDATE_STRATEGY.update(newViewContext.getViewModel(), newRoot, newViewContext); diff --git a/test/de.cau.cs.kieler.klighd.test/src/de/cau/cs/kieler/klighd/test/runners/ModelCollectionTestRunner.java b/test/de.cau.cs.kieler.klighd.test/src/de/cau/cs/kieler/klighd/test/runners/ModelCollectionTestRunner.java index 0a961f84e..0229fb45a 100644 --- a/test/de.cau.cs.kieler.klighd.test/src/de/cau/cs/kieler/klighd/test/runners/ModelCollectionTestRunner.java +++ b/test/de.cau.cs.kieler.klighd.test/src/de/cau/cs/kieler/klighd/test/runners/ModelCollectionTestRunner.java @@ -24,6 +24,7 @@ import java.lang.reflect.Method; import java.lang.reflect.Modifier; import java.net.URL; +import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.List; @@ -123,7 +124,7 @@ * * @Models * public static Iterable<?> getModels() { - * List<Object> models = Lists.newLinkedList(); + * List<Object> models = new ArrayList<>(); * return models; * } * @@ -365,7 +366,7 @@ public ModelCollectionTestRunner(final Class clazz) throws Throwable { // for each of the revealed model objects determine a name (the fragmentURI in case of // EObjects) and create a related child test runner - final List childRunners = Lists.newLinkedList(); + final List childRunners = new ArrayList<>(); for (Object o : models) { final String modelName; @@ -515,7 +516,7 @@ private Iterable getModelsByPathMethods() { ? (org.eclipse.emf.ecore.resource.ResourceSet) resourceSetMethod .invokeExplosively(null) : new ResourceSetImpl(); - List urls = Lists.newArrayList(); + List urls = new ArrayList<>(); // for all provided model paths ... for (String modelPath : modelPaths) { diff --git a/test/pom.xml b/test/pom.xml index f6d9769f9..d347d2e44 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -9,7 +9,7 @@ de.cau.cs.kieler.klighd parent - 2.3.1-SNAPSHOT + 3.0.3-SNAPSHOT