Author Topic: [alternate image] bind to element  (Read 8529 times)

gkathan

  • EA User
  • **
  • Posts: 21
  • Karma: +0/-0
  • ...de-accelerat e...
    • View Profile
[alternate image] bind to element
« on: July 20, 2007, 11:26:22 pm »
hej,
it seems that the capability to define an alternate image for an element is bound to the diagram where this is applied. i would need this alternate image bound to the element.
my use case here is an architectural model where i draw several views where all elements use your (in fact very pretty image library) - but it is a pain to reassociate the same element to the same image for each diagram...

maybe there is already a solution ?

thänx greetings from vienna

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: [alternate image] bind to element
« Reply #1 on: July 21, 2007, 09:10:34 am »
You can use a stereotype to do this. Of course this might not work in your case, and there might be problems if the stereotype involved is only one of several applied to an element (I just don't know about this).

Take a look at the Stereotypes tab of the Settings | UML dialog (in EA 7.0, in earlier versions it is a dialog, but the path is the same).

David

PS: Remember that you can direct a diagram not to display certain stereotypes. AFAIK this is done on a per-diagram basis, but it may be a 'sticky' setting. Depending on how your element graphic is rendered this may not be an issue.
No, you can't have it!

OwenJ

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Re: [alternate image] bind to element
« Reply #2 on: August 07, 2007, 10:13:11 am »
I like the idea of assigning a stereotype an alternate image.  The question is, how can I use one of the images in the image library for this purpose?  The only options are to use an EMF/WMF from an external file or a ShapeScript.  I would have thought that the stereotype capability would have been aware of the built in image library.
« Last Edit: August 07, 2007, 10:15:11 am by OwenJ »

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: [alternate image] bind to element
« Reply #3 on: August 07, 2007, 11:38:30 am »
Take a look at the Image Manager (or just Images in build 815) topic in the EA help.

You might have to somehow cut an image out of the images set first.

David
No, you can't have it!

OwenJ

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Re: [alternate image] bind to element
« Reply #4 on: August 07, 2007, 11:50:51 am »
David,

Yes, the Image Viewer can be used to assign an alternate image to an element.  If you use the element on multiple diagrams you must set an alternate image on each instance.  

I am attempting to model our server infrastructure.  I am creating a single instance of each server in a single package called servers.  I am then using this item in multiple packages to categorize the use of the server, (ie, test, development, what project it's used in, virtual versus physical, etc.)

I want to use a different icon to represent what type of server it is, (application, database, data warehouse, etc.)  It would be nice to be able to assign a specific image to the server type stereotype.  Using this technique I would only have to do it once.

Jan ´Bary´ Glas

  • EA User
  • **
  • Posts: 408
  • Karma: +0/-0
  • Bary
    • View Profile
Re: [alternate image] bind to element
« Reply #5 on: August 07, 2007, 11:15:24 pm »
If you want to attach pictures to steretypes:
Try Settings | UML...
choose or set new stereotypes that you need (application, database, data warehouse, etc.) and set the picture (choose "Metafile" and "Assign" OR try shape scripts)
This needs external .emf or .wmf pictures.
« Last Edit: August 07, 2007, 11:16:15 pm by Bary »
Jan 'Bary' Glas

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: [alternate image] bind to element
« Reply #6 on: August 08, 2007, 01:24:34 am »
The image manager may give you some flexibility in how you handle the images. If not, see if EA will export the image as a metafile, then import it again.

Jan is correct of course. The Stereotypes tab of the Settings | UML dialog is the place to actually make the association. Note that this will change the image and not the icon for the stereotype. You can also change the decoration (the icon shown on an image) with shape scripts, although you have limited flexibility and cannot use the built-in icons from EA  :( You are also limited to a single decoration, and cannot display several of them the way EA does  :( :'(

David
« Last Edit: August 08, 2007, 01:24:54 am by Midnight »
No, you can't have it!

OwenJ

  • EA Novice
  • *
  • Posts: 9
  • Karma: +0/-0
    • View Profile
Re: [alternate image] bind to element
« Reply #7 on: August 08, 2007, 04:26:15 am »
Yes, I have tried those methods.  The Stereotype system only allows you to apply an image from an external file, (EMF or WMF), or from a shapescript.  The Image Manager system does not allow you to export an image in the library.  I have found no way to export an image.

To me Sparx has a gap between the Image Manager system and the ability to apply an image to a Stereotype.  It would be great to use the Image Manager to manage all images.  Once an image is in the library the Stereotype system should become aware of it.

Jan ´Bary´ Glas

  • EA User
  • **
  • Posts: 408
  • Karma: +0/-0
  • Bary
    • View Profile
Re: [alternate image] bind to element
« Reply #8 on: August 08, 2007, 04:31:08 am »
Yes, that would be nice. Use of the images should be consistent (I have read this word somewhere).
Jan 'Bary' Glas

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +54/-3
    • View Profile
Re: [alternate image] bind to element
« Reply #9 on: August 08, 2007, 01:32:46 pm »
I don't know why you can't assign an image from the Image Manager to a stereotype - probably worth sending in a bug report.

Meanwhile, a couple more choices that haven't been mentioned yet:

1. Assign a shape script which assigns an image from the Image Manager:
Code: [Select]
Shape Main
{
Image("image_name",0,0,100,100);
}


2. Create a profile, and set the <<stereotype>> class to have an alternate image. Details in the help file.

HTH
The Sparx Team
[email protected]

gkathan

  • EA User
  • **
  • Posts: 21
  • Karma: +0/-0
  • ...de-accelerat e...
    • View Profile
Re: [alternate image] bind to element
« Reply #10 on: August 22, 2007, 08:29:25 am »
hmm .. you metioned to "export" image from within EA - i would like to do that - but i do not see any possibility ?
* especially it would be very helpful to be able to modify the existing image library pix !
* this would be great

=> any hints on that ?
greetz from vienna.

thomaskilian

  • Guest
Re: [alternate image] bind to element
« Reply #11 on: August 22, 2007, 09:12:32 am »
I just know about the icons. It's a BMP stored in EA's program directory.