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 13: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.
Previous Topic:context sensitive help
Next Topic:Focus rectangle is not drawn in 3.3
Goto Forum:
  


Current Time: Mon Sep 01 09:51:39 EDT 2014

Powered by FUDForum. Page generated in 0.01870 seconds