cleaned static references to disposed swt colors
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/util/draw2d/GFBendpointHandle.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/util/draw2d/GFBendpointHandle.java
index cc32c8b..d63dd25 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/util/draw2d/GFBendpointHandle.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/util/draw2d/GFBendpointHandle.java
@@ -71,22 +71,22 @@
/**
* The foreground color for resizable directions.
*/
- private Color FG_COLOR_PRIMARY;
+ private static Color FG_COLOR_PRIMARY;
/**
* The foreground color for not-resizable directions.
*/
- private Color FG_COLOR_SECONDARY;
+ private static Color FG_COLOR_SECONDARY;
/**
* The background color for primary-selected, resizable directions.
*/
- private Color BG_COLOR_PRIMARY;
+ private static Color BG_COLOR_PRIMARY;
/**
* The background color for secondary-selected, resizable directions.
*/
- private Color BG_COLOR_SECONDARY;
+ private static Color BG_COLOR_SECONDARY;
// ========================================================================
@@ -204,28 +204,28 @@
}
private Color getFgColorPrimary() {
- if (FG_COLOR_PRIMARY == null) {
+ if (FG_COLOR_PRIMARY == null || FG_COLOR_PRIMARY.isDisposed()) {
FG_COLOR_PRIMARY = configurationProvider.getResourceRegistry().getSwtColor("cc6a01"); //$NON-NLS-1$
}
return FG_COLOR_PRIMARY;
}
private Color getFgColorSecondary() {
- if (FG_COLOR_SECONDARY == null) {
+ if (FG_COLOR_SECONDARY == null || FG_COLOR_SECONDARY.isDisposed()) {
FG_COLOR_SECONDARY = configurationProvider.getResourceRegistry().getSwtColor("cc6a01"); //$NON-NLS-1$
}
return FG_COLOR_SECONDARY;
}
private Color getBgColorPrimary() {
- if (BG_COLOR_PRIMARY == null) {
+ if (BG_COLOR_PRIMARY == null || BG_COLOR_PRIMARY.isDisposed()) {
BG_COLOR_PRIMARY = configurationProvider.getResourceRegistry().getSwtColor("ffaa2f"); //$NON-NLS-1$
}
return BG_COLOR_PRIMARY;
}
private Color getBgColorSecondary() {
- if (BG_COLOR_SECONDARY == null) {
+ if (BG_COLOR_SECONDARY == null || BG_COLOR_SECONDARY.isDisposed()) {
BG_COLOR_SECONDARY = configurationProvider.getResourceRegistry().getSwtColor("ffffff"); //$NON-NLS-1$
}
return BG_COLOR_SECONDARY;
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/util/draw2d/GFCornerHandle.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/util/draw2d/GFCornerHandle.java
index 622cac4..388b4f5 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/util/draw2d/GFCornerHandle.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/util/draw2d/GFCornerHandle.java
@@ -60,32 +60,32 @@
/**
* The foreground color for resizable directions.
*/
- private Color FG_COLOR_RESIZABLE;
+ private static Color FG_COLOR_RESIZABLE;
/**
* The foreground color for not-resizable directions.
*/
- private Color FG_COLOR_NOT_RESIZABLE;
+ private static Color FG_COLOR_NOT_RESIZABLE;
/**
* The background color for primary-selected, resizable directions.
*/
- private Color BG_COLOR_PRIMARY_RESIZABLE;
+ private static Color BG_COLOR_PRIMARY_RESIZABLE;
/**
* The background color for secondary-selected, resizable directions.
*/
- private Color BG_COLOR_SECONDARY_RESIZABLE;
+ private static Color BG_COLOR_SECONDARY_RESIZABLE;
/**
* The background color for primary-selected, not-resizable directions.
*/
- private Color BG_COLOR_PRIMARY_NOT_RESIZABLE;
+ private static Color BG_COLOR_PRIMARY_NOT_RESIZABLE;
/**
* The background color for secondary-selected, not-resizable directions.
*/
- private Color BG_COLOR_SECONDARY_NOT_RESIZABLE;
+ private static Color BG_COLOR_SECONDARY_NOT_RESIZABLE;
// ========================================================================
@@ -149,7 +149,7 @@
* @return the fG_COLOR_RESIZABLE
*/
public Color getFG_COLOR_RESIZABLE() {
- if (FG_COLOR_RESIZABLE == null)
+ if (FG_COLOR_RESIZABLE == null || FG_COLOR_RESIZABLE.isDisposed())
FG_COLOR_RESIZABLE = configurationProvider.getResourceRegistry().getSwtColor("f17d00"); //$NON-NLS-1$
return FG_COLOR_RESIZABLE;
}
@@ -158,7 +158,7 @@
* @return the fG_COLOR_NOT_RESIZABLE
*/
public Color getFG_COLOR_NOT_RESIZABLE() {
- if (FG_COLOR_NOT_RESIZABLE == null)
+ if (FG_COLOR_NOT_RESIZABLE == null || FG_COLOR_NOT_RESIZABLE.isDisposed())
FG_COLOR_NOT_RESIZABLE = configurationProvider.getResourceRegistry().getSwtColor("b3b6bb"); //$NON-NLS-1$
return FG_COLOR_NOT_RESIZABLE;
}
@@ -167,7 +167,7 @@
* @return the bG_COLOR_PRIMARY_RESIZABLE
*/
public Color getBG_COLOR_PRIMARY_RESIZABLE() {
- if (BG_COLOR_PRIMARY_RESIZABLE == null)
+ if (BG_COLOR_PRIMARY_RESIZABLE == null || BG_COLOR_PRIMARY_RESIZABLE.isDisposed())
BG_COLOR_PRIMARY_RESIZABLE = configurationProvider.getResourceRegistry().getSwtColor("ff8400"); //$NON-NLS-1$
return BG_COLOR_PRIMARY_RESIZABLE;
}
@@ -176,7 +176,7 @@
* @return the bG_COLOR_SECONDARY_RESIZABLE
*/
public Color getBG_COLOR_SECONDARY_RESIZABLE() {
- if (BG_COLOR_SECONDARY_RESIZABLE == null)
+ if (BG_COLOR_SECONDARY_RESIZABLE == null || BG_COLOR_SECONDARY_RESIZABLE.isDisposed())
BG_COLOR_SECONDARY_RESIZABLE = configurationProvider.getResourceRegistry().getSwtColor("ffffff"); //$NON-NLS-1$
return BG_COLOR_SECONDARY_RESIZABLE;
}
@@ -185,7 +185,7 @@
* @return the bG_COLOR_PRIMARY_NOT_RESIZABLE
*/
public Color getBG_COLOR_PRIMARY_NOT_RESIZABLE() {
- if (BG_COLOR_PRIMARY_NOT_RESIZABLE == null)
+ if (BG_COLOR_PRIMARY_NOT_RESIZABLE == null || BG_COLOR_PRIMARY_NOT_RESIZABLE.isDisposed())
BG_COLOR_PRIMARY_NOT_RESIZABLE = configurationProvider.getResourceRegistry().getSwtColor("b3b6bb"); //$NON-NLS-1$
return BG_COLOR_PRIMARY_NOT_RESIZABLE;
}
@@ -194,7 +194,7 @@
* @return the bG_COLOR_SECONDARY_NOT_RESIZABLE
*/
public Color getBG_COLOR_SECONDARY_NOT_RESIZABLE() {
- if (BG_COLOR_SECONDARY_NOT_RESIZABLE == null)
+ if (BG_COLOR_SECONDARY_NOT_RESIZABLE == null || BG_COLOR_SECONDARY_NOT_RESIZABLE.isDisposed())
BG_COLOR_SECONDARY_NOT_RESIZABLE = configurationProvider.getResourceRegistry().getSwtColor("edf4ff"); //$NON-NLS-1$
return BG_COLOR_SECONDARY_NOT_RESIZABLE;
}
diff --git a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/util/draw2d/GFSurroundingHandle.java b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/util/draw2d/GFSurroundingHandle.java
index 5460971..18dbe2e 100644
--- a/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/util/draw2d/GFSurroundingHandle.java
+++ b/plugins/org.eclipse.graphiti.ui/src/org/eclipse/graphiti/ui/internal/util/draw2d/GFSurroundingHandle.java
@@ -65,12 +65,12 @@
/**
* The foreground color to use for resizable directions.
*/
- private Color FG_COLOR_RESIZABLE;
+ private static Color FG_COLOR_RESIZABLE;
/**
* The foreground color to use for not-resizable directions.
*/
- private Color FG_COLOR_NOT_RESIZABLE;
+ private static Color FG_COLOR_NOT_RESIZABLE;
// ========================================================================
@@ -78,7 +78,7 @@
* @return the fG_COLOR_RESIZABLE
*/
public Color getFG_COLOR_RESIZABLE() {
- if (FG_COLOR_RESIZABLE == null)
+ if (FG_COLOR_RESIZABLE == null || FG_COLOR_RESIZABLE.isDisposed())
FG_COLOR_RESIZABLE = configurationProvider.getResourceRegistry().getSwtColor("ff850f"); //$NON-NLS-1$
return FG_COLOR_RESIZABLE;
}
@@ -87,7 +87,7 @@
* @return the fG_COLOR_NOT_RESIZABLE
*/
public Color getFG_COLOR_NOT_RESIZABLE() {
- if (FG_COLOR_NOT_RESIZABLE == null)
+ if (FG_COLOR_NOT_RESIZABLE == null || FG_COLOR_NOT_RESIZABLE.isDisposed())
FG_COLOR_NOT_RESIZABLE = configurationProvider.getResourceRegistry().getSwtColor("d9dadd"); //$NON-NLS-1$
return FG_COLOR_NOT_RESIZABLE;
}