Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Background image in rootEditPart
Background image in rootEditPart [message #224936] Mon, 23 October 2006 21:42 Go to next message
Eclipse UserFriend
Originally posted by: matroska.libero.it

Hi,

i would like to put a jpeg as background into a gef editor.
Some nice people tell me that i have to extend createFigure of RootEditPart.
Can you tell me more please?


Thanks in advance
John Slave
Re: Background image in rootEditPart [message #224951 is a reply to message #224936] Mon, 23 October 2006 22:46 Go to previous messageGo to next message
Xiang Qinxian is currently offline Xiang QinxianFriend
Messages: 119
Registered: July 2009
Senior Member
在 2006-10-23一的 23:42 +0200,John Slave写道:
> Hi,
>
> i would like to put a jpeg as background into a gef editor.
> Some nice people tell me that i have to extend createFigure of RootEditPart.
> Can you tell me more please?
>
>
> Thanks in advance
> John Slave
Hi,
public class XXXDiagramEditPart extends XXXGraphicalEditPart{
@Override //root editpart is not RootEditPart
public IFigure createFigure(){
return new XXXFigure(){
@Override
public void paintXXX(Graphics g){
if (GodSayNeedInheritImplementation)
super.paintXXX(g);

Image image=God.getImage();
Rectangle rect=Sadan.getBounds();
g.drawImage(image, rect);
}
};
}

}
Hope this help.

Regargs,

Qinxian
Re: Background image in rootEditPart [message #224984 is a reply to message #224951] Tue, 24 October 2006 08:30 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: matroska.libero.it

Xiang Qinxian ha scritto:
> 在 2006-10-23一的 23:42 +0200,John Slave写道:
>> Hi,
>>
>> i would like to put a jpeg as background into a gef editor.
>> Some nice people tell me that i have to extend createFigure of RootEditPart.
>> Can you tell me more please?
>>
>>
>> Thanks in advance
>> John Slave
> Hi,
> public class XXXDiagramEditPart extends XXXGraphicalEditPart{
> @Override //root editpart is not RootEditPart
> public IFigure createFigure(){
> return new XXXFigure(){
> @Override
> public void paintXXX(Graphics g){
> if (GodSayNeedInheritImplementation)
> super.paintXXX(g);
>
> Image image=God.getImage();
> Rectangle rect=Sadan.getBounds();
> g.drawImage(image, rect);
> }
> };
> }
>
> }
> Hope this help.
>
> Regargs,
>
> Qinxian
>

Thanks Xiang but i have difficult understanding the code.
XXX stay for? however i want a background in the editor not in the
components. Is this the correct behaviour?

Yours faithfully
John Slave
Re: Background image in rootEditPart [message #225018 is a reply to message #224984] Tue, 24 October 2006 13:54 Go to previous messageGo to next message
Xiang Qinxian is currently offline Xiang QinxianFriend
Messages: 119
Registered: July 2009
Senior Member
在 2006-10-24二的 10:30 +0200,John Slave写道:
> Xiang Qinxian ha scritto:
> > 在 2006-10-23一的 23:42 +0200,John Slave写道:
> >> Hi,
> >>
> >> i would like to put a jpeg as background into a gef editor.
> >> Some nice people tell me that i have to extend createFigure of RootEditPart.
> >> Can you tell me more please?
> >>
> >>
> >> Thanks in advance
> >> John Slave
> > Hi,
> > public class XXXDiagramEditPart extends XXXGraphicalEditPart{
> > @Override //root editpart is not RootEditPart
> > public IFigure createFigure(){
> > return new XXXFigure(){
> > @Override
> > public void paintXXX(Graphics g){
> > if (GodSayNeedInheritImplementation)
> > super.paintXXX(g);
> >
> > Image image=God.getImage();
> > Rectangle rect=Sadan.getBounds();
> > g.drawImage(image, rect);
> > }
> > };
> > }
> >
> > }
> > Hope this help.
> >
> > Regargs,
> >
> > Qinxian
> >
>
> Thanks Xiang but i have difficult understanding the code.
> XXX stay for? however i want a background in the editor not in the
> components. Is this the correct behaviour?
>
> Yours faithfully
> John Slave
Hi,

If you wanna a background in normal gef geditor, that above code is
true.

XXXDiagram stands for a gef editor root editpart which is usually a
AbstrctGraphicalEditPart, and XXXFigure stands for a Figure subclass
which is a FreeFormLayer if if gefeditor of you use
ScallableFreeFormRootEditPart, and PaintXXX stands for the Figure
subclass concrete paint method, may be just paint(Graphics);
:)

Regards,

Qinxian
Re: Background image in rootEditPart [message #225136 is a reply to message #225018] Wed, 25 October 2006 14:32 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: matroska.libero.it

Xiang Qinxian ha scritto:
> 在 2006-10-24二的 10:30 +0200,John Slave写道:
>> Xiang Qinxian ha scritto:
>>> 在 2006-10-23一的 23:42 +0200,John Slave写道:
>>>> Hi,
>>>>
>>>> i would like to put a jpeg as background into a gef editor.
>>>> Some nice people tell me that i have to extend createFigure of RootEditPart.
>>>> Can you tell me more please?
>>>>
>>>>
>>>> Thanks in advance
>>>> John Slave
>>> Hi,
>>> public class XXXDiagramEditPart extends XXXGraphicalEditPart{
>>> @Override //root editpart is not RootEditPart
>>> public IFigure createFigure(){
>>> return new XXXFigure(){
>>> @Override
>>> public void paintXXX(Graphics g){
>>> if (GodSayNeedInheritImplementation)
>>> super.paintXXX(g);
>>>
>>> Image image=God.getImage();
>>> Rectangle rect=Sadan.getBounds();
>>> g.drawImage(image, rect);
>>> }
>>> };
>>> }
>>>
>>> }
>>> Hope this help.
>>>
>>> Regargs,
>>>
>>> Qinxian
>>>
>> Thanks Xiang but i have difficult understanding the code.
>> XXX stay for? however i want a background in the editor not in the
>> components. Is this the correct behaviour?
>>
>> Yours faithfully
>> John Slave
> Hi,
>
> If you wanna a background in normal gef geditor, that above code is
> true.
>
> XXXDiagram stands for a gef editor root editpart which is usually a
> AbstrctGraphicalEditPart, and XXXFigure stands for a Figure subclass
> which is a FreeFormLayer if if gefeditor of you use
> ScallableFreeFormRootEditPart, and PaintXXX stands for the Figure
> subclass concrete paint method, may be just paint(Graphics);
> :)
>
> Regards,
>
> Qinxian
>
>

Thank you, it works but i have a problem...in fact figures on it are
under the images so they appear transparent with no border and nothing!
I need to put in front of the image!
Pleaseeeee help me!


Thanks in advance
John Slave
Re: Background image in rootEditPart [message #225140 is a reply to message #225136] Wed, 25 October 2006 14:39 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: matroska.libero.it

John Slave ha scritto:
> Xiang Qinxian ha scritto:
>> 在 2006-10-24二的 10:30 +0200,John Slave写道:
>>> Xiang Qinxian ha scritto:
>>>> 在 2006-10-23一的 23:42 +0200,John Slave写道:
>>>>> Hi,
>>>>>
>>>>> i would like to put a jpeg as background into a gef editor.
>>>>> Some nice people tell me that i have to extend createFigure of
>>>>> RootEditPart.
>>>>> Can you tell me more please?
>>>>>
>>>>>
>>>>> Thanks in advance
>>>>> John Slave
>>>> Hi,
>>>> public class XXXDiagramEditPart extends XXXGraphicalEditPart{
>>>> @Override //root editpart is not RootEditPart
>>>> public IFigure createFigure(){
>>>> return new XXXFigure(){
>>>> @Override
>>>> public void paintXXX(Graphics g){
>>>> if (GodSayNeedInheritImplementation) super.paintXXX(g);
>>>>
>>>> Image image=God.getImage();
>>>> Rectangle rect=Sadan.getBounds();
>>>> g.drawImage(image, rect);
>>>> }
>>>> };
>>>> }
>>>>
>>>> }
>>>> Hope this help.
>>>>
>>>> Regargs,
>>>>
>>>> Qinxian
>>>>
>>> Thanks Xiang but i have difficult understanding the code.
>>> XXX stay for? however i want a background in the editor not in the
>>> components. Is this the correct behaviour?
>>>
>>> Yours faithfully
>>> John Slave
>> Hi,
>>
>> If you wanna a background in normal gef geditor, that above code is
>> true.
>> XXXDiagram stands for a gef editor root editpart which is usually a
>> AbstrctGraphicalEditPart, and XXXFigure stands for a Figure subclass
>> which is a FreeFormLayer if if gefeditor of you use
>> ScallableFreeFormRootEditPart, and PaintXXX stands for the Figure
>> subclass concrete paint method, may be just paint(Graphics);
>> :)
>>
>> Regards,
>>
>> Qinxian
>>
>>
>
> Thank you, it works but i have a problem...in fact figures on it are
> under the images so they appear transparent with no border and nothing!
> I need to put in front of the image!
> Pleaseeeee help me!
>
>
> Thanks in advance
> John Slave


It works....i have translated super.paint(g)...you are really nice!!!!!
Thank you really!

John Slave
Re: Background image in rootEditPart [message #244848 is a reply to message #225140] Mon, 11 August 2008 13:12 Go to previous message
Eclipse UserFriend
Originally posted by: sumncc.gmail.com

Hi , Every one. I have tried to set Background image on the editor by
modifying the paint method at Venueditpart(createfigur method). This
works fine but when I am drawing components I can not see them as the
layer has been over draw by the image.

Is there any way I can set the layer to the components or the anything
with image which will solve this problem.

Please..
Thanks.

RAJ
Previous Topic:Changing Order
Next Topic:How to get the actual size of the Figure whose children can been added?
Goto Forum:
  


Current Time: Fri Nov 28 00:35:00 GMT 2014

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

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