Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Wrong z-order in outline
Wrong z-order in outline [message #524806] Fri, 02 April 2010 15:23
Carsten Reckord is currently offline Carsten ReckordFriend
Messages: 139
Registered: July 2009
Senior Member
Hi,

We have a Figure with the following (simplified) paint logic, which essentially adds a drop shadow by first filling a rectangle with the
shadow and then painting over it:

public class RectangleWithShadow extends RectangleFigure
{
@Override
protected void fillShape(Graphics graphics)
{
drawShadow(graphics);

super.fillShape(graphics);
}

private void drawShadow(Graphics graphics)
{
final int shadow = EditorConstants.SHADOW_WIDTH;
final Rectangle bounds = getBounds();
graphics.pushState();
graphics.setBackgroundColor(ColorConstants.gray);
graphics.setAlpha(140);
graphics.setClip(new Rectangle(bounds.x, bounds.y, bounds.width+shadow, bounds.height+shadow));
final Rectangle shadowRect = bounds.getCopy().translate(shadow, shadow);
graphics.fillRectangle(shadowRect);
graphics.popState();
}
}

This works fine in the editor itself, however it causes strange effects in the outline view, where some or all of the shadow rectangle is
displayed in front of the figure rather than behind it.

How can this be avoided (without using lines to paint the shadow, like the SchemeBorders do)?

Best regards,
Carsten
Previous Topic:How to keep ImageFigure position static?
Next Topic:Fwd: Error when mirroring GEF 3.5.2 p2 repository
Goto Forum:
  


Current Time: Fri Apr 19 15:28:46 GMT 2024

Powered by FUDForum. Page generated in 0.02129 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top