setMaximumSize [message #671117] |
Mon, 16 May 2011 15:35 |
Eclipse User |
|
|
|
Hello,
Could anyone tell me why the method "setMaximumSize" the following example doesn't prevent the extension of the element to the size of 600 x 400 for example?
/**
* @generated
*/
public class BoxFigure extends RectangleFigure {
/**
* @generated
*/
private WrappingLabel fFigureBoxLabelFigure;
/**
* @generated NOT
*/
public BoxFigure() {
this.setPreferredSize(new Dimension(getMapMode().DPtoLP(100),
getMapMode().DPtoLP(50)));
this.setBorder(new MarginBorder(getMapMode().DPtoLP(5),
getMapMode().DPtoLP(5), getMapMode().DPtoLP(5),
getMapMode().DPtoLP(5)));
this.setMinimumSize(new Dimension(getMapMode().DPtoLP(150),
getMapMode().DPtoLP(100)));
this.setMaximumSize(new Dimension(getMapMode().DPtoLP(300),
getMapMode().DPtoLP(200)));
createContents();
}
/**
* @generated
*/
private void createContents() {
fFigureBoxLabelFigure = new WrappingLabel();
fFigureBoxLabelFigure.setText("Box");
this.add(fFigureBoxLabelFigure);
}
/**
* @generated
*/
public WrappingLabel getFigureBoxLabelFigure() {
return fFigureBoxLabelFigure;
}
}
The method "setMinimumSize" works correctly: can't reduce the element beyond what is allowed.
Thanks a lot!
Elvis
|
|
|
Powered by
FUDForum. Page generated in 0.03365 seconds