Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Draw2D and non rectangular clipaths
Draw2D and non rectangular clipaths [message #245472] Fri, 12 September 2008 16:15
J F is currently offline J FFriend
Messages: 256
Registered: July 2009
Senior Member
I see from the code of SWTGraphics that if I push the state of the
graphics and have a non rectangular clip path my drawing code will fail.

I have a fairly basic requirement to display elliptical figures with
elliptical child figures which users can move around. Rather than
constrain them to be in some rectangular client area I would like the
users to be able to move them around within the bounding box of the
parent, but clip them within its boundary.

Has anyone tried this sort of thing?
Is there a standard approach?

The 3 approaches I can think of are after looking at other articles are:
1) Create a new version of Draw2D LWS Control and DeferredUpdater classes
that use an Java 2D Graphics2D context to draw on the background. ( for
example http://www.holongate.org/ )
2) Create a figure which draws on a Java2D canvas and them paint that onto
the figure at the end. In essence a version of 1 which is localized in its
changes
3) Create a subclass of Draw2D Graphics which does its own clipping and
intersection using an abstract graphics package to calculate the
intersections ( if I wanted to go beyond ellipses to arbitrary polygons ),
for example http://www.cs.man.ac.uk/~toby/alan/software/

Thanks, I appreciate non rectangular clipping is a performance issue
Previous Topic:Table using draw2d
Next Topic:resize canvas when things in lightweightsystem change
Goto Forum:
  


Current Time: Fri Apr 26 01:28:49 GMT 2024

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

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

Back to the top