Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » setMaximumSize
setMaximumSize [message #671117] Mon, 16 May 2011 19:35
Elvis  is currently offline Elvis
Messages: 15
Registered: May 2011
Junior Member
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
Previous Topic:graph nodes and connections
Next Topic:Selection tool for selection of those edit parts too which are not in the primary layer.
Goto Forum:
  


Current Time: Sun Oct 26 09:32:15 GMT 2014

Powered by FUDForum. Page generated in 0.01898 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software