Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Compartment auto Size
Compartment auto Size [message #640690] Mon, 22 November 2010 15:12 Go to next message
Eclipse UserFriend
Hi experts,

I have a compartment A, that could contains 2 other compartment B and C, A can change its size when i add other figures, so i dlike to have the compartment B and C having the same size asA whenver it change.

any ideas?

thanks
Re: Compartment auto Size [message #640827 is a reply to message #640690] Tue, 23 November 2010 05:13 Go to previous messageGo to next message
Eclipse UserFriend
Hi,
Elhamlaoui Mahmoud wrote on Tue, 23 November 2010 01:42

I have a compartment A, that could contains 2 other compartment B and C

AFAIK you cannot nest compartments within other compartments.

- Asiri
Re: Compartment auto Size [message #640829 is a reply to message #640827] Tue, 23 November 2010 05:22 Go to previous messageGo to next message
Eclipse UserFriend
Hi Asiri,

I was expecting so:(, Is there a way so i can refresh programmatically the proprty of a figure?

Thanks
Re: Compartment auto Size [message #640831 is a reply to message #640829] Tue, 23 November 2010 05:25 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

Elhamlaoui Mahmoud wrote on Tue, 23 November 2010 15:52
Is there a way so i can refresh programmatically the proprty of a figure?

Sorry, It's bit unclear for me what you are trying to achieve Sad

- Asiri
Re: Compartment auto Size [message #640840 is a reply to message #640831] Tue, 23 November 2010 05:42 Go to previous messageGo to next message
Eclipse UserFriend
HI Asiri,

http://gmfsamples.tuxfamily.org/wiki/lib/exe/detail.php?id=gmf_tutorial7&media=gmf-tuto7-diagram.png

Well what i try to do, for example is to have the compartment "classroom" getting the same height and width as his parent "The shool". i hope i mad it much clearer,

thanks again Smile
Re: Compartment auto Size [message #640854 is a reply to message #640690] Tue, 23 November 2010 06:01 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

Ok, first of all school & classroom are both nodes (not compartments), but both of them have inner compartments; school's compartment holds classrooms and classroom's compartment holds students.

What you need to do is employ a list compartment as the school's compartment and then modify the createFigure() method of SchoolXXXCompartmentEditPart like below:

/**
 * @generated NOT
 */
public IFigure createFigure() {
	ResizableCompartmentFigure result = (ResizableCompartmentFigure) super.createFigure();
	result.setTitleVisibility(false);

	ConstrainedToolbarLayout layout = (ConstrainedToolbarLayout) result.getContentPane().getLayoutManager();
	layout.setVertical(flag1);
	layout.setStretchMajorAxis(flag2);
	layout.setStretchMinorAxis(flag3);

	return result;
}

Now, you'll have to experiment with those flags (true / false) in order to get your desired behaviour. I always forget how they work and mix and match until I get what I need Smile

- Asiri
Re: Compartment auto Size [message #640924 is a reply to message #640854] Tue, 23 November 2010 10:03 Go to previous message
Eclipse UserFriend
I was trying a complex solution, it rembers me of the citation said, "simplicity leads to an extreme becomes elegance", by the way the flag should be set to true
Previous Topic:Square displayed in a list compartment
Next Topic:Creation Diagram file
Goto Forum:
  


Current Time: Tue Sep 09 18:43:49 EDT 2025

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

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

Back to the top