How can I get the instance of the Diagram? [message #217597] |
Fri, 06 February 2009 16:43 |
Eclipse User |
|
|
|
Originally posted by: cayla_sha.gmx.net
Hello!
I`m inside of an Wizard and I want to calculate the width and the height
of the whole diagram.
I already found out, that I can calculate the size with this method:
org.eclipse.gmf.runtime.diagram.ui.render.clipboard.DiagramG enerator.calculateImageRectangle(java.util.List
editparts)
But for this method I need the list of all editparts. And for that List
I need somehow the instance of the diagram.
The only thing what I have in the wizard is the workbench. I tried
something like
workbench.getActiveWorkbenchWindow().getActivePage().getActi veEditor()
but that led nowhere.
I also tried ShapesDiagram.eINSTANCE, but this don`t work.
EditorPackage.eINSTANCE.getShapesDiagram() doesn`t return the right
thing...
Any ideas?
Thanks in advance!
Best wishes
Julia
|
|
|
|
Re: How can I get the instance of the Diagram? [message #217879 is a reply to message #217794] |
Mon, 09 February 2009 11:24 |
Eclipse User |
|
|
|
Originally posted by: cayla_sha.gmx.net
Hello Alex,
the current selection is the file in the Navigator-View, because the
Wizard is an Export Wizard. The user right-clicks on the gmf-file in the
Navigator-View, chooses "Export" and then my Export-Wizard. So there`s
nothing selected in my Diagram.
So the current selection is useless here.
workbench.getActiveWorkbenchWindow().getActivePage().getActi veEditor()
doesn`t work, because when I call:
WorkbenchWindow workbenchWindow =
(WorkbenchWindow)workbench.getActiveWorkbenchWindow();
then workbenchWindow is null.
This is a bit strange, because when I look at workbench during debugging
it has an active WorkbenchWindow and the activeWorkbenchWindow has an
activePage and the activePage has an activeEditor. But I can dig as deep
as I want, I can`t find any EditPart or my ShapesDiagram. So it doesn`t
matter why getActiveWorkbenchWindow() returns null, because nowhere
inside of workbench is something that would help me.
So the workbench is useless, too.
Isn`t there a class where I can get the Instance and then call something
like getShapesDiagram()?
If not, I could also calculate the width and height myself, I think.
Because during the export I parse the whole gmf-file and so I get all
the EditParts, so I think, I just can remember the highest x- and y-Value.
But first I`ll ask my client what he exactly means, when he wants the
width and the height of the diagram :)
Thanks so far!
Best wishes
Julia
|
|
|
|
Powered by
FUDForum. Page generated in 0.03194 seconds