Connection between custom figures [message #490034] |
Tue, 06 October 2009 21:04  |
Eclipse User |
|
|
|
Originally posted by: asif.tmcp.gmail.com
Hi,
I am trying to implement custom figure in a GMF based editor.
I have over-ridden the corresponding.
*.diagram.edit.parts.<Class>editpart.java CreateNodeShape as follows:
URL url = null;
url = FileLocator.find(SolmodDiagramEditorPlugin.getInstance().get Bundle(),
new Path("images/ipdslam.svg"), null);
RenderedImage img = RenderedImageFactory.getInstance(url);
primaryShape = new ScalableImageFigure(img, true,true, true);
return primaryShape;
The shape gets created but the problem is that
1>. There are no connection points to this shape. Hence this class cannot be
connected to any thing else in the diagram.
2>. After I draw this shape, the diagram editor doesn't allow me to draw
anything else.
What am I missing here?
Kind REgards,
asif
|
|
|
|
|
|
|
|
|
Re: Connection between custom figures [message #490759 is a reply to message #490647] |
Sat, 10 October 2009 06:09  |
Eclipse User |
|
|
|
Originally posted by: asif.tmcp.gmail.com
Hi ,
I somehow solved the problem.
Actually while looking around I also noticed that part of the solution is
there in the documentation itself and in Aureliens previous post
" http://dev.eclipse.org/newslists/news.eclipse.modeling.gmf/m sg19637.html "
.. My mistake.
What I missed was setting the background and foreground color.
Thanks a lot for pointing me in the right direction.
Now I have come across a peculiar problem.
I will launch a separate thread for that.
Thanks once again.
Regards,
asif
"Alex Shatalin" <shatalin@gmail.com> wrote in message
news:b79abbae192178cc1718a6d1b514@news.eclipse.org...
> Hello Asif,
>
>> 1>. Once the figure is drawn the canvas is frozen. No other figure can
>> be
>> drawn.
>> 2>. This figure has no connection point.
>> Please help.
> It looks like the figure you've specified
> (file:/D:/dev_wksd/Sol.Mod.wksd/eclipse.wksd/com.nsn.gmf.sol utionmodeling.graphed.diagram/images/sd.svg)
> was not drawn properly..
> Do you have any exceptions in the .log file?.. Can you execute this
> diagram editor in a debugger and stop it then figure was drawn to see why
> canvas was frozen?
> In general you are going in a proper way right now. Idea is:
> 1. Create FigureDescriptor = fd
> 2. Create RectangleFigure (root figure in fd) = rf.
> 3. set appropriate (stack?) layout for rf.
> 4. create SVG figure with proper image path specified in rf.
> 5. create label figure in rf.
> 6. create accessor for label figure.
>
> So, I suggest not nesting any figures into SVG figure - i remember some
> problems around that. Instead I propose creating new root figure, set
> stack (or any other applicable layout for it) and place SVG figure
> together with all other child figures into this root figure.
> Talking about orignal problem - it looks like an .svg file was not
> processed properly by GMF.. In other words, I suppose you'll ave exactly
> same problem in the end, so I suggest you debugging a bit to see why
> canvas was frozen.
>
> -----------------
> Alex Shatalin
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.04880 seconds