Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Using GridLayer without ScalableRootEditPart
Using GridLayer without ScalableRootEditPart [message #238638] Tue, 25 September 2007 17:36
Eclipse UserFriend
Originally posted by:

Hi all, if I have an editor which configures the graphical viewer like so:

protected void 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)));

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.
Previous Topic:context sensitive help
Next Topic:[Announce] GEF 3.4 Project Plans
Goto Forum:

Current Time: Fri May 25 15:09:23 GMT 2018

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

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

Back to the top