Book a Demo

Author Topic: Display element type  (Read 5612 times)

Tehila1

  • EA User
  • **
  • Posts: 256
  • Karma: +0/-0
    • View Profile
Display element type
« on: April 01, 2015, 11:55:03 pm »
Is it possible to display type for each diagram object?
I mean 'Package packName' for a  package or 'Class className' for a class, etc.

Thanks.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Display element type
« Reply #1 on: April 02, 2015, 03:20:55 am »
Where?

q.

Tehila1

  • EA User
  • **
  • Posts: 256
  • Karma: +0/-0
    • View Profile
Re: Display element type
« Reply #2 on: April 02, 2015, 08:13:36 pm »
Quote
Where?

q.

On the diagram element itself- beside the name I would like to show ots type. Possible?

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Display element type
« Reply #3 on: April 02, 2015, 09:24:15 pm »
I would say: no. You can modify the display of elements with a shape script. But only for stereotyped elements. And you'd need an individual shape script for each possible stereotype.

q.

Tehila1

  • EA User
  • **
  • Posts: 256
  • Karma: +0/-0
    • View Profile
Re: Display element type
« Reply #4 on: April 02, 2015, 10:03:52 pm »
Quote
I would say: no. You can modify the display of elements with a shape script. But only for stereotyped elements. And you'd need an individual shape script for each possible stereotype.

q.

Well, Using the shape script as you suggest, I did the following:

Code: [Select]
PrintWrapped("#Type#");
However, I get the textbox with typ at top-left of element.
Is it possible to set its position to the enter of element?

Thanks in advance!

« Last Edit: April 02, 2015, 10:04:29 pm by avoda234 »

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Display element type
« Reply #5 on: April 02, 2015, 11:08:59 pm »
Try replacing the whole script by this one:
Code: [Select]
decoration centerType {
  orientation = "CENTER";
  PrintWrapped("#Type#");
}
(and have a look into my Shape Script book)

q.
« Last Edit: April 02, 2015, 11:10:40 pm by qwerty »

Tehila1

  • EA User
  • **
  • Posts: 256
  • Karma: +0/-0
    • View Profile
Re: Display element type
« Reply #6 on: April 03, 2015, 12:35:59 am »
Quote
Try replacing the whole script by this one:
Code: [Select]
decoration centerType {
  orientation = "CENTER";
  PrintWrapped("#Type#");
}
(and have a look into my Shape Script book)

q.

Thanks a lot!

One more question please:

Can I set an image at the background and the textbox over it?
I tried to merge the code above with the image() function with not much success. Is there any trick or simply impossible?

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Display element type
« Reply #7 on: April 03, 2015, 07:51:09 am »
When using this script:
Code: [Select]
shape main {
  Image("B", 10, 90, 90, 10);
}
decoration centerType {
  orientation = "CENTER";
  PrintWrapped("#Type#");
}
I got the image in the background and the text (rather) in the center of the element.

q.

Tehila1

  • EA User
  • **
  • Posts: 256
  • Karma: +0/-0
    • View Profile
Re: Display element type
« Reply #8 on: April 12, 2015, 06:14:43 pm »
Quote
When using this script:
Code: [Select]
shape main {
  Image("B", 10, 90, 90, 10);
}
decoration centerType {
  orientation = "CENTER";
  PrintWrapped("#Type#");
}
I got the image in the background and the text (rather) in the center of the element.

q.


Thanks q.
This shape script indeed put the image at background with text centralized on it.

One more thing please:
I would like to give the option to override the default text.
Is it possible to make the textbox writable?

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: Display element type
« Reply #9 on: April 13, 2015, 02:10:22 am »
No (AFAIK). You can write over attributes/operations. Maybe notes? What you can do is to use a tag and change that.

q.