Using GridLayer without ScalableRootEditPart [message #238638] |
Tue, 25 September 2007 17:36 |
Eclipse User |
|
|
|
Originally posted by: matt.querix.com
Hi all, if I have an editor which configures the graphical viewer like so:
protected void configureGraphicalViewer() {
super.configureGraphicalViewer();
GraphicalViewer viewer = getGraphicalViewer();
viewer.setEditPartFactory(FormsEditPartFactory.getInstance() );
viewer.setRootEditPart(new ScalableFreeformRootEditPart());
// viewer.setRootEditPart(new ScalableRootEditPart());
and my root edit part create a figure like so:
protected IFigure createFigure() {
Figure figure = new FreeformLayer();
figure.setBorder(new MarginBorder(3));
figure.setLayoutManager(new FreeformLayout());
// create grid layer
GridLayer gridLayer = new GridLayer();
gridLayer.setSpacing(new Dimension(
FormsModel.convertWidthInCharsToPixels(this, 1),
FormsModel.convertHeightInCharsToPixels(this, 1)));
figure.add(gridLayer);
return figure;
}
I get a nice grid. However I don't really want to use
ScalableFreeformRootEditPart as negative coordinates make no sense.
Unfortunately if I comment-out the line viewer.setRootEditPart(new
ScalableFreeformRootEditPart()) and uncomment the line below, the grid
also disappears. Why?
If I change FreeformLayer to just Layer or Figure, and FreeformLayout to
XYLayout, I still don't get a grid.
Thanks in advance
Matt D.
|
|
|
Powered by
FUDForum. Page generated in 0.01243 seconds