Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoratikhomirov2006-05-01 17:26:36 +0000
committeratikhomirov2006-05-01 17:26:36 +0000
commitd1df87d283ceb73df7175d9266c9742a262c26c1 (patch)
treeeaf0ef84e3ecde1c44a35636b6b9d2f355e19731 /plugins/org.eclipse.gmf.graphdef.codegen/src
parent0569a7f0e10f18d89485294fce059a4c7eaad95d (diff)
downloadorg.eclipse.gmf-tooling-d1df87d283ceb73df7175d9266c9742a262c26c1.tar.gz
org.eclipse.gmf-tooling-d1df87d283ceb73df7175d9266c9742a262c26c1.tar.xz
org.eclipse.gmf-tooling-d1df87d283ceb73df7175d9266c9742a262c26c1.zip
[bblajer] ##139022 Provide option to choose mapMode for figures
Diffstat (limited to 'plugins/org.eclipse.gmf.graphdef.codegen/src')
-rw-r--r--plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/FigureGenerator.java2
-rw-r--r--plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/MapModeCodeGenStrategy.java25
-rw-r--r--plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/StandaloneGenerator.java2
3 files changed, 8 insertions, 21 deletions
diff --git a/plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/FigureGenerator.java b/plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/FigureGenerator.java
index 6b72c7bc7..025da6518 100644
--- a/plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/FigureGenerator.java
+++ b/plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/FigureGenerator.java
@@ -79,7 +79,7 @@ public class FigureGenerator {
private GraphDefDispatcher myInnerDispatcher;
public FigureGenerator(String aPackageName, ImportAssistant importManager, FigureQualifiedNameSwitch figureNameSwitch) {
- this(aPackageName, importManager, figureNameSwitch, new MapModeCodeGenStrategy.RuntimeUnspecifiedMapMode(importManager));
+ this(aPackageName, importManager, figureNameSwitch, new MapModeCodeGenStrategy.RuntimeUnspecifiedMapMode());
}
public FigureGenerator(String aPackageName, ImportAssistant importManager, FigureQualifiedNameSwitch figureNameSwitch, MapModeCodeGenStrategy mapModeStrategy) {
diff --git a/plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/MapModeCodeGenStrategy.java b/plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/MapModeCodeGenStrategy.java
index 47e81f0ec..31a03afa9 100644
--- a/plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/MapModeCodeGenStrategy.java
+++ b/plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/MapModeCodeGenStrategy.java
@@ -14,24 +14,10 @@ package org.eclipse.gmf.graphdef.codegen;
import org.eclipse.gmf.common.codegen.ImportAssistant;
public abstract class MapModeCodeGenStrategy {
- private final ImportAssistant myImportAssistant;
-
public abstract String LPtoDP(int logicalUnit);
public abstract String DPtoLP(int deviceUnit);
- public MapModeCodeGenStrategy(ImportAssistant importAssistant){
- myImportAssistant = importAssistant;
- }
-
- public ImportAssistant getImportAssistant() {
- return myImportAssistant;
- }
-
public static class StaticIdentityMapMode extends MapModeCodeGenStrategy {
- public StaticIdentityMapMode(ImportAssistant importAssistant){
- super(importAssistant);
- }
-
public String DPtoLP(int deviceUnit) {
return String.valueOf(deviceUnit);
}
@@ -42,10 +28,6 @@ public abstract class MapModeCodeGenStrategy {
}
public static class RuntimeUnspecifiedMapMode extends MapModeCodeGenStrategy {
- public RuntimeUnspecifiedMapMode(ImportAssistant importAssistant){
- super(importAssistant);
- }
-
public String DPtoLP(int deviceUnit) {
StringBuffer result = new StringBuffer();
result.append(getMapModeAccessor());
@@ -73,12 +55,17 @@ public abstract class MapModeCodeGenStrategy {
public static class RuntimeMapModeFromPluginClass extends RuntimeUnspecifiedMapMode {
private final String myPluginActivatorClassFQN;
+ private final ImportAssistant myImportAssistant;
public RuntimeMapModeFromPluginClass(ImportAssistant importAssistant, String pluginActivatorClassFQN){
- super(importAssistant);
+ myImportAssistant = importAssistant;
myPluginActivatorClassFQN = pluginActivatorClassFQN;
}
+ public ImportAssistant getImportAssistant() {
+ return myImportAssistant;
+ }
+
protected String getMapModeAccessor() {
StringBuffer result = new StringBuffer();
result.append(getImportAssistant().getImportedName(myPluginActivatorClassFQN));
diff --git a/plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/StandaloneGenerator.java b/plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/StandaloneGenerator.java
index 461e89b16..515af955a 100644
--- a/plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/StandaloneGenerator.java
+++ b/plugins/org.eclipse.gmf.graphdef.codegen/src/org/eclipse/gmf/graphdef/codegen/StandaloneGenerator.java
@@ -132,7 +132,7 @@ public class StandaloneGenerator extends GeneratorBase {
if (config.needsMapMode()) {
strategy = new MapModeCodeGenStrategy.RuntimeMapModeFromPluginClass(importAssistant, pluginActivatorFQN);
} else {
- strategy = new MapModeCodeGenStrategy.StaticIdentityMapMode(importAssistant);
+ strategy = new MapModeCodeGenStrategy.StaticIdentityMapMode();
}
myFigureGenerator = new FigureGeneratorAdapter( //

Back to the top