Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » How to export specified diagram programmatically
How to export specified diagram programmatically [message #1692079] Mon, 13 April 2015 09:30 Go to next message
Xue Liu is currently offline Xue LiuFriend
Messages: 21
Registered: May 2014
Junior Member
Hello everyone,

I have learned how to export a diagram programmatically from https://www.eclipse.org/forums/index.php/t/813864/. Now I have a further question that how to export a specified diagram programmatically. For example in a case I have several EMF model instances in a Model Project. Each instance has a responding diagram. And I want to generate the diagram responding the selected instance.

Regards,

Xue Liu

[Updated on: Mon, 13 April 2015 09:35]

Report message to a moderator

Re: How to export specified diagram programmatically [message #1692080 is a reply to message #1692079] Mon, 13 April 2015 09:36 Go to previous messageGo to next message
Xue Liu is currently offline Xue LiuFriend
Messages: 21
Registered: May 2014
Junior Member
No Message Body

[Updated on: Mon, 13 April 2015 09:37]

Report message to a moderator

Re: How to export specified diagram programmatically [message #1692338 is a reply to message #1692079] Wed, 15 April 2015 07:31 Go to previous messageGo to next message
Esteban Dugueperoux is currently offline Esteban DugueperouxFriend
Messages: 472
Registered: July 2009
Senior Member
Hi,

As indicated in [1], to export a specific representation, a diagram for
example, you can use following API :

DialectUIManager.INSTANCE.export(representation, session,
absoluteImagePath, new ExportFormat(ExportDocumentFormat.NONE,
ImageFileFormat.PNG), new NullProgressMonitor());

Best Regards.

[1] https://www.eclipse.org/forums/index.php/t/813864/

Le 13/04/2015 11:30, Xue Liu a écrit :
> Hello everyone,
>
> I have learned how to export a diagram programmatically from
> https://www.eclipse.org/forums/index.php/t/813864/. Now I have a further
> question that how to export a specified diagram programmatically. for
> example in a case that I have several EMF model instances in a Model
> Project. Each instance has a responding diagram. And I want to generate
> the diagram responding the selected instance.
>
> Regards,
>
> Xue Liu



--
Esteban Dugueperoux - Obeo

Need professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: How to export specified diagram programmatically [message #1694214 is a reply to message #1692338] Sat, 02 May 2015 09:48 Go to previous messageGo to next message
Xue Liu is currently offline Xue LiuFriend
Messages: 21
Registered: May 2014
Junior Member
Hi,

Thank you for your reply. Actually I know using
DialectUIManager.INSTANCE.export(representation, session,
absoluteImagePath, new ExportFormat(ExportDocumentFormat.NONE,
ImageFileFormat.PNG), new NullProgressMonitor());


The problem is how to specify the "representation" relating to the instance you choose.

Any new ideas ?

Regards,

Xue Liu
Re: How to export specified diagram programmatically [message #1694985 is a reply to message #1694214] Mon, 11 May 2015 08:24 Go to previous message
Laurent Redor is currently offline Laurent RedorFriend
Messages: 300
Registered: July 2009
Senior Member
Le 02/05/2015 11:48, Xue Liu a écrit :
> Hi,
>

Hi,

> Thank you for your reply. Actually I know using
> DialectUIManager.INSTANCE.export(representation, session,
> absoluteImagePath, new ExportFormat(ExportDocumentFormat.NONE,
> ImageFileFormat.PNG), new NullProgressMonitor());
>
> The problem is how to specify the "representation" relating to the
> instance you choose.
>
> Any new ideas ?

I think that

DialectManager.INSTANCE.getRepresentations(EObject semantic, Session
session)

is whath you need.

>
> Regards,
>
> Xue Liu

Regards,

Laurent


--
Laurent Redor - Obeo

Need professional services for Sirius?
http://www.obeodesigner.com/sirius


Laurent Redor - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Previous Topic:Montreal Roadshow 2015
Next Topic:Customize edge style
Goto Forum:
  


Current Time: Tue Apr 23 06:19:41 GMT 2024

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

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

Back to the top