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: 242
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 99 times)
Re: Drawing a Shape [message #1083305 is a reply to message #1077271] Fri, 09 August 2013 19:44 Go to previous message
Guess Again is currently offline Guess AgainFriend
Messages: 4
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: Wed Dec 17 21:35:46 GMT 2014

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

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