|
|
|
Re: Splitting Editor Panel in Areas [message #226236 is a reply to message #226220] |
Wed, 15 April 2009 15:07 |
Alexander Shatalin Messages: 2928 Registered: July 2009 |
Senior Member |
|
|
Hello Patrick,
> Yes could be possible, what kind of elements should these containers
> be, and its possible that they automatically fill the editor panel
> completely ?
Then i think it's better for you to wollow this direction. From the very
beggining these two classes will not fill whole editor area, but I suppose
it's much more easy to modify editor and layout these elements appropriately
then to deal with custom editpolicies/requests/figures while implementing
second solution.
I'm suggesting you first generate diagram code and then modify refreshBounds()
method of two top-level EditParts to not load/set bounds from notation model,
but rather calculate it based on a diagram size..
Here is a code from ShapeEditPart responsible for loading coordinates from
notation model:
int width = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_ Width())).intValue();
int height = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getSize_ Height())).intValue();
Dimension size = new Dimension(width, height);
int x = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocat ion_X())).intValue();
int y = ((Integer) getStructuralFeatureValue(NotationPackage.eINSTANCE.getLocat ion_Y())).intValue();
Point loc = new Point(x, y);
((GraphicalEditPart) getParent()).setLayoutConstraint(this, getFigure(),
new Rectangle(loc, size));
-----------------
Alex Shatalin
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04545 seconds