Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
View | Details | Raw Unified | Return to bug 289465 | Differences between
and this patch

Collapse All | Expand All

(-)src/org/eclipse/gmf/runtime/gef/ui/figures/NodeFigure.java (+20 lines)
Lines 30-35 Link Here
30
import org.eclipse.gmf.runtime.draw2d.ui.internal.figures.TransparentBorder;
30
import org.eclipse.gmf.runtime.draw2d.ui.internal.figures.TransparentBorder;
31
import org.eclipse.swt.SWT;
31
import org.eclipse.swt.SWT;
32
import org.eclipse.swt.graphics.Path;
32
import org.eclipse.swt.graphics.Path;
33
import org.eclipse.swt.widgets.Display;
34
import org.eclipse.ui.PlatformUI;
33
35
34
/**
36
/**
35
 * Base class that most shape figures should extend from to gain default connection anchor behavior.
37
 * Base class that most shape figures should extend from to gain default connection anchor behavior.
Lines 354-359 Link Here
354
	 */
356
	 */
355
	public void setGradientData(int gradientColor1, int gradientColor2, int gradientStyle) {
357
	public void setGradientData(int gradientColor1, int gradientColor2, int gradientStyle) {
356
		boolean doRepaint = false;
358
		boolean doRepaint = false;
359
		// When in high contrast mode, there is no gradient, so set bg color to null to allow inheriting
360
		// the system color.
361
		Display display = Display.getCurrent();
362
		if (display == null && PlatformUI.isWorkbenchRunning()) {
363
			display = PlatformUI.getWorkbench().getDisplay();
364
		}
365
		if (display != null && display.getHighContrast()) {
366
			setBackgroundColor(null);
367
			return;
368
		}		
357
		if (gradientColor1 != this.gradientColor1 && gradientColor1 > -1) {
369
		if (gradientColor1 != this.gradientColor1 && gradientColor1 > -1) {
358
			this.gradientColor1 = gradientColor1;
370
			this.gradientColor1 = gradientColor1;
359
			doRepaint = true;
371
			doRepaint = true;
Lines 378-383 Link Here
378
	 * @since 1.2
390
	 * @since 1.2
379
	 */
391
	 */
380
	public boolean isUsingGradient() {
392
	public boolean isUsingGradient() {
393
		// When in high contrast mode, there is no gradient, so return false.
394
		Display display = Display.getCurrent();
395
		if (display == null && PlatformUI.isWorkbenchRunning()) {
396
			display = PlatformUI.getWorkbench().getDisplay();
397
		}
398
		if (display != null && display.getHighContrast()) {		
399
			return false;
400
		}
381
		return isUsingGradient && gradientColor1 > -1 && gradientColor2 > -1;
401
		return isUsingGradient && gradientColor1 > -1 && gradientColor2 > -1;
382
	}
402
	}
383
		
403
		

Return to bug 289465