diff options
author | 2018-11-07 15:36:51 +0100 | |
---|---|---|
committer | 2018-11-07 15:36:51 +0100 | |
commit | 09d8faba5cca413a1233bead5f3832a3e7e69649 (patch) | |
tree | 1d2971f67671d0cf8e242e5f642b142d0994abac | |
parent | Nodewise and graphwise diversity added (diff) | |
download | VIATRA-Generator-09d8faba5cca413a1233bead5f3832a3e7e69649.tar.gz VIATRA-Generator-09d8faba5cca413a1233bead5f3832a3e7e69649.tar.zst VIATRA-Generator-09d8faba5cca413a1233bead5f3832a3e7e69649.zip |
Colorcalculator support for datatypes
-rw-r--r-- | Application/hu.bme.mit.inf.dslreasoner.application.ui/src/hu/bme/mit/inf/dslreasoner/application/ui/highlight/ColorCalculator.xtend | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Application/hu.bme.mit.inf.dslreasoner.application.ui/src/hu/bme/mit/inf/dslreasoner/application/ui/highlight/ColorCalculator.xtend b/Application/hu.bme.mit.inf.dslreasoner.application.ui/src/hu/bme/mit/inf/dslreasoner/application/ui/highlight/ColorCalculator.xtend index 5c871a78..a65d7006 100644 --- a/Application/hu.bme.mit.inf.dslreasoner.application.ui/src/hu/bme/mit/inf/dslreasoner/application/ui/highlight/ColorCalculator.xtend +++ b/Application/hu.bme.mit.inf.dslreasoner.application.ui/src/hu/bme/mit/inf/dslreasoner/application/ui/highlight/ColorCalculator.xtend | |||
@@ -3,16 +3,16 @@ package hu.bme.mit.inf.dslreasoner.application.ui.highlight | |||
3 | import java.util.List | 3 | import java.util.List |
4 | import java.util.Random | 4 | import java.util.Random |
5 | import org.eclipse.emf.ecore.EClass | 5 | import org.eclipse.emf.ecore.EClass |
6 | import org.eclipse.emf.ecore.EEnum | 6 | import org.eclipse.emf.ecore.EDataType |
7 | 7 | ||
8 | class ColorCalculator { | 8 | class ColorCalculator { |
9 | 9 | ||
10 | public def dispatch getColor(EClass c) { | 10 | def dispatch getColor(EClass c) { |
11 | val supertypes = (c.getEAllSuperTypes + #[c]) | 11 | val supertypes = (c.getEAllSuperTypes + #[c]) |
12 | val typeHashcodes = supertypes.map[(c.getEPackage.nsURI->c.name).hashCode+2] | 12 | val typeHashcodes = supertypes.map[(c.getEPackage.nsURI->c.name).hashCode+2] |
13 | return randomColor(typeHashcodes) | 13 | return randomColor(typeHashcodes) |
14 | } | 14 | } |
15 | public def dispatch getColor(EEnum e) { | 15 | def dispatch getColor(EDataType e) { |
16 | return randomColor((e.getEPackage.nsURI->e.name).hashCode) | 16 | return randomColor((e.getEPackage.nsURI->e.name).hashCode) |
17 | } | 17 | } |
18 | 18 | ||