Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » NullPointerException during programmatically generation of diagram Images
NullPointerException during programmatically generation of diagram Images [message #1718384] Wed, 23 December 2015 08:30 Go to next message
Mehmet Karaman is currently offline Mehmet KaramanFriend
Messages: 61
Registered: November 2012
Location: Berlin
Member
Hello,

i am trying to generate Images of programmatically generated diagrams. I have Rectangles with rounded corners and during the paint methods sub calls the image creation fails.

I think it fails because the OneLineMarginBorder objects int[] dash attribute is a null reference.

Is this a bug? Is there any workaround to avoid this?

Best regards
Mehmet Karaman

Caused by: java.lang.NullPointerException
	at org.eclipse.gmf.runtime.draw2d.ui.render.awt.internal.graphics.GraphicsToGraphics2DAdaptor.setLineDash(GraphicsToGraphics2DAdaptor.java:1124)
	at org.eclipse.gmf.runtime.draw2d.ui.internal.graphics.ScaledGraphics.setLineDash(ScaledGraphics.java:802)
	at org.eclipse.sirius.diagram.ui.tools.api.figure.OneLineMarginBorder.paint(OneLineMarginBorder.java:56)
	at org.eclipse.sirius.diagram.ui.tools.internal.figure.RoundedCornerMarginBorder.paint(RoundedCornerMarginBorder.java:67)
	at org.eclipse.draw2d.Figure.paintBorder(Figure.java:1137)
	at org.eclipse.draw2d.Figure.paint(Figure.java:1121)
	at org.eclipse.draw2d.Figure.paintChildren(Figure.java:1170)
	at org.eclipse.draw2d.Figure.paintClientArea(Figure.java:1205)
	at org.eclipse.draw2d.Figure.paint(Figure.java:1120)
	at org.eclipse.draw2d.Figure.paintChildren(Figure.java:1170)
	at org.eclipse.draw2d.Figure.paintClientArea(Figure.java:1205)
	at org.eclipse.draw2d.Figure.paint(Figure.java:1120)
	at org.eclipse.draw2d.Figure.paintChildren(Figure.java:1170)
	at org.eclipse.draw2d.Figure.paintClientArea(Figure.java:1205)
	at org.eclipse.draw2d.Figure.paint(Figure.java:1120)
	at org.eclipse.draw2d.Figure.paintChildren(Figure.java:1170)
	at org.eclipse.draw2d.Figure.paintClientArea(Figure.java:1200)
	at org.eclipse.draw2d.Viewport.paintClientArea(Viewport.java:160)
	at org.eclipse.draw2d.Figure.paint(Figure.java:1120)
	at org.eclipse.draw2d.Figure.paintChildren(Figure.java:1170)
	at org.eclipse.draw2d.Figure.paintClientArea(Figure.java:1209)
	at org.eclipse.draw2d.Figure.paint(Figure.java:1120)
	at org.eclipse.draw2d.Figure.paintChildren(Figure.java:1170)
	at org.eclipse.draw2d.Figure.paintClientArea(Figure.java:1205)
	at org.eclipse.draw2d.Figure.paint(Figure.java:1120)
	at org.eclipse.draw2d.Figure.paintChildren(Figure.java:1170)
	at org.eclipse.draw2d.Figure.paintClientArea(Figure.java:1209)
	at org.eclipse.draw2d.Figure.paint(Figure.java:1120)
	at org.eclipse.draw2d.Figure.paintChildren(Figure.java:1170)
	at org.eclipse.draw2d.Figure.paintClientArea(Figure.java:1209)
	at org.eclipse.draw2d.Figure.paint(Figure.java:1120)
	at org.eclipse.draw2d.Figure.paintChildren(Figure.java:1170)
	at org.eclipse.draw2d.Figure.paintClientArea(Figure.java:1205)
	at org.eclipse.draw2d.Figure.paint(Figure.java:1120)
	at org.eclipse.gmf.runtime.diagram.ui.render.clipboard.DiagramGenerator.paintFigure(DiagramGenerator.java:373)
	at org.eclipse.gmf.runtime.diagram.ui.render.clipboard.DiagramGenerator.renderToGraphics(DiagramGenerator.java:226)
	at org.eclipse.gmf.runtime.diagram.ui.render.clipboard.DiagramGenerator.createSWTImageDescriptorForParts(DiagramGenerator.java:721)
	at org.eclipse.gmf.runtime.diagram.ui.render.util.CopyToImageUtil.copyToImage(CopyToImageUtil.java:376)
	at org.eclipse.gmf.runtime.diagram.ui.render.util.CopyToImageUtil.copyToImage(CopyToImageUtil.java:305)
	... 127 more
Re: NullPointerException during programmatically generation of diagram Images [message #1718417 is a reply to message #1718384] Wed, 23 December 2015 13:47 Go to previous messageGo to next message
Maxime Porhel is currently offline Maxime PorhelFriend
Messages: 500
Registered: July 2009
Location: Nantes, France
Senior Member
Hi Mehmet,

Thank you for your feedback,

Bug 484507 [1] has been created last week for the same NPE but in
another scenario (menu > copy, which on Windows place the result of a
CoptyToImage in the system clipboard).

A patch has already been provided, but the issue has not yet been added
to any roadmap. The patch targets master and the issue has been marked
as potential target for a backport on maintenance branches.

Do you have compartments on your diagrams ?


Regards

Maxime


Le 23/12/2015 09:30, Emin M. a écrit :
> Hello,
>
> i am trying to generate Images of programmatically generated diagrams. I
> have Rectangles with rounded corners and during the paint methods sub
> calls the image creation fails.
> I think it fails because the OneLineMarginBorder objects int[] dash
> attribute is a null reference.
> Is this a bug? Is there any workaround to avoid this?
>
> Best regards
> Mehmet Karaman
>
>
> Caused by: java.lang.NullPointerException
> at
....
> org.eclipse.gmf.runtime.diagram.ui.render.util.CopyToImageUtil.copyToImage(CopyToImageUtil.java:305)
>
> ... 127 more
>


--
Maxime - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
--
[1] https://bugs.eclipse.org/bugs/show_bug.cgi?id=484507


Maxime Porhel - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: NullPointerException during programmatically generation of diagram Images [message #1718424 is a reply to message #1718417] Wed, 23 December 2015 14:40 Go to previous messageGo to next message
Mehmet Karaman is currently offline Mehmet KaramanFriend
Messages: 61
Registered: November 2012
Location: Berlin
Member
Thank you for the reply.

Yes i have compartments. Is this problem related to compartments or rounded corner diagram elements?

[Updated on: Wed, 23 December 2015 14:45]

Report message to a moderator

Re: NullPointerException during programmatically generation of diagram Images [message #1718430 is a reply to message #1718424] Wed, 23 December 2015 15:17 Go to previous message
Maxime Porhel is currently offline Maxime PorhelFriend
Messages: 500
Registered: July 2009
Location: Nantes, France
Senior Member
Le 23/12/2015 15:40, Emin M. a écrit :
> Yes i have compartments. Is this problem related to compartments or
> rounded corner diagram elements?


This issue is related to compartments and their shared border, as soon
as there is more than one compartment in the same container.

Regards

--
Maxime - Obeo

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


Maxime Porhel - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Previous Topic:Tree element label goes blank when selected
Next Topic:Label Expression with String
Goto Forum:
  


Current Time: Thu Jan 21 08:59:05 GMT 2021

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

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

Back to the top