Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Figure Problem
Figure Problem [message #240664] Sun, 13 January 2008 23:19 Go to next message
Eclipse User
Originally posted by: surayya.daimi.au.dk

This is a multi-part message in MIME format.
--------------090404010604050000060703
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Hi


I created a TriangleFigure


class TriangleFigure extends Figure {

public TriangleFigure(){
setForegroundColor(ColorConstants.gray);
setBackgroundColor(ColorConstants.gray);
setOpaque(true);
setSize(20,20);
}
protected void paintFigure(Graphics g) {
PointList triangle = new PointList();
triangle.addPoint(getBounds().getTopLeft());
triangle.addPoint(getBounds().getBottomLeft());
int x = getBounds().x;
int y = getBounds().y;
int h = getBounds().height;
int w = getBounds().width;
triangle.addPoint(new Point(x+w,y+h/2 ));

g.fillPolygon(triangle);
}

}

Even though i set this figure to be opaque true as you can see in the
image the gray triangle shows the borders and lines of its parent figure

For triangle i don't have its own editpart.

Can anyone help me with a suggestion of how i could make the triangle
not show the lines. I don't want the lines to be seen but don't know
what to do. There is seen the border of the parent figure and connection

Thanks in advance

Surayya


--------------090404010604050000060703
Content-Type: image/jpeg;
name="untitled.JPG"
Content-Transfer-Encoding: base64
Content-Disposition: inline;
filename="untitled.JPG"

/9j/4AAQSkZJRgABAQEAYABgAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsL DBkSEw8UHRof
Hh0aHBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwL DBgNDRgyIRwh
MjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIy MjIyMjL/wAAR
CACDAGYDASIAAhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcI CQoL/8QAtRAA
AgEDAwIEAwUFBAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS 0fAkM2Jyggk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jS1
iAUOzNJIcKAQAD79D09KYzLuf9av/XNP/QRXVeEpPE25BYAvZd/tOfKA9j1/ 75rodG8H6dBI
0l4n2m5iIQh/uDAGCF75HrmuqACqFUAADAA7UhAu7aN2N2OcdM0UtFABRRRQ AUUUUAFFFFAB
XlM3hvU9Z8RaibaArD9rlzNJ8qffPfv+FerUUActo/gbTdP2y3X+mTj++PkB 9l7/AI5refba
3YlICwvGIyQOFIJIz6Dk1boIBGDyKAIZLdJmEiuySYwJIzzj09D+NM+yzf8A P/cf98x//E0H
TrEnJs7cn/rkv+FH9m2P/Plb/wDfpf8ACgB8UMkbEtcyyjGNrhcfXhRRRFaW 0DFobeKNiMEo
gBx+FFAE1FFFABRRRQAUUUUAFFFFABRRRQAUUUUAFFFFAH//2Q==
--------------090404010604050000060703--
Re: Figure Problem [message #240687 is a reply to message #240664] Mon, 14 January 2008 09:58 Go to previous messageGo to next message
Eclipse User
Originally posted by: surayya.daimi.au.dk

I dont know what i am doiing wrong but i can not make my TriangleFigure
not show the lines. I want it to be not transperent. what should i do

Please give me a hint
Re: Figure Problem [message #240692 is a reply to message #240687] Mon, 14 January 2008 11:59 Go to previous message
Eclipse User
Originally posted by: surayya.daimi.au.dk

surayya wrote:
> I dont know what i am doiing wrong but i can not make my TriangleFigure
> not show the lines. I want it to be not transperent. what should i do
> Please give me a hint
Found Out The solution

The problem is that the paint() does first paintfigure paintchildren and
afterwards paint border. What i Had to do is override paint such that
border is drawn right after the figure
Previous Topic:GEF to Database through RMI not to file
Next Topic:Can Resource Navigator display files with specific extensions
Goto Forum:
  


Current Time: Sat Sep 20 22:12:30 GMT 2014

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

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