Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Drawing a Shape
Drawing a Shape [message #1077271] Thu, 01 August 2013 13:12 Go to next message
serhat gezgin is currently offline serhat gezginFriend
Messages: 243
Registered: January 2013
Location: Izmir
Senior Member
Hi all,

I am new to gef and draw2d. But i need to draw a image like attached image file

anybody can help me to draw this image (with its colors) ? or suggest a documentation

to learn this ?

  • Attachment: xorSplit.jpg
    (Size: 3.32KB, Downloaded 221 times)
Re: Drawing a Shape [message #1083305 is a reply to message #1077271] Fri, 09 August 2013 19:44 Go to previous message
Jordan Deyton is currently offline Jordan DeytonFriend
Messages: 8
Registered: July 2013
Junior Member
Since nobody else has posted, I'll offer my two cents...

I would either extend Shape and duplicate the code in RectangleFigure's source (of course, you would need to add the triangle drawing code into fillShape()) or extend RectangleFigure and just override fillShape().

For example, if you extend RectangleFigure, your class would be something like:

import org.eclipse.draw2d.RectangleFigure;

public class MyShape extends RectangleFigure {
    public MyShape() {

    protected void fillShape(Graphics graphics) {
        // Draw the rectangle. You can also just call graphics.fillRectangle(getBounds()), which is what RectangleFigure.fillShape() does.

        // Code to draw triangle goes here...

I haven't had to use anything beyond ellipses and rectangles yet, so I can't help much in getting the triangle drawn at the moment.
Previous Topic:[ZEST] png export
Next Topic:Connection bend points and snap to grid
Goto Forum:

Current Time: Tue Jun 19 11:00:06 GMT 2018

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

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

Back to the top