diff options
author | Benoit Maggi | 2017-11-09 15:00:26 +0000 |
---|---|---|
committer | Mickael ADAM | 2017-11-10 15:12:40 +0000 |
commit | bd7e310c8f5cff5fe9a3f471d37c33cc5285b524 (patch) | |
tree | e7cf22c42ed4961f648f83d21677bfaf5598c0bd /plugins | |
parent | dcc1a82c076ed531bbe8d49fe36d5803177a791a (diff) | |
download | org.eclipse.papyrus-bd7e310c8f5cff5fe9a3f471d37c33cc5285b524.tar.gz org.eclipse.papyrus-bd7e310c8f5cff5fe9a3f471d37c33cc5285b524.tar.xz org.eclipse.papyrus-bd7e310c8f5cff5fe9a3f471d37c33cc5285b524.zip |
Bug 527062 - DeadLock in Big model with svg
- get colors information from the main parent.
Change-Id: I7019ddf377c73d80d4d5861de52ea96c87133384
Signed-off-by: Benoit Maggi <benoit.maggi@cea.fr>
Signed-off-by: Mickael ADAM <mickael.adam@all4tec.net>
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/figure/node/BorderedScalableImageFigure.java | 53 |
1 files changed, 38 insertions, 15 deletions
diff --git a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/figure/node/BorderedScalableImageFigure.java b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/figure/node/BorderedScalableImageFigure.java index f8baab40cfe..ce2c003bdac 100644 --- a/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/figure/node/BorderedScalableImageFigure.java +++ b/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/figure/node/BorderedScalableImageFigure.java @@ -1,5 +1,5 @@ /***************************************************************************** - * Copyright (c) 2011 CEA LIST. + * Copyright (c) 2011, 2017 CEA LIST. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 @@ -11,7 +11,7 @@ * CEA LIST - Initial API and implementation * Mickael ADAM (ALL4TEC) - mickael.adam@all4tec.net - implementation of layout BorderedLayoutManager to provide maintain ratio and color set * Fanch BONNABESSE (ALL4TEC) - fanch.bonnabesse@all4tec.net - Bug 502531 - * + * Mickael ADAM (ALL4TEC) - mickael.adam@all4tec.net - Bug 527062 *****************************************************************************/ package org.eclipse.papyrus.infra.gmfdiag.common.figure.node; @@ -25,6 +25,7 @@ import org.eclipse.draw2d.geometry.Rectangle; import org.eclipse.gmf.runtime.draw2d.ui.render.RenderedImage; import org.eclipse.gmf.runtime.draw2d.ui.render.figures.ScalableImageFigure; import org.eclipse.papyrus.infra.gmfdiag.common.utils.FigureUtils; +import org.eclipse.swt.graphics.Color; /** * Scalable Image figure that will be aligned in the middle/center and keep its own ratio. @@ -64,19 +65,6 @@ public class BorderedScalableImageFigure extends ScalableImageFigure { // Get the parent bounds Rectangle parentBounds = getParent().getBounds().getCopy(); - // Get the main figure where are color informations. - IRoundedRectangleFigure roundedCompartmentFigure = getMainFigure(); - - // Set the color from the color of the parent - if (roundedCompartmentFigure != null) { - setBackgroundColor(roundedCompartmentFigure.getBackgroundColor()); - setForegroundColor(roundedCompartmentFigure.getForegroundColor()); - } else { - // Set the color from the color of the parent - setBackgroundColor(getParent().getBackgroundColor()); - setForegroundColor(getParent().getForegroundColor()); - } - // set the clip of the graphics to the parent clip graphics.setClip(parentBounds); super.paintFigure(graphics); @@ -84,6 +72,41 @@ public class BorderedScalableImageFigure extends ScalableImageFigure { } /** + * {@inheritDoc} + * + * @see org.eclipse.draw2d.Figure#getBackgroundColor() + */ + @Override + public Color getBackgroundColor() { + // Get the main figure where are color informations. + IRoundedRectangleFigure roundedCompartmentFigure = getMainFigure(); + + // Get the color from the color of the parent + if (roundedCompartmentFigure != null) { + return roundedCompartmentFigure.getBackgroundColor(); + } + + return super.getBackgroundColor(); + } + + /** + * {@inheritDoc} + * + * @see org.eclipse.draw2d.Figure#getForegroundColor() + */ + @Override + public Color getForegroundColor() { + // Get the main figure where are color informations. + IRoundedRectangleFigure roundedCompartmentFigure = getMainFigure(); + + // Get the color from the color of the parent + if (roundedCompartmentFigure != null) { + return roundedCompartmentFigure.getForegroundColor(); + } + return super.getForegroundColor(); + } + + /** * Gets the main figure. * * @return the roundedRectangleFigure |