Author Topic: How to get alternate image in MDG  (Read 4264 times)

William McKenzie

  • EA User
  • **
  • Posts: 61
  • Karma: +0/-0
    • View Profile
How to get alternate image in MDG
« on: June 29, 2012, 07:58:46 am »
I am unable to get alternate images to show up by default in my MDG. This should be fairly simple, but I cant make it work.  I create the following in my source profile:
1. <<metaclass>> for Class
2. I extend it with a stereotype.
3. I select an alternate image for the stereotype.
4. Export the profile, selecting all the export options.

The following is written to the profile.xml (i've removed most of the base64 data):

Code: [Select]
                             
<Stereotype name="HotSpot"
    notes=""
    cx="52"
    cy="65"
    bgcolor="-1"
    fontcolor="-1"
    bordercolor="-1"
    borderwidth="1" hideicon="0">
   <Image type="Metafile"
       xmlns:dt="urn:schemas-microsoft-com:datatypes"
      dt:dt="bin.base64">ADgAAABQAAAAAAAAAEAAAABQAAAA= etc
   </Image>
   <AppliesTo>
      <Apply type="Class"/>
      </AppliesTo>
</Stereotype>

The exact same thing shows up in the MDG XML file. When I import the MDG, everything works as expected except that the alternate image does not get rendered. I have several other stereotypes in the file that use shape scripts and they work fine. The values of cx="52" and cy="65" are honored appropriately on new elements, and everything shows up in the toolbox as it should. I'm restarting EA every time, creating a brand new project, and incrementing the version # on the MDG to make sure i have the latest one. I'm quite certain my refresh process is good, because I can tweak things like bg color in the profile and the show up in the MDG. Just the image doesnt.

Furthermore, if I load the profile manually, through the Resources dialog, the alternate image shows up correctly, both for new and existing instances of the stereotype. I'm really pulling my hair out here. 3 full days invested, and I cant create the simplest MDG with one Emf override.

~Bill

Paulus

  • EA User
  • **
  • Posts: 152
  • Karma: +0/-0
    • View Profile
Re: How to get alternate image in MDG
« Reply #1 on: June 30, 2012, 01:27:41 am »
Hi Bill,

Quote
<Image type="Metafile"
      xmlns:dt="urn:schemas-microsoft-com:datatypes"
     dt:dt="bin.base64">ADgAAABQAAAAAAAAAEAAAABQAAAA= etc
  </Image>

As far as i know you can't currently use actual images for the '_image' attribute of your stereotype, only shapescripts ( :-?). So i'm curious how you were able to get this XML using MDG?

I think you're left with two options: either create a shapescript, or share the stereotype by exporting/importing reference data.

regards,

Paulus

William McKenzie

  • EA User
  • **
  • Posts: 61
  • Karma: +0/-0
    • View Profile
Re: How to get alternate image in MDG
« Reply #2 on: June 30, 2012, 06:31:48 am »
So I wasn't actually using the _image attribute to do this. I was simply using the items in the 'Appearance' menu to modify the actual stereotype element right in the profile diagram.  Those changes are then included in the exported profile.  The export dialog even has a Check Box for 'Alternate Image'. And sure enough, the alternate image gets written to the XML. And like I say if I import the profile directly, instead of using it in an MDG, the alternate image is there and works.

In the end, I actually did have to use a shape script and draw the image in it. It's just a pain to be chasing these kinds of things for hours on end instead of actually working on my profile.

Paulus

  • EA User
  • **
  • Posts: 152
  • Karma: +0/-0
    • View Profile
Re: How to get alternate image in MDG
« Reply #3 on: June 30, 2012, 09:30:34 am »
Ah neat! I didn't see that.

Anyway, the checkbox 'alternate image' in the 'save as profile' dialog actually controls whether the _image attribute is used in the generation in your profile, just like the other checkboxes for size and color control _sizeX/_sizeY etc.

So I suspect that you've stumbled upon a bug in EA: the profile should look the same whether or not you select an alternate image for your stereotype in the profile diagram.

Quote
It's just a pain to be chasing these kinds of things for hours on end instead of actually working on my profile.

Couldn't agree more, sometimes i get the impression that EA is in many ways like a swiss knife 'made in ...' ::)

regards,

Paulus

« Last Edit: June 30, 2012, 09:35:06 am by pmaessen »

kepNCI

  • EA User
  • **
  • Posts: 127
  • Karma: +1/-0
    • View Profile
Re: How to get alternate image in MDG
« Reply #4 on: August 01, 2012, 01:24:40 am »
I have been playing with this for awhile.  I logged onto the forum today to post an update of what I have learned and noticed your post.  Bottom-line, alternate images do not work yet in MDG. It is a known bug.

I'll go ahead a post a new thread on what I know so far.

Karl