| Summary: | BorderLayout doesn't position child figure in the center | ||
|---|---|---|---|
| Product: | [Tools] GEF | Reporter: | Svetoslav Rusev <sv_rusev> |
| Component: | GEF-Legacy Draw2d | Assignee: | gef-inbox <gef-inbox> |
| Status: | RESOLVED INVALID | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | ppshah |
| Version: | 3.2 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows XP | ||
| Whiteboard: | |||
Pratik, is this the behavior before or after your recent change? Before. That was fixed a while back though. Svetoslav, what GEF build are you using? See bug 113008. (In reply to comment #2) > Before. That was fixed a while back though. Svetoslav, what GEF build are you > using? See bug 113008. > Hello, I'm using GEF 3.2 M4. Svet Rusev I think you might be confusing the border layout's positioning with the positioning of the text in the label. Add a border to the label to see what its exact size is. Label has its own methods to align the text. If you still think this is a bug, provide a complete snippet showing the problem. So, this is actually the behavior after the change. We are now stretching the center figure to fill the available space. Were you relying on the old behavior? We could support the old behavior by default and make 3.2 clients request the 3.2 behavior. As Pratik said, you can call setLabelAlignment() to get the text in the middle. Sorry - my mistake, I'm using GMF Framework and it generates a org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure with 3 containers inside one another the top 2 containers are with org.eclipse.draw2d.BorderLayout but the last one (the inner one) is with org.eclipse.gmf.runtime.draw2d.ui.figures.ConstrainedToolbarLayout and the Label which I wanted to be in the Center is added to this container. I needed to rewrite the layout(IFigure) method so that the Label goes in the Center. Do you know any other Layout that can be used instead of ConstrainedToolbarLayout in GMF? Because if I change it with BorderLayout the Label doesn't appear probably it needs to be another Constraint Layout. Sorry for the mistake! Svet The submitted bug report is not a bug but complex implmentation see Comment #6. I'm Sorry for your time! Svetoslav Rusev |
Hello, I had a problem which I think is a bug in the implementation of the BorderLayout.The problem is the positioning of a child figure in the Center of the parent figure with org.eclipse.draw2d.BorderLayout. Here is the exampe code: BorderLayout layout = new BorderLayout(); parent.setLayoutManager(layout ); IFigure child = new Label("Test"); parent.add(child , BorderLayout.CENTER); The child figure is positioned in the horizontal Center but not in the Vertical one. The child figure stays in the Top of the parent as the same as I have been given BorderLayout.TOP. If I give a constraint BorderLayout.BOTTOM it goes to the Bottom of the parent figure and all other constraints work only the Center constraint doesnot work. I'm using GEF 3.2.0 with GMF 1.0.0. My parent figure is: org.eclipse.gmf.runtime.gef.ui.figures.DefaultSizeNodeFigure, but I tried with also with org.eclipse.gmf.runtime.gef.ui.figures.NodeFigure and couple of others extending from NodeFigure. Thank you!