dvdkruk / spray

Automatically exported from code.google.com/p/spray
0 stars 0 forks source link

Compartment in Rectangle with Superclass #247

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi together,

I want to visualisate for exmaple a webpage with a lot of controls in graphiti 
spray. I create a ecore-model with Tab, this tab contains pages (=container) 
where contains a lot of widgets (Labels, Buttons, etc.).

The question is why can't I referenced a superclass (=widget) for the container 
to the buttons or labels. This will not showing in the Toolbar and the 
code-generating getting error in SprayToolBehaviorProvider (because of not 
generating the class).

I attach the ecore-model und spray shapes files. Can you tell me how to do this 
with the superclass, or should I separatly references all widgets to container 
like pages?

The other question is, is it the right way to visualizate if I use a class (in 
the image it is SketchDomainModel) who reference to all classes in ecore.

Thanks for helping.

Greez Dowbar

What version of the product are you using? On what operating system?
0.5.0

Please provide any additional information below.
Eclipse Juno 4.2.2

Original issue reported on code.google.com by dowbar2...@googlemail.com on 2 Apr 2013 at 8:37

Attachments:

GoogleCodeExporter commented 8 years ago
Another question is, if I want to use the widget in the toolbar the 
"SketchDomainModel"-Class should known all the widget class in ecore, is it?

Original comment by dowbar2...@googlemail.com on 2 Apr 2013 at 8:45

GoogleCodeExporter commented 8 years ago
Hi Dowbar,

you can actually structure your domain model this way:

SketchDomainModel
* tabs : Tab [0..*]
  * pages : Page [0..*]
* widgets : Widget [0..*]
      * subWidgets : Widget [0..*]
* Toolbar extends Widget
* Button extends Widget

In Spray you define the mapping this way:

diagram spray for SketchDomainModel style SprayDefaultStyle

class Tab icon "ecore/EClass.gif" {
   shape TabShape {
      reference pages into tabCompartment
   }
   behavior {
      create into tabs palette "Container";
   }
}

class Page icon "ecore/EClass.gif" {
   shape PageShape {
      reference widgets into pageCompartment
   }
   behavior {
      create palette "Container";
   }
}

class Toolbar icon "ecore/EClass.gif" {
   shape ToolbarShape {
      reference subWidgets into toolbarCompartment
   }
   behavior {
      create palette "Widget";
   }
}

class Button icon "ecore/EClass.gif" {
   shape ButtonShape {
      name into buttonID
   }
   behavior {
      create palette "Widget";
   }
}

You see, you only have to leave off the "into ..." part. Adding a button to a 
toolbar inside the diagram will add the button domain object to the subWidgets 
of the toolbar domain object as the mapping definition for Toolbar states 
"reference subWidgets into ...".

Best regards,
Joerg

Original comment by de.abg.r...@gmail.com on 7 Apr 2013 at 1:48