Author Topic: Reusing GUI elements  (Read 3805 times)

Jeff Odell

  • EA User
  • **
  • Posts: 99
  • Karma: +0/-0
    • View Profile
Reusing GUI elements
« on: January 09, 2006, 06:35:47 am »
I am using EA to do screen layouts.  I want to represent that I have a user interface control that appears more than once on a particular screen.  It also appears on more than one screen.

I created a GUI Element to represent the control in a project that will contain common GUI Elements.

When I want to reuse the element on a diagram, I have two choices:

1) A Simple Link - Doesn't work as I need to put more than one on the diagram.  Also, there are Tagged Values that are specific to each use.

2) Instance.  Works, but doesn't display as a GUI Element in the diagram.  It just displays with the normal instance box.

Ideally, I believe I would like the Instance to display as the GUI Element does.

Is there any other workaround I'm missing?

jlo

thomaskilian

  • Guest
Re: Reusing GUI elements
« Reply #1 on: January 09, 2006, 11:28:22 am »
Might generalization solve your problem?

Jeff Odell

  • EA User
  • **
  • Posts: 99
  • Karma: +0/-0
    • View Profile
Re: Reusing GUI elements
« Reply #2 on: January 10, 2006, 04:16:36 am »
I wondered about that a little, but I am really using instances of the GUI elements - the dialogs contain "instances of" and not "a more specific classifier of" the GUI Elements.

That said that may be the workaround I have to use.  Thanks for the idea - jlo

Tonu

  • EA User
  • **
  • Posts: 30
  • Karma: +0/-0
    • View Profile
Re: Reusing GUI elements
« Reply #3 on: January 10, 2006, 05:30:49 am »
What about using a stereotype?

If you have a "library" of common GUI elements then, in a way, you already have created your own profile. You simply have to save your package as profile and import it back under the resource view.

If you have really many elements of the same type, using a stereotype may be much more convenient than using generalisation + you will get the ability to define default color and/or icon for each of the different types if you want to emphasise some of them ...

Tonu
« Last Edit: January 13, 2006, 02:34:46 am by naks »

AshK

  • EA User
  • **
  • Posts: 137
  • Karma: +0/-0
    • View Profile
Re: Reusing GUI elements
« Reply #4 on: January 12, 2006, 08:34:06 pm »
Hi Guys,

I've written some stereotypes with shapescripts that resemble ea's drawing of GUIElements.  They apply to Object allowing many instances of an GUIElement on a single diagram.

Please find the reference data file uploaded on the eausergroup site:

http://sharepoint.knowledgerecovery.com/external/eaug/Shared%20Documents/GUI%20Stereotypes.xml

To install: Tools->Import reference data

Cheers,

Ash
The Sparx Team
[email protected]

Tonu

  • EA User
  • **
  • Posts: 30
  • Karma: +0/-0
    • View Profile
Re: Reusing GUI elements
« Reply #5 on: January 13, 2006, 12:57:59 am »
Hi Ash,

Sounds good!
Two questions though ...

How do you use those stereotypes. When I import the reference data I get steretypes visible in Settings->UML->Stereotypes together with the shape script. There is now two stereotypes with the same name for most of them. One applying to GUIElement and the other one to object (the latter one is yours with the shape script). If I put an object on diagram and specify dor instance "combobox" as a stereotype, then I get only the stereotype name on top of the object rectangle but no effect from the shape script.

The other question - why not export it as a profile rather than reference data? It would make also usage easier as you could drag the stereotypes right from the resource tree instead of setting the stereotype property each time after adding an object.

Best regards,
Tonu