如何在Enterprise Architect中将自定义图标用于原型? [英] How to use a custom icon for a stereotype in Enterprise Architect?

查看:352
本文介绍了如何在Enterprise Architect中将自定义图标用于原型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在Enterprise Architect中使用自己的图标表示元素(节点)。



对于某些构造型,Enterprise Architect中存在行为构建,这增加了元素右上角的图标,如下所示(在这种情况下,使用原型服务器):





[请参见



我想为我的原型显示自己的自定义图标,就像Enterprise Architect一样。因此,我尝试使用shapescript来显示图标,但是shapescript中的所有绘图似乎都与形状的尺寸有关。例如:

  shape main {
Drawnativeshape();
image( database,87,10,92,25);
}

结果如下:





第一个被错误地拉​​伸了,而第二个更好了,这很幸运。



虽然使用装饰似乎可以保留图片的大小,但始终将其放置在左上角:

 装饰图标{
image( firewall,0,0,100,100);
}



因此,我如何根据对象的构造型添加自定义图标,该图标是正确绘制的(总是相同大小,始终在右上角),就像Enterprise Architect一样?

解决方案

您快到了。这是您想要的装饰。将其放置在右上角

  orientation = NE; 

装饰形状。


I want to use my own icons for elements (nodes) in Enterprise Architect.

For certain stereotypes, there is a build in behavior in Enterprise Architect, that adds an icon in the upper-right corner of an element, like this (in this case the stereotype "server" is used):

[see this page for a list of the default stereotypes].

Note that the position (offset from top and right) and absolute size of the icon are preserved, even when the shape is resized:

I want to display my own custom icons for my stereotypes, just like Enterprise Architect does. So i tried to use a shapescript to display the icon, but all drawing in shapescript seems to be relative to the shape's size. For example:

shape main {
    drawnativeshape();
    image("database", 87, 10, 92, 25);
}

Results in this:

The first one is stretched wrong, and while the second is better, that is just luck.

While using a "decoration" seems to preserve the size of the picture, it is always placed in the top left corner:

decoration icon {
    image("firewall", 0, 0, 100, 100);
}

So how do i add a custom icon, based on the object's stereotype, that is drawn correctly (always same size, always in top-right corner), like Enterprise Architect does?

解决方案

You're almost there. It is a decoration you want. To place it in the upper right corner use

orientation = "NE";

in the decoration shape.

这篇关于如何在Enterprise Architect中将自定义图标用于原型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆