Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Box-in-Box view for compartment
Box-in-Box view for compartment [message #172789] Mon, 18 February 2008 09:43 Go to next message
Eclipse UserFriend
Hello all,
I have requirement where we are required to display recursively the
compartment contaning the nodes which has child compartment with
node..something like a treeViewer

I would like to display compartments in Box-in-Box view appraoch
|------------------------------|
| comp1 |
| |------comp2------------| |
| | ----- ----- | |
| | |comp3| |comp4| | |
| | | | | | | |
| | |-----| |-----| | |
| | |comp5| | |
| | |-----| | |
| |----------------------- |
| |
|------------------------------|

Please let me know what is best approach to achieve this ? Or is there any
better layout for recursive compartment?

Regrads
BG
Re: Box-in-Box view for compartment [message #172826 is a reply to message #172789] Mon, 18 February 2008 11:33 Go to previous messageGo to next message
Eclipse UserFriend
Hello BG,

Just Define NodeMapping containing ChildReference referensing this NodeMapping
as "referencedChild".

Another way to visualize tree-like structure is by using "Visualize containments
as links" GMF feature: http://www.eclipse.org/gmf/new/gmf-new-1.0.php

-----------------
Alex Shatalin
Re: Box-in-Box view for compartment [message #172866 is a reply to message #172826] Mon, 18 February 2008 22:38 Go to previous messageGo to next message
Eclipse UserFriend
Hello Mr Shatalin,
Thanks for reply,I am following the same " Endless/recursive hierarchies"
the output also appearing fine.But it appears as stack one over the other
Rather i would it to be something similar
"http://www.eclipse.org/gmf/new/gmf-new-1.0.php" .Mindmap example .To
achive this what layout do i need to choose ?.As i have nested hireachy
upto 10(Compartments).I tried with ListCompartmentEditPart, it comes in
row ...

Cuurently iam using the ShapeCompartmentEditPart....? Do i need write some
editpolices or do i need createFigure method ResizableCompartmentFigure
result = (ResizableCompartmentFigure) super.createFigure()........;.


Also i have another query.
When i tried to pull a box [element] from one compartment it comes out ?
But same thing doesn't happen the Mindmap example ?
Re: Box-in-Box view for compartment [message #172904 is a reply to message #172866] Tue, 19 February 2008 05:41 Go to previous messageGo to next message
Eclipse UserFriend
Hello BG,

> "http://www.eclipse.org/gmf/new/gmf-new-1.0.php" .Mindmap example .To
In this example sub-nodes probably were manually layed-out.

> upto 10(Compartments).I tried with ListCompartmentEditPart, it comes
> in row ...
That was my suggestion.

> Cuurently iam using the ShapeCompartmentEditPart....? Do i need write
You should probably take care on layout process (popup menu/Arrange all)

> But same thing doesn't happen the Mindmap example ?
I think the reason is: in your model corresponding nodes can be created on
top of diagram.
AFAIR it is not possible to change this behavior without manual code modification
for now.

-----------------
Alex Shatalin
Re: Box-in-Box view for compartment [message #172912 is a reply to message #172826] Tue, 19 February 2008 06:48 Go to previous messageGo to next message
Eclipse UserFriend
hi alex,

this "Visualize containments as links" but I it's not described there
how I can model it?

-stefan

Alex Shatalin wrote:
> Hello BG,
>
> Just Define NodeMapping containing ChildReference referensing this
> NodeMapping as "referencedChild".
>
> Another way to visualize tree-like structure is by using "Visualize
> containments as links" GMF feature:
> http://www.eclipse.org/gmf/new/gmf-new-1.0.php
>
> -----------------
> Alex Shatalin
>
>
Re: Box-in-Box view for compartment [message #172935 is a reply to message #172912] Tue, 19 February 2008 07:15 Go to previous messageGo to next message
Eclipse UserFriend
Hello SKuhn,

> this "Visualize containments as links" but I it's not described there
> how I can model it?
Just leave TopNodeReference.containmentFeature blank and use this containment
feature to define reference-only link.

-----------------
Alex Shatalin
Re: Box-in-Box view for compartment [message #172979 is a reply to message #172904] Tue, 19 February 2008 11:08 Go to previous messageGo to next message
Eclipse UserFriend
Hello Mr Shatalin,
Iam now using the ArrangeAll request to arrange the compartments
i.e
ArrangeRequest arrangeRequest = new
ArrangeRequest(ActionIds.ACTION_ARRANGE_ALL);


//DiagramEditor diagramEditor1 = (DiagramEditor)
getActEditorPart();
DiagramEditPart diagramEditPart =
diagramEditor.getDiagramEditPart();

SelectInDiagramHelper.activateDiagram(diagramEditPart.getDia gramView());
List<?> l = diagramEditPart.getChildren();



Command arrangeCmd = diagramEditPart.getCommand(arrangeRequest);
arrangeCmd.execute();

But is just arranging the first compartment. Is does not arrange the inner
compartments.

I want something similar to happen like combination of
"selectall/arrangeall".How can i achieve this ?.

Regards
BG
Re: Box-in-Box view for compartment [message #173237 is a reply to message #172935] Thu, 21 February 2008 03:54 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: kamesh.sampath.gmail.com

Hi Alex,

I have a tricky situation in modelling and desinging Parent - Child
relationship.

The root of my model has the 1-1 containment reference with Type A, it
cant hold Type B and Type C.

"Type A" which shares 1-* containment reference with "Type B" and "Type B"
has 1-* containment reference with "Type C"

I dont want the Box in Box view depicting the "Type B" - "Type C"
relationship , i want them to be depicted as links.

The idea is to have OpenDiagram bevahior for "Type A" and within that I
will model elements "Type B" and "Type C" as separate diagram elements and
use links to connect "Type B" and "Type C"

Is this possible to achieve this in GMF and depicted diagramatically ?? If
yes can you provide some insight to it or any pointers will help.

Reagrds,
Kamesh
Re: Box-in-Box view for compartment [message #173302 is a reply to message #173237] Thu, 21 February 2008 06:53 Go to previous messageGo to next message
Eclipse UserFriend
Hello Kamesh,

Try modeling Type B -> Type C containment as a link, but you can face some
future problems. It definitely works then diagram element (Type A) can not
contain "phantom" node (Type C) but you can see some propbelms in your situation.
I suggest you to try it and then fix an errors in generated code.

-----------------
Alex Shatalin
Re: Box-in-Box view for compartment [message #173322 is a reply to message #173302] Thu, 21 February 2008 07:25 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: kamesh.sampath.gmail.com

Hi Alex,

Whats the problems that could potentially occur ? Can you please explain
wht are they ?

Whats the best practice in this situation to model this kind of
relationships so that we can express it neatly in the GMF.

-Kamesh
Re: Box-in-Box view for compartment [message #173344 is a reply to message #173322] Thu, 21 February 2008 07:36 Go to previous messageGo to next message
Eclipse UserFriend
Hello Kamesh,

I suppoose destination Type B instance to jump into resource root on deleting
the link representing containment.
You can face some other problems - I never tested this situation myself.
Feel free to file a bugzill arequests to correct these issues.

-----------------
Alex Shatalin
Re: Box-in-Box view for compartment [message #173465 is a reply to message #173344] Thu, 21 February 2008 10:32 Go to previous messageGo to next message
Eclipse UserFriend
Hi Alex,

Got it ! let me try the same and let the group know about the issues.

Thanks
Kamesh

"Alex Shatalin" <vano@borland.com> wrote in message
news:3c3172e61e4d48ca42a5de823f16@news.eclipse.org...
> Hello Kamesh,
>
> I suppoose destination Type B instance to jump into resource root on
> deleting the link representing containment. You can face some other
> problems - I never tested this situation myself.
> Feel free to file a bugzill arequests to correct these issues.
>
> -----------------
> Alex Shatalin
>
>
Re: Box-in-Box view for compartment [message #173480 is a reply to message #173344] Thu, 21 February 2008 12:31 Go to previous messageGo to next message
Eclipse UserFriend
Hi Alex,

I am now terribly confused, how am suppose to define the Containment as
Links.

I have attached the Models for your reference - the link part is dirty (
where the confusion exists)

Can you please clarify the Containment Links in this context . I am not able
to follow how to do it from the newgroups post .

I hope we can then post it as an article in the GMF Wiki to help others like
me.

Please let me know am doing something wrong or is there a trouble with my
model.

Regards,
Kamesh



"Alex Shatalin" <vano@borland.com> wrote in message
news:3c3172e61e4d48ca42a5de823f16@news.eclipse.org...
> Hello Kamesh,
>
> I suppoose destination Type B instance to jump into resource root on
> deleting
> the link representing containment.
> You can face some other problems - I never tested this situation myself.
> Feel free to file a bugzill arequests to correct these issues.
>
> -----------------
> Alex Shatalin
>
>








Re: Box-in-Box view for compartment [message #175424 is a reply to message #173480] Tue, 04 March 2008 05:59 Go to previous message
Eclipse UserFriend
Hello Kamesh,

you have to:
1. Stecify 2 top-level nodes for "State", "City" leaving "containmentFeature"
blank
2. Create 2 link mappings with "targetFeature"s set to: "states", "cities"

As a result you should be able to:
- create new Countries on diagram
- create new States on diagram and connect existing Countries with newly
created States by first type of the link
- create new Cities on the diagram and connect existing States with newly
creates Cities by second type of the link

-----------------
Alex Shatalin
Previous Topic:FlowLayout for NonContainmentFeature in Compartment
Next Topic:Generated GMF Property Sheet problem, editor embedded in multipage editor.
Goto Forum:
  


Current Time: Mon Jul 14 16:11:16 EDT 2025

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

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

Back to the top