Book a Demo

Author Topic: Internal images for profile stereotype 'icon' attr  (Read 4064 times)

g.makulik

  • EA User
  • **
  • Posts: 355
  • Karma: +0/-0
    • View Profile
Internal images for profile stereotype 'icon' attr
« on: August 21, 2014, 03:49:06 am »
I have defined a profile for usage with a MDG language technology, and I'm using some BMP icons for the toolbox and project browser representations of some stereotypes defined in the profile.

The documentation for the icon property of a stereotype says:

Quote
Contains the bitmap file location of the 16x16-pixel icon displayed beside all elements defined by the Stereotype, in the Project Browser. This does not apply to Package elements. The icon is also automatically used as the Diagram Toolbox image wherever the stereotyped element is listed.

For a transparent background, you can use light grey - RGB (192,192,192).

For this attribute to work correctly, also set the _metatype attribute (see below).


Now I have that profile, MDG technology and all of the relevant files in an SVN repository, and want to make it work regardless where the local copy of the repository is checked out.

I have 2 questions:

  • Can the file path for the BMP in the icon property specified relative to the EA project?
  • Can the icon property use one of the imported images of the profile project (along including those images with the MDG technology)?
Using EA9.3, UML2.3, C++, linux, my brain, http://makulik.github.com/sttcl/

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Internal images for profile stereotype 'icon'
« Reply #1 on: August 21, 2014, 09:05:38 am »
I don't think so (for both)

g.makulik

  • EA User
  • **
  • Posts: 355
  • Karma: +0/-0
    • View Profile
Re: Internal images for profile stereotype 'icon'
« Reply #2 on: August 23, 2014, 02:45:33 am »
Quote
I don't think so (for both)
:(

Hi Simon,

Thanks for clarifying.

That's very unfortunate and inconvenient for the situation I mentioned  (all stuff and resources  managed in SVN)!
I can live well with locally setup exported profiles, etc. stuff, that is managed in a (locally kept) .mts file. But for icon stuff that's mentioned in a icon tag of a profile stereotype element?!? D'Oh  :o ...

Should I consider this (report) a bug?
The best solution I can think of would be to use images managed in the project that provides the profile/MDG technology.

Best regards,
Günther
« Last Edit: August 23, 2014, 02:56:47 am by g.makulik »
Using EA9.3, UML2.3, C++, linux, my brain, http://makulik.github.com/sttcl/

McMannus

  • EA User
  • **
  • Posts: 108
  • Karma: +4/-1
    • View Profile
Re: Internal images for profile stereotype 'icon'
« Reply #3 on: September 08, 2014, 09:10:06 pm »
Hi guys,

since I had the path problem as well recently I wrote some code to speed up the process of changing the icon path.

Code: [Select]
       private static void replaceToolboxIconPath()
        {
            const string newPath = @"L:\YourPath";
            string query = "SELECT " + Model.getDBString(Main.rep, DatabaseFields.objectID) + " FROM t_attribute WHERE " + Model.getDBString(Main.rep, DatabaseFields.name) + "='Icon'";
            List<dynamic> elements = Model.getElementListByQuery(Main.rep, query, Model.getDBString(Main.rep, DatabaseFields.objectID));
            foreach (IDualElement elem in elements)
            {
                foreach (IDualAttribute attr in elem.Attributes)
                {
                    if (attr.Name == "Icon")
                    {
                        Uri uri = new Uri(attr.Default);
                        if (uri.IsFile)
                        {
                            Debug.WriteLine(attr.Default+" changed to "+newPath + Path.GetFileName(uri.LocalPath));
                            attr.Default = newPath + Path.GetFileName(uri.LocalPath);
                            attr.Update();
                            elem.Attributes.Refresh();
                            break;
                        }
                    }
                }
            }
        }

Might be of some usage to you as well.