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 ?

Regards
  • Attachment: xorSplit.jpg
    (Size: 3.32KB, Downloaded 374 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: 10
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() {
    }

    @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: Thu Apr 25 02:19:57 GMT 2024

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

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

Back to the top