diff options
author | Camille Letavernier | 2015-02-24 08:53:08 +0000 |
---|---|---|
committer | Gerrit Code Review @ Eclipse.org | 2015-02-24 08:53:09 +0000 |
commit | 7655851dbe839610cb980ae6312aaaae27fccb0a (patch) | |
tree | 56cf78057be3353dd128ae654dffa58f2d0a4782 | |
parent | 100a5a30808a7367c3122767b55fa53fb8fcfb2b (diff) | |
parent | fc298be8aba8add73b2e8ecf0eff52e248dce3ad (diff) | |
download | org.eclipse.papyrus-7655851dbe839610cb980ae6312aaaae27fccb0a.tar.gz org.eclipse.papyrus-7655851dbe839610cb980ae6312aaaae27fccb0a.tar.xz org.eclipse.papyrus-7655851dbe839610cb980ae6312aaaae27fccb0a.zip |
Merge "bug 439417 - [UseCase Diagram] Actor element cannot be customized at all"
-rw-r--r-- | plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.common/src/org/eclipse/papyrus/infra/gmfdiag/common/figure/node/BorderedScalableImageFigure.java | 25 |
1 files changed, 23 insertions, 2 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 29e2b1fe442..755c05efcfc 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 @@ -48,15 +48,36 @@ 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 - setBackgroundColor(getParent().getBackgroundColor()); - setForegroundColor(getParent().getForegroundColor()); + 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); } + /** + * Gets the main figure. + * + * @return the roundedRectangleFigure + */ + private IRoundedRectangleFigure getMainFigure() { + // If it's called by SVGNodePlate, the parent have not always the foreground color, need to locate + SVGNodePlateFigure SVGNodePlate = FigureUtils.findParentFigureInstance(this, SVGNodePlateFigure.class); + IRoundedRectangleFigure roundedCompartmentFigure = FigureUtils.findChildFigureInstance(SVGNodePlate, IRoundedRectangleFigure.class); + return roundedCompartmentFigure; + } + class BorderedLayoutManager extends AbstractLayout { /** |