Been working on learning to use shape scripts. Bit of a learning curve.
I am thinking about starting a how-to thread on shape scripts with some actual scripts I use, so if anyone has an interest in the topic let me know
Anyway, I wanted an easy way to make sure I understand which type of actor I was looking at (e.g., Is that the customer actor, or the customer stakeholder?) This script helps me not get confused...
To try out (if not familiar with):
- Create a diagram (use case) and drag an actor element and drop on diagram.
- Move to the stereotype drop-down box and TYPE "STEAKHOLDER", then SAVE. We are using THAT name for this demo so you don't overwrite an existing actor, stereotyped as a stakeholder, should one exists.
- Select the actor (just click to select, not open)
- Select menu option "Settings", then "UML"
- UML Types window is displayed WITH your STEAKHOLDER stereotype already selected.
- In the "Override Appearance) set of controls, click the radio button for Shape Script, then the Assign button.
- Shape Editor window is displayed.
- Cut and paste the script below into the window and the click refresh.
- If you copied the entire script between the blocks, you should see a lousy looking image in the preview pane, don't worry about it, just click OK
- Return to UML Types window, and click save.
- Take a look at your actor now..
Easy to now tell the difference between an actor and the stakeholder
I left in place holders for the order that I place the code in... I sure wish the guide made it clearer tough to figure out without getting fustrated...
If anyone is interested in a more advanced shape script that I use with use cases, just send me a message.
Goodnight and back to modeling...
"Hey, you want to get that spot out of my eyes, I'm trying to work here!"
Script Starts Below// Author - David Rains (
[email protected]) Copyright 2009
// Release:
//
// Script Version: 1.0
// Script's Purpose: Display adornment for actors stereotyped as stakeholders
Shape Main
{
//Default PROPERTY Initializations (Must be at TOP)
noShadow = "false";
dockable = "none";
//Check for Required Tagged Values
//PreDraw Derived Attribute Initializations
//Draw Shape
drawnativeshape();
//PostDraw Adornments
//Stereotyped Static Adornments
//Add Stakeholder's STAKE
setpenwidth(3);
// Add a the Stakeholder Indicator
startpath();
moveto(25,37);
lineto(25,52); // draw "|"
endpath();
strokepath();
//Add tip
setpenwidth(1);
startpath();
moveto(24,52);
lineto(25,56);
lineto(27,52);
endpath();
strokepath();
//Stereotyped Dynamic Adornments
}
Script Ends Above