XYLayoutEditPolicy in GMF generated code [message #196969] |
Mon, 14 July 2008 16:42 |
Eclipse User |
|
|
|
Originally posted by: jk6803.yahoo.com
Hi
I have an issues on XYLayoutEditPolicy.In GMF generated code itself,
shapes and connection works properly but after adding XYLayoutEditPolicy
to draw something, the shapes are always located at the left-top corner.
Here is part of DiagramEditPart code.
What should I override the methods?
protected void createDefaultEditPolicies() {
super.createDefaultEditPolicies();
installEditPolicy(EditPolicyRoles.SEMANTIC_ROLE,
new DiagramItemSemanticEditPolicy());
installEditPolicy(EditPolicyRoles.CANONICAL_ROLE,
new DiagramCanonicalEditPolicy());
installEditPolicy(EditPolicy.LAYOUT_ROLE,
new PointShapeXYLayoutEditPolicy());
}
thanks
|
|
|
|
Re: XYLayoutEditPolicy in GMF generated code [message #197494 is a reply to message #197304] |
Wed, 16 July 2008 23:33 |
Eclipse User |
|
|
|
Originally posted by: jk6803.yahoo.com
Hi Alex,
What I did is that after generating GMF model, I added my own menu on the
palette and created "XXcreateCommand" which implemented Command interface
of GEF. There are two problems in case of adding menu.
1. Whenever I tried to cast Diagram object, it raised classcasting
exeception.
protected MyDiagram getCastedModel() {
return (MyDiagram) getModel();
}
2. I cannot add my own editpart in the EditFactoryPartClass.
public EditPart createEditPart(EditPart context, Object model) {
if (model instanceof View) {
View view = (View) model;
switch (Test.diagram.part.MyVisualIDRegistry.getVisualID(view))
MyEditPart();
}
Once a custom menu is added on the palette, what classes are should be
modified?.
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.06257 seconds