Technote (FAQ)
Question
Creating User-Defined Diagrams and Symbols - Part II
Answer
In last week's tip , we talked about new functionality in System Architect that enables users to create their own diagram and symbol types, and to depict symbols with bitmaps imported from external sources.
In this week's tip, we'll take a look at an example.
Let's Take a Look at an Example...
Say that we are modeling the Global Positioning Information System for a railroad, and we want to create a new diagram type called Wireless Network . Our goal is to build the following diagram:
Create New Diagram and Symbol Types
In USRPROPS.TXT for our encyclopedia, we add this line of text:
Rename Diagram "User 1" To "Wireless Network"
On this diagram we want to create new symbols to show technologies that will be in place in our company's communication networks. We want to create 7 new symbols to draw on the diagram -- to represent a building, a satellite, a radar, a server, an end user, a train, and a computer. We also want to add a line symbol to this diagram, called Relates To, to show the relations between the symbols that we draw. In USRPROPS.TXT for our encyclopedia, we add this line of text:
Rename Symbol "User 1" To "Building"
Rename Symbol "User 2" To "Satellite"
Rename Symbol "User 3" To "Radar"
Rename Symbol "User 4" To "Server"
Rename Symbol "User 5" To "End User"
Rename Symbol "User 6" To "Train"
Rename Symbol "User 7" To "Computer"
Rename Symbol "User 8" To "Relates To"
We want to track information provided to end users, including Shipment Tracking info, Shipment Status , and whether or not Electronic Freight Billing is being used.
We'll add the following statement to the top of our USRPROPS.TXT file to create the new definition, and then specify what this new definition will entail. For each of these new properties, we want them to display on the symbol (we add the statement DISPLAY {Format String} to each one).
Rename Definition "User 7" TO "End User"
DEFINITION "End User"
{
PROPERTY "Shipment Tracking"
{ EDIT Text LENGTH 50 DISPLAY { FORMAT String }}
PROPERTY "Shipment Status"
{ EDIT Text LENGTH 50 DISPLAY { FORMAT String }}
PROPERTY "Electronic Freight Billing"
{ EDIT Text LENGTH 50 DISPLAY { FORMAT String }}
}
Finally, we want to specify what the new symbol types we have created will look like, in both the toolbar and on the diagram when we draw them. We create a bunch of new bitmaps -- two for each symbol -- one for the symbol's depiction on the toolbar (or menu) and one for the symbol's depiction on the diagram. We add the following statements to our USRPROPS.TXT file.
SYMBOL "Building"
{ASSIGN To "Wireless Network"
DEPICTIONS { DIAGRAM "C:\Program Files\Popkin Software\pictures\building.bmp" }
DEPICTIONS { MENU "C:\Program Files\Popkin Software\pictures\buildingtoolbar.bmp" }}
SYMBOL "Satellite"
{ASSIGN To "Wireless Network"
DEPICTIONS { DIAGRAM "C:\Program Files\Popkin Software\pictures\satellite.bmp" }
DEPICTIONS { MENU "C:\Program Files\Popkin Software\pictures\satellitetoolbar.bmp" }}
SYMBOL "Radar"
{ASSIGN To "Wireless Network"
DEPICTIONS { DIAGRAM "C:\Program Files\Popkin Software\pictures\radar.bmp" }
DEPICTIONS { MENU "C:\Program Files\Popkin Software\pictures\radartoolbar.bmp" }}
SYMBOL "Server"
{ASSIGN To "Wireless Network"
DEPICTIONS { DIAGRAM "C:\Program Files\Popkin Software\pictures\server.bmp" }
DEPICTIONS { MENU "C:\Program Files\Popkin Software\pictures\servertoolbar.bmp" }}
SYMBOL "End User"
{ DEFINED BY "End User"
ASSIGN To "Wireless Network"
DEPICTIONS { DIAGRAM "C:\Program Files\Popkin Software\pictures\enduser.bmp" }
DEPICTIONS { MENU "C:\Program Files\Popkin Software\pictures\endusertoolbar.bmp" }}
SYMBOL "Train"
{ASSIGN To "Wireless Network"
DEPICTIONS { DIAGRAM "C:\Program Files\Popkin Software\pictures\train.bmp" }
DEPICTIONS { MENU "C:\Program Files\Popkin Software\pictures\traintoolbar.bmp" }}
SYMBOL "Computer"
{ASSIGN To "Wireless Network"
DEPICTIONS { DIAGRAM "C:\Program Files\Popkin Software\pictures\computer.bmp" }
DEPICTIONS { MENU "C:\Program Files\Popkin Software\pictures\computertoolbar.bmp" } }
Finally, we know we cannot depict a line symbol by an external bitmap. However, what we can do is depict our new symbol like an existing symbol on another diagram. We add the following statement to our USRPROPS.TXT.
SYMBOL "Relates To"
{ DEPICT LIKE "Dependency" IN "UML Class"
ASSIGN To "Wireless Network" }
To make the changes take effect, we reopen our encyclopedia, and have a new diagram type available to us.
On the new diagram type, we have a new toolbar that reflects the external bitmaps for our new symbols.
We can thus draw the following diagram. Notice that on the end-user symbol, we have displayable properties. These can be turned on or off by right-mouse clicking on the symbol, choosing Display Mode , and turning on or off each of the properties.
Next Week
Next week we'll take a look at how to create a true Windows Metafile (wmf file) -- meaning it consists of true vectors of information.
Historical Number
KB9687
Rate this page:
Copyright and trademark information
IBM, the IBM logo and ibm.com are trademarks of International Business Machines Corp., registered in many jurisdictions worldwide. Other product and service names might be trademarks of IBM or other companies. A current list of IBM trademarks is available on the Web at "Copyright and trademark information" at www.ibm.com/legal/copytrade.shtml.