|
Re: justify items inside a compartment, [message #637839 is a reply to message #637752] |
Tue, 09 November 2010 06:38 |
|
Hi,
What kind of a compartment are you using? AFAIR list compartments by default layout their items left justified (what kind of items btw?), you can customize the compartment layout within the XXXCompartmentEditPart like below:
/**
* @generated NOT
*/
public IFigure createFigure() {
ResizableCompartmentFigure result = (ResizableCompartmentFigure) super.createFigure();
result.setTitleVisibility(false);
ConstrainedToolbarLayout layout = (ConstrainedToolbarLayout) result.getContentPane().getLayoutManager(); // Works only with list compartments.
// Configure layout.
return result;
}
Now if your compartment is a shape compartment (free form), I don't think you should be trying to left justify items in it. Also note that "affixed parent side" is used for a completely different purpose.
Hope this helps.
- Asiri
|
|
|
|
|
Re: justify items inside a compartment, [message #637924 is a reply to message #637752] |
Tue, 09 November 2010 11:20 |
|
Hi,
ConstrainedToolbarLayout has several options like setStretchMajorAxis(), setStretchMinorAxis() and setIgnoreInvisibleChildren() did you fiddle with them to see if you can achieve your goal with them? Sometimes I just set / unset these flags and observe the effect they make, and most of the time some combination works out
- Asiri
[Updated on: Tue, 09 November 2010 11:21] Report message to a moderator
|
|
|
|
Re: justify items inside a compartment, [message #637939 is a reply to message #637752] |
Tue, 09 November 2010 12:16 |
|
Hi,
public IFigure createFigure() {
ResizableCompartmentFigure result = (ResizableCompartmentFigure) super.createFigure();
ConstrainedToolbarLayout layout = (ConstrainedToolbarLayout) result.getContentPane().getLayoutManager();
layout.setStretchMinorAxis(true);
layout.setMinorAlignment(FlowLayout.ALIGN_LEFTTOP);
layout.setMinorAlignment(FlowLayout.ALIGN_LEFTTOP);
layout.setSpacing(20);
result.setLayoutManager(layout); // This is wrong.
result.setTitleVisibility(false);
return result;
}
I think you are trying to override the layout manager of the ResizableCompartmentFigure; we are only adjusting the content pane's layout manager so setting the layout manager of ResizableCompartmentFigure is wrong. May be try removing that line?
- Asiri
|
|
|
|
Powered by
FUDForum. Page generated in 0.03111 seconds