Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » JFace Error
JFace Error [message #989853] Sat, 08 December 2012 14:31 Go to next message
Tim E. is currently offline Tim E.Friend
Messages: 56
Registered: November 2012
Member
Hi again,

I don't know how I accomplished it, but I broke pretty much everything
and I'm desperately looking for help.

I get the following error log when I do the following in my ClassDiagram editor
-- add one class (everything is fine)
-- add a second class -> boom

The beginning of the error log is: (complete error log is attched)
!ENTRY org.eclipse.jface 4 2 2012-12-08 17:11:02.913
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.jface".
!STACK 0
java.lang.NullPointerException
	at org.eclipse.graphiti.ui.internal.figures.GFAbstractShape.fillPath

(GFAbstractShape.java:337)
	at org.eclipse.graphiti.ui.internal.figures.GFAbstractShape.paintShape

(GFAbstractShape.java:498)
	at org.eclipse.graphiti.ui.internal.figures.GFAbstractShape.fillShape

(GFAbstractShape.java:541)
	at org.eclipse.draw2d.Shape.paintFill(Shape.java:195)
	at org.eclipse.draw2d.Shape.paintFigure(Shape.java:143)
	at org.eclipse.graphiti.ui.internal.figures.GFAbstractShape.paintFigure

(GFAbstractShape.java:528)
	at org.eclipse.draw2d.Figure.paint(Figure.java:1115)
	at org.eclipse.draw2d.Figure.paintChildren(Figure.java:1167)
	at org.eclipse.draw2d.Figure.paintClientArea(Figure.java:1206)
	at org.eclipse.draw2d.Figure.paint(Figure.java:1117)
	at org.eclipse.draw2d.Figure.paintChildren(Figure.java:1167)
	at org.eclipse.draw2d.Figure.paintClientArea(Figure.java:1202)
	at org.eclipse.draw2d.Figure.paint(Figure.java:1117)
	at org.eclipse.draw2d.Figure.paintChildren(Figure.java:1167)
	at org.eclipse.draw2d.Figure.paintClientArea(Figure.java:1202)
	at org.eclipse.draw2d.Figure.paint(Figure.java:1117)
	at org.eclipse.draw2d.Figure.paintChildren(Figure.java:1167)
	at 

org.eclipse.graphiti.ui.internal.fixed.FixedScalableFreeformLayeredPane.paintClientArea
(FixedScalableFreeformLayeredPane.java:53)
...
...
...


I tried the following things up to now:

-- use git to reset to a working state -> broken in any commit
-- download new eclipse, import Project -> broken
-- set up a new project and copy all files, except of plugin.xml and MANIFEST.MF -> broken

If you need more code or something, please let me know.

I'd appreciate any help. Thanks in advance,
Tim
  • Attachment: error.txt
    (Size: 45.87KB, Downloaded 275 times)

[Updated on: Sat, 08 December 2012 16:14]

Report message to a moderator

Re: Using Patterns (at least trying) [message #989855 is a reply to message #989853] Sat, 08 December 2012 14:44 Go to previous messageGo to next message
Tim E. is currently offline Tim E.Friend
Messages: 56
Registered: November 2012
Member
Found the error.

I build my own implementation of a ContainerShape and used the following code:
gaService.setRenderingStyle(roundedRectangle,Globals.CLASSOBJECT_GRADIENT_COLOR);


where Globals looks like this:
public static final AdaptedGradientColoredAreas CLASSOBJECT_GRADIENT_COLOR = PredefinedColoredAreas.getBlueWhiteGlossAdaptions();


I'm not sure, why this causes the error, but at least its working again Smile

Edit:

Using it like this, without Globals, works fine:
gaService.setRenderingStyle(roundedRectangle,PredefinedColoredAreas.getBlueWhiteGlossAdaptions());

[Updated on: Mon, 10 December 2012 11:42]

Report message to a moderator

Re: Using Patterns (at least trying) [message #990037 is a reply to message #989855] Mon, 10 December 2012 16:04 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Tim,

from the place the NPE happens I guess something is wrong with one of the
gradients you are using.

Michael
Re: Using Patterns (at least trying) [message #990162 is a reply to message #990037] Tue, 11 December 2012 08:29 Go to previous messageGo to next message
Tim E. is currently offline Tim E.Friend
Messages: 56
Registered: November 2012
Member
Hi Michael,

since I'm using the predefined ones, I still don't really understand the exception.

Should I do something about it, or just leave it?
Re: Using Patterns (at least trying) [message #990715 is a reply to message #990162] Thu, 13 December 2012 12:53 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Tim,

you should do something about it. Exceptions in rendering almost always mean
that something is not displayed as intended; sometimes even large parts of
the diagram, depending when and where the exception happens...

Michael
Re: Using Patterns (at least trying) [message #990723 is a reply to message #990715] Thu, 13 December 2012 20:27 Go to previous messageGo to next message
Tim E. is currently offline Tim E.Friend
Messages: 56
Registered: November 2012
Member
I guess you understood me wrong.

As I posted, instead of using
gaService.setRenderingStyle(roundedRectangle,Globals.CLASSOBJECT_GRADIENT_COLOR);

with
public static final AdaptedGradientColoredAreas CLASSOBJECT_GRADIENT_COLOR = PredefinedColoredAreas.getBlueWhiteGlossAdaptions();


I'm using this code at the moment
gaService.setRenderingStyle(roundedRectangle,PredefinedColoredAreas.getBlueWhiteGlossAdaptions());

that works fine, without any exceptions.

My question was aimed at: "Should I care why the first version is not working but the second? Or just take it as it is"

Sorry for the misunderstanding.

Cheers,
Tim

[Updated on: Thu, 13 December 2012 20:28]

Report message to a moderator

Re: Using Patterns (at least trying) [message #991296 is a reply to message #990723] Tue, 18 December 2012 12:09 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Tim,

sorry, now I undestood.

That's as expected. The method getBlueWhiteGlossAdaptions() creates a new
EMF object hierarchie that defines the gradients to be used for the shape.
Storing these objects in a static variable and reusing them will simply not
work for EMF objects, because thes need to be contained in a resource to be
resolvable lateron. Not being resolvable means being null, which causes the
NPE.

Michael
Re: Using Patterns (at least trying) [message #991864 is a reply to message #991296] Thu, 20 December 2012 11:24 Go to previous message
Tim E. is currently offline Tim E.Friend
Messages: 56
Registered: November 2012
Member
Hi,

thanks for the help and explanation

Cheers,
Tim
Previous Topic:Non-Emf Diagram Loading
Next Topic:Managing separate model files
Goto Forum:
  


Current Time: Thu Mar 28 22:05:11 GMT 2024

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

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

Back to the top