container border not shown by default any more? [message #162012] |
Thu, 22 November 2007 09:35 |
paolo russian Messages: 81 Registered: July 2009 |
Member |
|
|
Hy, I edited a StackLayout in a container EditPart of mine, but since I
did it when I place this container to the stage gmf no longer shows me its
borders.
I can click'ndrag to select an area around the component and then the
borders are shown, so I can resize it, but where is the class, what is the
method name dealing with the border stuff?
Because I need it the border always to be shown (as it normally happens).
what I did is customizing this way:
figure.setLayoutManager(new StackLayout() {
public void layout(IFigure figure) {
Rectangle r = figure.getClientArea();
List children = figure.getChildren();
IFigure child;
Dimension d;
int mywidth=60;
int myheight=100;
d=figure.getPreferredSize(mywidth, myheight);
mywidth=mywidth;
for (int i = 1; i < children.size(); i++) {
child = (IFigure)children.get(i);
d = child.getPreferredSize(r.width, r.height);
d.width = Math.min(d.width, r.width);
d.height = Math.min(d.height, r.height);
Rectangle childRect = new Rectangle(
r.x+mywidth*i-mywidth,
r.y,
mywidth, r.height);
child.setBounds(childRect);
}
}
});
This customization make the container's children to be drawn not one ontop
the other (covering each other, as happens by default) but to an "x"
offset depending by their width. So, in other words, each of them is
visible like in a grid. It works very well, but the border of the
container (where this method above is implemented) has been killed :D
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03566 seconds