getDiagram() and manageColor() from AbstractPattern & AbstractConnectionPattern moved to upper class AbstractBasePattern
diff --git a/plugins/org.eclipse.graphiti.pattern/src/org/eclipse/graphiti/pattern/AbstractBasePattern.java b/plugins/org.eclipse.graphiti.pattern/src/org/eclipse/graphiti/pattern/AbstractBasePattern.java
index 467817c..5300953 100644
--- a/plugins/org.eclipse.graphiti.pattern/src/org/eclipse/graphiti/pattern/AbstractBasePattern.java
+++ b/plugins/org.eclipse.graphiti.pattern/src/org/eclipse/graphiti/pattern/AbstractBasePattern.java
@@ -19,8 +19,12 @@
import org.eclipse.graphiti.features.IFeatureProviderHolder;
import org.eclipse.graphiti.features.IMappingProvider;
import org.eclipse.graphiti.features.context.IAddContext;
+import org.eclipse.graphiti.mm.algorithms.styles.Color;
+import org.eclipse.graphiti.mm.pictograms.Diagram;
import org.eclipse.graphiti.mm.pictograms.PictogramElement;
import org.eclipse.graphiti.platform.IDiagramEditor;
+import org.eclipse.graphiti.services.Graphiti;
+import org.eclipse.graphiti.util.IColorConstant;
/**
* The Class AbstractBasePattern.
@@ -125,4 +129,43 @@
protected void link(PictogramElement pe, Object businessObjects[]) {
getMappingProvider().link(pe, businessObjects);
}
+
+ /**
+ * Gets the diagram.
+ *
+ * @return the diagram
+ */
+ protected Diagram getDiagram() {
+ return getFeatureProvider().getDiagramTypeProvider().getDiagram();
+ }
+
+ /**
+ * A convenient method for the color handling which simply calls
+ * <code>Graphiti.getGaService().manageColor(...)</code>.
+ *
+ * @param colorConstant
+ * the color constant
+ *
+ * @return the color
+ */
+ protected Color manageColor(IColorConstant colorConstant) {
+ return Graphiti.getGaService().manageColor(getDiagram(), colorConstant);
+ }
+
+ /**
+ * A convenient method for the color handling which simply calls
+ * <code>Graphiti.getGaService().manageColor(...)</code>.
+ *
+ * @param red
+ * the red
+ * @param green
+ * the green
+ * @param blue
+ * the blue
+ *
+ * @return the color
+ */
+ protected Color manageColor(int red, int green, int blue) {
+ return Graphiti.getGaService().manageColor(getDiagram(), red, green, blue);
+ }
}
diff --git a/plugins/org.eclipse.graphiti.pattern/src/org/eclipse/graphiti/pattern/AbstractConnectionPattern.java b/plugins/org.eclipse.graphiti.pattern/src/org/eclipse/graphiti/pattern/AbstractConnectionPattern.java
index a147dc2..1ce2aa3 100644
--- a/plugins/org.eclipse.graphiti.pattern/src/org/eclipse/graphiti/pattern/AbstractConnectionPattern.java
+++ b/plugins/org.eclipse.graphiti.pattern/src/org/eclipse/graphiti/pattern/AbstractConnectionPattern.java
@@ -113,36 +113,6 @@
}
/**
- * A convenient method for the color handling which simply calls
- * <code>Graphiti.getGaService().manageColor(...)</code>.
- *
- * @param colorConstant
- * the color constant
- *
- * @return the color
- */
- protected Color manageColor(IColorConstant colorConstant) {
- return Graphiti.getGaService().manageColor(getFeatureProvider().getDiagramTypeProvider().getDiagram(), colorConstant);
- }
-
- /**
- * A convenient method for the color handling which simply calls
- * <code>Graphiti.getGaService().manageColor(...)</code>.
- *
- * @param red
- * the red
- * @param green
- * the green
- * @param blue
- * the blue
- *
- * @return the color
- */
- protected Color manageColor(int red, int green, int blue) {
- return Graphiti.getGaService().manageColor(getFeatureProvider().getDiagramTypeProvider().getDiagram(), red, green, blue);
- }
-
- /**
* Update pictogram element.
*
* @param pe
diff --git a/plugins/org.eclipse.graphiti.pattern/src/org/eclipse/graphiti/pattern/AbstractPattern.java b/plugins/org.eclipse.graphiti.pattern/src/org/eclipse/graphiti/pattern/AbstractPattern.java
index 052bf8d..dcf5c54 100644
--- a/plugins/org.eclipse.graphiti.pattern/src/org/eclipse/graphiti/pattern/AbstractPattern.java
+++ b/plugins/org.eclipse.graphiti.pattern/src/org/eclipse/graphiti/pattern/AbstractPattern.java
@@ -282,15 +282,6 @@
}
/**
- * Gets the diagram.
- *
- * @return the diagram
- */
- protected Diagram getDiagram() {
- return getFeatureProvider().getDiagramTypeProvider().getDiagram();
- }
-
- /**
* Gets the image.
*
* @param structureMapping
@@ -386,32 +377,6 @@
return patternConfiguration;
}
- /**
- * Manage color.
- *
- * @param red
- * the red
- * @param green
- * the green
- * @param blue
- * the blue
- * @return the color
- */
- protected Color manageColor(int red, int green, int blue) {
- return Graphiti.getGaService().manageColor(getDiagram(), red, green, blue);
- }
-
- /**
- * Manage color.
- *
- * @param colorConstant
- * the color constant
- * @return the color
- */
- protected Color manageColor(IColorConstant colorConstant) {
- return Graphiti.getGaService().manageColor(getDiagram(), colorConstant);
- }
-
public void completeInfo(IDirectEditingInfo info, Object bo) {
}