Skip to main content



      Home
Home » Eclipse Projects » GEF » Drawing a Shape
Drawing a Shape [message #1077271] Thu, 01 August 2013 09:12 Go to next message
Eclipse UserFriend
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 ?

Regards
  • Attachment: xorSplit.jpg
    (Size: 3.32KB, Downloaded 406 times)
Re: Drawing a Shape [message #1083305 is a reply to message #1077271] Fri, 09 August 2013 15:44 Go to previous message
Eclipse UserFriend
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() {
    }

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

        // 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:Create two outline views
Next Topic:Marquee selection and selection of Connections
Goto Forum:
  


Current Time: Tue Jul 22 17:49:06 EDT 2025

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

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

Back to the top