Problem with drawing UML(CD) with Zest in a Plug-in [message #240216] |
Fri, 07 December 2007 20:13 |
Eclipse User |
|
|
|
Originally posted by: hamoun.gh.gmail.com
Hello all developers
I have a question about Zest framework and I hope this is the right
newsgroup to ask it. I am trying to use Zest to draw a UML class diagram in
an eclipse plugin.
1) I thought the only possible way to do so, is using pure SWT + Zest
instead of using Jface content providers. since they are not flexible for
drawing custom Node's figures. Is that so?
2) So I used SWT approach by the following code:
public class SWTGraphView extends ViewPart implements IModelChangeListener{
private Composite parent=null;
//public Graph graph=null;
public void createPartControl(Composite parent) {
ModelBase.getInstance().addModelChangeListener(this);
this.parent=parent;
final Display d = parent.getDisplay();
Graph g = new Graph(parent, SWT.NONE);
g.setConnectionStyle(ZestStyles.CONNECTIONS_DIRECTED);
GraphNode n1 = new GraphNode(g, SWT.NONE);
GraphNode n2 = new GraphNode(g, SWT.NONE);
n1.setCustomFigure(UMLExample.createClassFigure1 ());
n2.setCustomFigure(UMLExample.createClassFigure2());
new GraphConnection(g, SWT.NONE, n1, n2);
g.setLayoutAlgorithm(new
SpringLayoutAlgorithm(LayoutStyles.NO_LAYOUT_NODE_RESIZING), true);
..........................
}
}
However, I get the following error which I do not get when using Zest Jface
examples with simple node shapes in as a plugin:
java.lang.NoClassDefFoundError:
org/eclipse/mylyn/zest/core/widgets/internal/IContainer
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:23 89)
at java.lang.Class.getConstructor0(Class.java:2699)
at java.lang.Class.newInstance0 (Class.java:326)
at java.lang.Class.newInstance(Class.java:308)
......................
I used whatever bundling approach I knew (e.g. Require-Bundle: in manifest
file or same jar in the plug-in). Is it possible that, it is because Zest
packaging ( e.g IContainer being in internal package)? or you think it is
only classloaders and ....?
Thank you in advance for your answers,
Hamoun
|
|
|
[Zest] Re: Problem with drawing UML(CD) with Zest in a Plug-in [message #240281 is a reply to message #240216] |
Thu, 13 December 2007 21:51 |
Eclipse User |
|
|
|
Originally posted by: irbull.cs.uvic.ca
Hamoun wrote:
> Hello all developers
>
> I have a question about Zest framework and I hope this is the right
> newsgroup to ask it. I am trying to use Zest to draw a UML class diagram in
> an eclipse plugin.
>
> 1) I thought the only possible way to do so, is using pure SWT + Zest
> instead of using Jface content providers. since they are not flexible for
> drawing custom Node's figures. Is that so?
Currently yes, however, I have looked at the possibility of adding a
FigureProvider. I had one of these in the past, but I didn't like the
API (since you also have to deal with selected figures and hi-lighted
figures). I can investigate putting this back if you would like?
>
> 2) So I used SWT approach by the following code:
>
> public class SWTGraphView extends ViewPart implements IModelChangeListener{
> private Composite parent=null;
> //public Graph graph=null;
>
> public void createPartControl(Composite parent) {
> ModelBase.getInstance().addModelChangeListener(this);
> this.parent=parent;
> final Display d = parent.getDisplay();
> Graph g = new Graph(parent, SWT.NONE);
> g.setConnectionStyle(ZestStyles.CONNECTIONS_DIRECTED);
> GraphNode n1 = new GraphNode(g, SWT.NONE);
> GraphNode n2 = new GraphNode(g, SWT.NONE);
> n1.setCustomFigure(UMLExample.createClassFigure1 ());
> n2.setCustomFigure(UMLExample.createClassFigure2());
> new GraphConnection(g, SWT.NONE, n1, n2);
> g.setLayoutAlgorithm(new
> SpringLayoutAlgorithm(LayoutStyles.NO_LAYOUT_NODE_RESIZING), true);
> .........................
> }
> }
Yep, this was because IContainer was in the internal package. This has
been fixed in head. Are you using the build on the site?
> However, I get the following error which I do not get when using Zest Jface
> examples with simple node shapes in as a plugin:
> java.lang.NoClassDefFoundError:
> org/eclipse/mylyn/zest/core/widgets/internal/IContainer
> at java.lang.Class.getDeclaredConstructors0(Native Method)
> at java.lang.Class.privateGetDeclaredConstructors(Class.java:23 89)
> at java.lang.Class.getConstructor0(Class.java:2699)
> at java.lang.Class.newInstance0 (Class.java:326)
> at java.lang.Class.newInstance(Class.java:308)
> .....................
>
> I used whatever bundling approach I knew (e.g. Require-Bundle: in manifest
> file or same jar in the plug-in). Is it possible that, it is because Zest
> packaging ( e.g IContainer being in internal package)? or you think it is
> only classloaders and ....?
>
>
> Thank you in advance for your answers,
> Hamoun
>
>
Cheers,
ian
|
|
|
Powered by
FUDForum. Page generated in 0.01719 seconds