Enterprise Architect Shape Script DrawNativeShape() Function does not work - enterprise-architect

I have created a new profile for Enterprise Architect. It defines a stereotype for "Requirement".
Modifying the default shape of "Requirement", I'm dealing with Shape Script. Calling the function "DrawNativeShape()" does not raise an error, neither has any effect!
In fact I expect the code below to display the default shape of the element, but it does not so that the diagram looks empty.
shape main{
DrawNativeShape();
}

The DrawNativeShape command is effectively saying "draw the shape exactly as you would if it didn't have a shape script". You say that that is what is happening. I don't see a problem.
There are two main uses for DrawNativeShape:
It can be used to apply conditional shapes to an element. What you do is test some condition and depending on the answer either draw a shape or call DrawNativeShape.
It can be used to apply conditional colour to an element. Call SetFillColor followed by DrawNativeShape and the element will be drawn with default appearance but using the colour specified by the shape script.

Related

Psychtoolbox - Filloval

I am new to Matlab and Psychtoolbox. I need to change color saturation. When creating a circle Screen('FillOval',window, is there a way of getting a handler to the Oval object and is it rendered as image? Thanks in advance
Unfortunately, (as far as I know) the FillOval function doesn't create a handle like you would be used to with matlab figures / patches. The best way to change the color is simply with the RGB index argument.
If you forget the arguments that belong in Psychtoolbox functions, type the name with a question mark to see the help file. In this case, type this in the command line:
Screen('FillOval?')
The arguments are:
Screen('FillOval', windowPtr [,color] [,rect] [,perfectUpToMaxDiameter]);
If i wanted to change the saturation, I would just redraw the Oval and change the RGB values I filled into the Fill Oval function. e.g. put in [255,0,0] on the first flip and [255,50,50] on the second.
It kind of sounds like you may want to opt for the "MakeTexture" and "DrawTexture" functions. With this function, you can take any image matrix and transform it into a texture handle with "MakeTexture". With "DrawTexture" you can then draw the image into the psych toolbox window. DrawTexture is nice, because it allows you to easily change the opacity of the texture.
I recommend exploring the help functions to learn more about this option.

Visio Page ShapeSheet reference in shape shapesheet formula

I'm trying to set the text field of a shape to the name of the layer it is on (Visio 2010). I should be able to set the formula to this:
=ThePage!Layers.Name[LayerMember]
but that doesn't work because LayerMember is a string and a shape can be on multiple layers, i.e., LayerMember = "3" if it is only on the 3rd layer but can be "3;2;5" if it is on three different layers. So, using LEFT(LayerMember, 1) gets the first value in the list but putting that in the index field of the above formula doesn't work either. Putting a static value in the index field works just fine but I want to be able to change the layer of a shape and have the text on the shape change to the layer name.
Using LEFT(LayerMember,1) returns a string. I can't find a way to convert the string value to a number to get the layer name value from the page's shapesheet.
I'm new at Visio but for some reason I can't figure this one out.
Layer is a property of shape, so try shpObj.Layer(1).Name this will give you the name of the first layer the shape is on. You will need to check shjObj.LayerCount to make sure that the shape actually is on a layer.

add simple geometric elements to GUIDE GUI

I am desiging a simple GUI application in Matlab using GUIDE.
I am displayed a number of axis - and I would like to add some simple design elements to make the interface clearer. I would like to draw a colored rectangle around an axis (seperate from the axis)... there are two such axes, each displaying details of some things shown in a third plot, and I would like this color clue to link the details to the overview.
So is it possible to add simple geometric shape objects to a Matlab GUI? I don't see anything but controls in GUIDE but perhaps its possible to add them manually with an explicit command?
It is generally difficult to draw any random shape. Except Square & rectangle, for which you can create panels and change the properties like BorderWidth and HighlightColor.
Since MATLAB GUI is based on Java, you can create any object in MATLAB GUI which can be created in Java. You can refer to this website [1] for further learning.
[1] http://undocumentedmatlab.com/matlab-java-book/

Word Styles to get two elements to share same background/border

Within MS Word 2013 I am trying to create a text element plus a list underneath it, all wrapped inside a coloured border with background shading (see image). The attached image shows the text in plain form.
I would like to place a blue border around both the title and the list. I can achieve this by placing both objects within a 1x1 table and applying colouring rules to the cell, but semantically this seems bad (I'm from an HTML development background where it is very wrong!)
When I edit a Style rule to create the border/background, it works well until I create the list, then it goes badly wrong. Is it possible to achieve the output of the table cell approach by only using a style rule and no table?
After a day of experimentation, the closest I can get is by doing the following:
Create a style rule called Tips Heading based on Normal, then set it to be Bold with a blue background.
Create another style rule called Tips List based on List Paragraph, and set it to have a blue background.
Unfortunately the List cannot be indented because the background colour also indents. The border is also affected in this manner, so I ignored the border and indentation. It works really well and is semantically well structured.

IDE or plugin to add helpful graphics or illustrate code as-is?

I was staring at my code thinking how boring the text looks.
All I see is text, with no visualizable structure.
Visualizable structures would be awesome:
Background graphics such as 3D half-pipes on edge connecting the opening and closing brackets of loop scopes, nested in 3D to show how deep the loops are nested.
Wires with arrows along them showing where a goto statement points, with a code section highlight (or preview if out of viewport) of the target label.
Conditional blocks could be rendered to show the "true" code in a positive color and the "false" code in a negative color, and mousing over the background at the left edge could reveal a preview of the condition statement for that block (appended with "== true" or "== false" depending on the code context).
Icons for Types, that show up in front of variable names so you know what type they are.
Change the background of the method, displaying tiled locks or keys, depending on whether you type public or private in front of the method (a nice indicator of the default if you fail to specify either).
Is there anything out there that illustrates code like this?
I don't mean analytically generated graphics representing the code or algorthmic structure in some way. Rather, I mean something that actually illustrates the editable code in place.