Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » Eugenia /GMF
Eugenia /GMF [message #587420] Tue, 16 March 2010 12:08 Go to next message
Lishan is currently offline LishanFriend
Messages: 9
Registered: March 2010
Junior Member
>I am creating a dsl that draws diagrams with states(nodes) and transitions(links)
> and nested states and transitions.
> I want to be able to annotate states with default transitions. These are
> like normal transitions except they only have a target state and not a
> source state. Visually they look like small arrows which point to the
> start state in a diagram. I thought that the simplest way to implement
> these would be a variation on the link I have already specified (Transition) for normal
> transitions except they would not have a source. I have tried this excluding any specifications for source and it didn't work. I dont know how or if it
> is possible to specify a link like this in Eugenia/GMF. I guess I could
> implement it as a button under the connections group that annotates a
> state with a small arrow (not sure how to do this). I would like it to (although I can worry about this at a later date) also create a
> Transition object which has no source specified (but we want all of the
> other fields such as name and label)
> So basically I want a default transition button in the connections group
> which if clicked on, allows the user to select a state, and annotates the state with a small
> arrow. I would also like it to (although this isn't essential at this stage) create a Transition object whose target state is the state
> selected but without a source state. It allows the user to enter a label
> and all the other usual stuff for a Transition object.
>
> This is the .emf file I have so far.
>
> @namespace(uri="statemachine", prefix="statemachine")
> @gmf(foo="bar")
> package statemachine;
>
> //datatype BooleanExpression: String;
>
> datatype ContractFormula: String;
> datatype EventGuardActions: String;
> datatype Name: String;
>
>
>
> enum StateType {
> sequentialState;
> parallelState;
> conjState;
> }
>
> enum ScopeType {
> Local;
> Input;
> Output;
> }
>
> @gmf.node(label = "name", label.icon = "false")
> class Event {
> attr Name name;
> attr ScopeType scope;
> !ordered ref Transition[*]#event triggers;
> }
>
>
> @gmf.diagram(foo="bar")
> class Statemachine {
> attr Name name;
> !ordered val State[*] states;
> !ordered val Event[*] events;
> !ordered val Transition[*] transitions;
> }
>
>
> @gmf.node(label = "name", label.icon = "false")
> class State{
> attr Name name;
> attr StateType type;
> attr ContractFormula innercontract;
> attr ContractFormula outercontract;
> attr Boolean startstate;
> !ordered ref Transition[*]#source outgoing;
> !ordered ref Transition[*]#target incoming;
> !ordered ref State#substates parent;
> @gmf.compartment(foo="bar")
> !ordered val State[*]#parent substates;
> }
>
>
> @gmf.link(source="source", target="target", target.decoration="arrow",
> width = "1", label = "label", color = "0,0,255")
> class Transition {
> attr Name name;
> attr EventGuardActions label;
> attr Boolean default;
> !ordered ref Event#triggers event;
> !ordered ref State#outgoing source;
> !ordered ref State#incoming target;
> }
>
Re: Eugenia /GMF [message #587437 is a reply to message #587420] Tue, 16 March 2010 12:22 Go to previous messageGo to next message
Dimitrios Kolovos is currently offline Dimitrios KolovosFriend
Messages: 1776
Registered: July 2009
Senior Member
Hi Lishan,

The short answer is that unfortunately, Eugenia doesn't provide built-in
support for any of these requirements. On the bright side, they all seem
possible to implement with GMF (with a small reservation for the
source-less links) but that's the most I can say as I don't have
experience with implementing similar features. I'd suggest splitting up
the issues reported below and asking about each of them separately in
the GMF forum.

Cheers,
Dimitris

Lishan wrote:
>> I am creating a dsl that draws diagrams with states(nodes) and
>> transitions(links)
>> and nested states and transitions.
>> I want to be able to annotate states with default transitions. These are
>> like normal transitions except they only have a target state and not a
>> source state. Visually they look like small arrows which point to the
>> start state in a diagram. I thought that the simplest way to implement
>> these would be a variation on the link I have already specified
>> (Transition) for normal
>> transitions except they would not have a source. I have tried this
>> excluding any specifications for source and it didn't work. I dont
>> know how or if it
>> is possible to specify a link like this in Eugenia/GMF. I guess I could
>> implement it as a button under the connections group that annotates a
>> state with a small arrow (not sure how to do this). I would like it to
>> (although I can worry about this at a later date) also create a
>> Transition object which has no source specified (but we want all of the
>> other fields such as name and label)
>> So basically I want a default transition button in the connections group
>> which if clicked on, allows the user to select a state, and annotates
>> the state with a small
>> arrow. I would also like it to (although this isn't essential at this
>> stage) create a Transition object whose target state is the state
>> selected but without a source state. It allows the user to enter a label
>> and all the other usual stuff for a Transition object.
>>
>> This is the .emf file I have so far.
>>
>> @namespace(uri="statemachine", prefix="statemachine")
>> @gmf(foo="bar")
>> package statemachine;
>>
>> //datatype BooleanExpression: String;
>>
>> datatype ContractFormula: String;
>> datatype EventGuardActions: String;
>> datatype Name: String;
>>
>>
>>
>> enum StateType {
>> sequentialState;
>> parallelState;
>> conjState;
>> }
>>
>> enum ScopeType {
>> Local;
>> Input;
>> Output;
>> }
>>
>> @gmf.node(label = "name", label.icon = "false")
>> class Event {
>> attr Name name;
>> attr ScopeType scope;
>> !ordered ref Transition[*]#event triggers;
>> }
>>
>>
>> @gmf.diagram(foo="bar")
>> class Statemachine {
>> attr Name name;
>> !ordered val State[*] states;
>> !ordered val Event[*] events;
>> !ordered val Transition[*] transitions;
>> }
>>
>>
>> @gmf.node(label = "name", label.icon = "false")
>> class State{
>> attr Name name;
>> attr StateType type;
>> attr ContractFormula innercontract;
>> attr ContractFormula outercontract;
>> attr Boolean startstate;
>> !ordered ref Transition[*]#source outgoing;
>> !ordered ref Transition[*]#target incoming;
>> !ordered ref State#substates parent;
>> @gmf.compartment(foo="bar")
>> !ordered val State[*]#parent substates;
>> }
>>
>>
>> @gmf.link(source="source", target="target", target.decoration="arrow",
>> width = "1", label = "label", color = "0,0,255")
>> class Transition {
>> attr Name name;
>> attr EventGuardActions label;
>> attr Boolean default;
>> !ordered ref Event#triggers event;
>> !ordered ref State#outgoing source;
>> !ordered ref State#incoming target;
>> }
>>
>


--
Spread the word: http://www.eclipse.org/gmt/epsilon/spreadtheword
Follow Epsilon on Twitter: http://twitter.com/epsilonews
Re: Eugenia /GMF [message #587480 is a reply to message #587437] Tue, 16 March 2010 13:53 Go to previous message
Lishan is currently offline LishanFriend
Messages: 9
Registered: March 2010
Junior Member
Thank you for your suggestion about separating the issues and addressing them to the gmf forum.
Previous Topic:Eugenia /GMF
Next Topic:[EVL] Save EVL trace
Goto Forum:
  


Current Time: Wed Apr 24 13:56:20 GMT 2024

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

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

Back to the top