Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » setMaximumSize
setMaximumSize [message #669320] Mon, 09 May 2011 21:50 Go to next message
Elvis  is currently offline Elvis Friend
Messages: 15
Registered: May 2011
Junior Member
Hello,

Could anyone tell me why the method "setMaximumSize" the example below is not working?


public class BoxFigure extends RectangleFigure {

/**
* @generated
*/
private WrappingLabel fFigureBoxLabelFigure;
/**
* @generated
*/
private RectangleFigure fBoxContentCompartmentFigure;

/**
* @not generated
*/
public BoxFigure() {

this.setPreferredSize(new Dimension(getMapMode().DPtoLP(150),
getMapMode().DPtoLP(100)));

this.setBorder(new MarginBorder(getMapMode().DPtoLP(5),
getMapMode().DPtoLP(5), getMapMode().DPtoLP(5),
getMapMode().DPtoLP(5)));

this.setMaximumSize(new Dimension(getMapMode().DPtoLP(300),
getMapMode().DPtoLP(200)));

this.setMinimumSize(new Dimension(getMapMode().DPtoLP(150),
getMapMode().DPtoLP(100)));

createContents();
}


Thanks a lot!

Elvis
Re: setMaximumSize [message #669568 is a reply to message #669320] Tue, 10 May 2011 18:34 Go to previous messageGo to next message
Antonio Garcia-Dominguez is currently offline Antonio Garcia-DominguezFriend
Messages: 594
Registered: January 2010
Location: Birmingham, UK
Senior Member

We'd need a bit more information to help you. Could you please expand a bit more on what do you mean by "not working", and the rest of your code?
Re: setMaximumSize [message #670369 is a reply to message #669568] Fri, 13 May 2011 17:23 Go to previous messageGo to next message
Elvis  is currently offline Elvis Friend
Messages: 15
Registered: May 2011
Junior Member
Hi Antonio,

Thanks for the help, the issue is that I'm not able to use the method "setMaximumSize" the method "setMinimumSize" works correctly: can't reduce the element beyond what is allowed. Already the method "setMaximumSize(new Dimension(getMapMode().DPtoLP(300), getMapMode().DPtoLP(200)));" not prevent the extension of the element to the size of 600 x 400 for example.

Down the BoxEditPart (XXX.diagram.edit.parts):

/**
* @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;
}

}
Re: setMaximumSize [message #670385 is a reply to message #670369] Fri, 13 May 2011 18:41 Go to previous messageGo to next message
Antonio Garcia-Dominguez is currently offline Antonio Garcia-DominguezFriend
Messages: 594
Registered: January 2010
Location: Birmingham, UK
Senior Member

Hi Elvis,

Your problem seems to be specific to GEF. I think you'll get a much better answer if you ask your question at the GEF forum. You see, the Eugenia tool in Epsilon only generates the GMF models: the actual code is produced by GMF, and this code relies on the Graphical Editing Framework (GEF).
Re: setMaximumSize [message #671092 is a reply to message #670385] Mon, 16 May 2011 18:20 Go to previous message
Elvis  is currently offline Elvis Friend
Messages: 15
Registered: May 2011
Junior Member
Ok Antonio, I'll post there. thank you
Previous Topic:[eol] question about usage of native types
Next Topic:[Epsilon] Supported comment markers for eol languages
Goto Forum:
  


Current Time: Fri Apr 19 20:39:16 GMT 2024

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

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

Back to the top