Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » Double click feather and canvas mapping
Double click feather and canvas mapping [message #114291] Mon, 26 March 2007 07:15 Go to next message
Eclipse UserFriend
Originally posted by: mcglinnk.cs.tcd.ie

Hey Guys,

I have two qeustions here, so bear with me a second please. The first is
regarding compartments, I would like to arrange my compartments like UML
swinlanes, so that they are side by side rather than one under the other.
Is that possible?

Also, I would like to have a node created within one of these elements
that when you double click creates a new canvas. Currently I am simply
trying to map this node onto the canvas I am working with (eventually this
should be an entirely different canvas).

It works fine to map a top node element (like in the taipan example) to
another canvas, but when I attempt to map a child node, like that of a
node in anohter node, it doesnt appear to work (it is doing something,
because I get that circle with a line through it appearing, it just isnt
opening another window).

I have tried having the node that maps to another canvas contained within
the node that contains the compartments and also tried to have the same
node contained within the main canvas element (the very top element).

Basically, I want to be able to create a swimlane node (like a uml
swimlane in an activity diagram), with compartments each of which have
child nodes (like uml activities) that can link to new diagrams (new
activity diagrams),

All help is much appreciated,

Thanks!

Kris.
Re: Double click feather and canvas mapping [message #114367 is a reply to message #114291] Mon, 26 March 2007 08:48 Go to previous messageGo to next message
Eclipse UserFriend
Hello Kris,

> is regarding compartments, I would like to arrange my compartments
> like UML swinlanes, so that they are side by side rather than one
> under the other. Is that possible?
AFAIU, for now you can modify generated XXXEcitPart.setupContentPane(IFigure
nodeShape) to set "ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout(false);"

> It works fine to map a top node element (like in the taipan example)
> to another canvas, but when I attempt to map a child node, like that
> of a node in anohter node, it doesnt appear to work (it is doing
> something, because I get that circle with a line through it appearing,
> it just isnt opening another window).
Try debugging generated OpenDiagramEditPolicy.

> Basically, I want to be able to create a swimlane node (like a uml
> swimlane in an activity diagram), with compartments each of which have
> child nodes (like uml activities) that can link to new diagrams (new
> activity diagrams),
Then you probably can benefit from UML2 Tools project: http://www.eclipse.org/modeling/mdt/?project=uml2tools#uml2t ools.

-----------------
Alex Shatalin
Re: Double click feature and canvas mapping [message #114450 is a reply to message #114367] Mon, 26 March 2007 12:28 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mcglinnk.cs.tcd.ie

Hey Alex,

Thanks for that. I tried out your instructions and changed the value
ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout(false);
Unfortunately it didnt seem to work, they are still layed out one after
the other from top down.

I also tried to debug the generated OpenDiagramEditPolicy. I placed a
breakpoint at:

protected String getDiagramKind() {
(*breakpoint) return CanvasEditPart.MODEL_ID;
}

To see if this is where the problem is occuring, and indeed it did throw
up the following error:
Invalid XML element ({0}).
and as a value it was returning CanvasEditPart.MODEL_ID; (which is hte
name of the model)

Any ideas why this should be causing a problem? I could send you my ecore
just to see if it sheds any light. As far as I can see the
OpenDiagramEditPolicy hasnt changed since my earlier versions where I only
had two classes a canvas and swinlane, where double clicking the swimlane
node opened a new diagram. This worked fine.

Thanks for your help,

Kris.
Re: Double click feature and canvas mapping [message #114640 is a reply to message #114450] Tue, 27 March 2007 08:17 Go to previous messageGo to next message
Eclipse UserFriend
Hello Kris,

> Thanks for that. I tried out your instructions and changed the value
> ConstrainedToolbarLayout layout = new ConstrainedToolbarLayout(false);
> Unfortunately it didnt seem to work, they are still layed out one
> after the other from top down.
I found more straightforward solution. You can:
- modify .gmfgraph containing diagram node used for displaying corresponding
nodes. You should specify proper layout for the figure attached to this diagram
node in .gmfgraph file. In particular, I suppose that you are using something
like “NamedNode” from basic.gmfmap referencing NamedNodeRectangle from the
same file. This figure (NamedNodeRectangle) has FlowLayout layout child specified.
You can modify property “vertical” of FlowLayout to control layout of the
chid nodes inside this figure.
- do not forget to re-generate .gmfgen file from .gmfmap after .gmfgraph
modification

> To see if this is where the problem is occuring, and indeed it did
> throw
AFAICSee, getDiagramKind() is called from several places in intializeNewDiagram().
I think, you can found the reason of this problem by debuggin intializeNewDiagram()
itself – this method is quite straightforward. In addition you can post original
stack traces (InvocationTargetException/ InterruptedException.printStackTrace)
here.

-----------------
Alex Shatalin
Re: Double click feature and canvas mapping [message #114703 is a reply to message #114450] Tue, 27 March 2007 09:19 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mcglinnk.cs.tcd.ie

Hey Alex,

Thanks for the replies so far, I appreciate your time and effort.
Regarding the first question, I cant seem to find a reference to
FlowLayout layout child. This option doesnt appear under my rectangle
figure properties. I have

Fill -> true
Line Kind -> LINE_SOLID
Line Width -> 1
Name -> SwimlanesFigure
Outline -> true
Xor Fill -> false
Xor Outline -> false

In the text editor it appears as

<figures
xsi:type="gmfgraph:Rectangle"
referencingElements="Swimlanes"
name="SwimlanesFigure">
<children
xsi:type="gmfgraph:Label"
name="SwimlanesFigureLabel"
text="SimCon Tool 0.1"/>
</figures>

Is it possible to change this using the text editor? And if so, would it
be possible to point me to documentation on all the properties of each of
the graphical elements, as I notice the option to change certain values
does not always appear(I noticed that there are additional properties in
the .gmfgen)?



Regarding the second question, and bear with me on this as I am a bit of a
novice in regards to debugging in eclipse. This time I placed the
breakpoint
in the following position in the initializeNewDiagram method:
--------
if (d == null) {
(*breakpoint) throw new ExecutionException("Can't create diagram of '"
+ getDiagramKind() + "' kind");

}

--------

It gave the following ExecutionException:

org.eclipse.core.commands.ExecutionException: Can't create diagram of
'Simcon' kind

Any ideas what might be causing this?

Also, are there any working examples in which child nodes within
compartments are used to open additional diagrams? If I could compare what
I am doing against a working example, I may have more success in
discovering the cause.

Thanks for your help!

Kris.
Re: Double click feature and canvas mapping [message #114737 is a reply to message #114703] Tue, 27 March 2007 09:38 Go to previous messageGo to next message
Eclipse UserFriend
Hello Kris,

> FlowLayout layout child. This option doesnt appear under my rectangle
> figure properties. I have
This is a child element of figure in .gmfgen model - you have to create it
using popup menu on RectangleFigure.

> Is it possible to change this using the text editor? And if so, would
> it be possible to point me to documentation on all the properties of
> each of the graphical elements, as I notice the option to change
> certain values does not always appear(I noticed that there are
> additional properties in the .gmfgen)?
The best place to gen an information about .gmfgen model properties/elements
is gmfgen.ecore file. ;-) In addition we have the following pages on the
web:

http://wiki.eclipse.org/index.php/GMFGraph_Hints
http://wiki.eclipse.org/index.php/GMF_Documentation

> Any ideas what might be causing this?
Looks like there is not diagram registered for the domain model element passed
as first parameter with the kind passed as a second.. Are you sure you are
using correct domain model element/correct diagram specified as a "Related
diagrams" property?

> Also, are there any working examples in which child nodes within
> compartments are used to open additional diagrams? If I could compare
> what I am doing against a working example, I may have more success in
> discovering the cause.
AFAIK, we have an examples for only top-level elements. Try debugging the
generated code deeply to get an understanding why diagram is null. Take a
look on the element passed to ViewService.createDiagram and compare it with
the element passed to the same method on opening diagram for top-level diagram
node.

-----------------
Alex Shatalin
Re: Double click feature and canvas mapping [message #114798 is a reply to message #114737] Tue, 27 March 2007 13:10 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mcglinnk.cs.tcd.ie

Hi Alex,

> This is a child element of figure in .gmfgen model - you have to create it
> using popup menu on RectangleFigure.

I dont think you have explained where I can find that popup menu, it
doesnt appear to be in my rectangle figure in .gmfgraph and it doesnt
appear to be anywhere in my .gmfgen, as far as I can understand from your
reply I need to create it in .gmfgraph to appear in .gmfgen? I gave you a
list of everything that I have in my .gmfgraph in the last message, and
there is no popup menu to do this.

> The best place to gen an information about .gmfgen model properties/elements
> is gmfgen.ecore file. ;-) In addition we have the following pages on the
> web:

> http://wiki.eclipse.org/index.php/GMFGraph_Hints
> http://wiki.eclipse.org/index.php/GMF_Documentation

Thanks!

> AFAIK, we have an examples for only top-level elements. Try debugging the
> generated code deeply to get an understanding why diagram is null. Take a
> look on the element passed to ViewService.createDiagram and compare it with
> the element passed to the same method on opening diagram for top-level
diagram
> node.

I will give this a go when I have some more time and let you know how I
progress,

Thanks,

Kris.
Re: Double click feature and canvas mapping [message #114841 is a reply to message #114798] Wed, 28 March 2007 03:01 Go to previous message
Eclipse UserFriend
Originally posted by: fbanica.soluta.net

For the Flow Layout, make right-click on the rectangle figure, select
NewChild/FlowLayout (see attachment - I hope it's allowed put a .png in the
attachment).



Floppy


"Kris McGlinn " <mcglinnk@cs.tcd.ie> wrote in message
news:b8a38a50805067237b6d2adf6c88db45$1@www.eclipse.org...
> Hi Alex,
>
>> This is a child element of figure in .gmfgen model - you have to create
>> it
>> using popup menu on RectangleFigure.
>
> I dont think you have explained where I can find that popup menu, it
> doesnt appear to be in my rectangle figure in .gmfgraph and it doesnt
> appear to be anywhere in my .gmfgen, as far as I can understand from your
> reply I need to create it in .gmfgraph to appear in .gmfgen? I gave you a
> list of everything that I have in my .gmfgraph in the last message, and
> there is no popup menu to do this.
>
>> The best place to gen an information about .gmfgen model
>> properties/elements
>> is gmfgen.ecore file. ;-) In addition we have the following pages on the
>> web:
>
>> http://wiki.eclipse.org/index.php/GMFGraph_Hints
>> http://wiki.eclipse.org/index.php/GMF_Documentation
>
> Thanks!
>
>> AFAIK, we have an examples for only top-level elements. Try debugging the
>> generated code deeply to get an understanding why diagram is null. Take a
>> look on the element passed to ViewService.createDiagram and compare it
>> with
>> the element passed to the same method on opening diagram for top-level
> diagram
>> node.
>
> I will give this a go when I have some more time and let you know how I
> progress,
>
> Thanks,
>
> Kris.
>


Previous Topic:GMF 1.0.3 - Customizing doubt
Next Topic:Internal error during create generator model
Goto Forum:
  


Current Time: Tue Jul 22 08:35:24 EDT 2025

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

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

Back to the top