Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Layout error (move element)
Layout error (move element) [message #184866] Wed, 30 April 2008 09:36
Eclipse UserFriend
Hi!
I have a custom layout to be applied to a compartment figure. This is a
customized XYLayoutEditPolicy, and I want to apply it when I move certain
elements, so I catch the ChangeBoundsRequest in the getCommand function. I
do a super.getCommand(request), and in and in a certain point I have a
ClassCastException. This is the exception:

************
java.lang.ClassCastException:
org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbar Layout cannot be
cast to org.eclipse.draw2d.XYLayout
at
org.eclipse.gef.editpolicies.XYLayoutEditPolicy.getXYLayout( XYLayoutEditPolicy.java:131)
at
org.eclipse.gef.editpolicies.XYLayoutEditPolicy.getLayoutOri gin(XYLayoutEditPolicy.java:110)
at
org.eclipse.gef.editpolicies.XYLayoutEditPolicy.getConstrain tFor(XYLayoutEditPolicy.java:53)
at
org.eclipse.gmf.runtime.diagram.ui.editpolicies.XYLayoutEdit Policy.getConstraintFor(XYLayoutEditPolicy.java:228)
at
org.eclipse.gef.editpolicies.ConstrainedLayoutEditPolicy.get ResizeChildrenCommand(ConstrainedLayoutEditPolicy.java:268)
at
org.eclipse.gef.editpolicies.ConstrainedLayoutEditPolicy.get MoveChildrenCommand(ConstrainedLayoutEditPolicy.java:281)
at
org.eclipse.gef.editpolicies.LayoutEditPolicy.getCommand(Lay outEditPolicy.java:193)
at
org.eclipse.gef.editpolicies.ConstrainedLayoutEditPolicy.get Command(ConstrainedLayoutEditPolicy.java:154)
at
org.eclipse.gmf.runtime.diagram.ui.editpolicies.XYLayoutEdit Policy.getCommand(XYLayoutEditPolicy.java:327)
at
es.cv.gvcase.mdt.uim.diagram.navigationIU.edit.policies.Elem entsXYLayoutEditPolicy.getCommand(ElementsXYLayoutEditPolicy .java:86)
...
************

Failed when cast a ConstrainedToolbarLayout to a XYLayout. The code that
makes this exception is the following (in XYLayoutEditPolicy):

************
protected XYLayout getXYLayout() {
if (xyLayout == null) {
IFigure container = getLayoutContainer();
xyLayout = (XYLayout)container.getLayoutManager();
}
return xyLayout;
}
************

This 'container' IFigure is the compartment, and it has a BorderLayout, I
don't know if this has anyting to do with this exception...
Anybody can help me please?

Thanks to everybody.
Previous Topic:new to gmf
Next Topic:How to programatically "Initialize diagram file" ?
Goto Forum:
  


Current Time: Thu Jul 24 23:54:58 EDT 2025

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

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

Back to the top