[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.gmf] Re: Layout information persistence

I found a workaround for the problem, by getting the child editparts from the OffscreenEditPart and iterating through the children list. With this solution there is no need to open an editor. The editparts' figures are containing the 'real' layout information, not just '-1' values.


Sample code:
..
CopyToImageUtil util = new CopyToImageUtil();
DiagramEditPart diagramEditPart = util.createDiagramEditPart(diagram, shell, preferencesHint);


List editparts = diagramEditPart.getChildren();

foreach(EditPart editpart: editpars)
{
  if(editpart instanceof GraphicalEditPart)
  {
    Bounds bounds = ((GraphicalEditPart)editpart).getFigure().getBounds();
  }
}


However it would be nice if I could persist all the graphical information to the diagram file and later load it back.