Author Topic: How to add a description to an image?  (Read 3453 times)

Stenvang

  • EA User
  • **
  • Posts: 50
  • Karma: +0/-0
    • View Profile
How to add a description to an image?
« on: September 17, 2014, 10:49:01 pm »
I'm making a function for my add-in that take all images in my project and add them to a word document with a description of the image.
So I see 2 possible ways of getting all the images.

1. Select them from the Image Manager
2. Since all the images are added to different diagrams I can loop through the project's diagrams.

What I'm having trouble with is the description of the image. In the Image manager it isn't possible to add a description of the images - correct me if I'm wrong.
So that leaves me with looping through the project's diagrams. However this gives me another problem cause the images are inserted into the diagrams as boundaries and I can't find a way to know the difference between boundaries with image in and other boundaries as those you normally use in a usecase diagram.

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: How to add a description to an image?
« Reply #1 on: September 18, 2014, 01:47:43 am »
There's no way to add a description to the image itself, but if you only want a very brief description you can store it as the image's name, which you can change in the image manager; I don't think that is ever used outside the image manager.

The images are stored in the table t_image, although I'm not sure about the exact representation.

Finding them in diagrams is pretty straightforward. The reference is stored as text in the database, in the t_diagramobjects.ObjectStyle. Any diagram object whose ObjectStyle contains the string "ImageID=NUMBER;", where NUMBER > 0. (The number seems to be set to 0 rather than deleted altogether from this column when the image is cleared in the diagram.)

The ImageID is a reference into t_image.ImageID, and of course the diagram and elements can be found from t_diagramobjects.Diagram_ID and t_diagramobjects.Object_ID, respectively.

Note that the ObjectStyle cannot be read from the DiagramObject class, but must be read from the database.

HTH,


/Uffe
My theories are always correct, just apply them to the right reality.

Stenvang

  • EA User
  • **
  • Posts: 50
  • Karma: +0/-0
    • View Profile
Re: How to add a description to an image?
« Reply #2 on: September 18, 2014, 05:04:11 pm »
A good explanation!

Do you know if it's possible to store the image in an element or something like that? Then I could have a package in the project with all the images in and then they can have a tagged value with the image name and a description in the notes field.

What I thought of so far is to make a huge diagram with only the images cause then I could add a tagged value and a description as stated above but this seems like a bad idea I would  prefer if the images could be stored in another way.

Uffe

  • EA Practitioner
  • ***
  • Posts: 1859
  • Karma: +133/-14
  • Flutes: 1; Clarinets: 1; Saxes: 5 and counting
    • View Profile
Re: How to add a description to an image?
« Reply #3 on: September 19, 2014, 11:19:58 pm »
You can achieve something like this, but you have to create a UML profile (and preferably an MDG Technology to contain it).

In a profile you create stereotypes, and a stereotype can have its own shape script, which controls how elements of that stereotype are displayed in diagrams. In a shape script, you can display an image from the image manager by using the image() method.

You'd have to create one stereotype for each image, but it should work. You can create stereotypes for boundaries as well as for classes, components, etc, so depending on how you intend to use the images that might be suitable.

HTH,


/Uffe
My theories are always correct, just apply them to the right reality.