file Property Pages

4 years 10 months ago #3478 by ebr
Hi ua,

The following code should help you
 List<IDiagramGraphic> graph = representation.unmask(port, rect.x, rect.y);
                if ((graph != null) && (graph.size() > 0) && (graph.get(0) instanceof IDiagramNode)){
                    IDiagramNode dnode = (IDiagramNode)graph.get(0);                    
                    dnode.setProperty("REPMODE", "IMAGE");
                }

This piece of code sets the value of the Representation mode to "Image".

Regards,

EBR
The following user(s) said Thank You: ua138

Please Log in or Create an account to join the conversation.

4 years 10 months ago #3479 by ua138
I have just tried your code and it works fine.
Thank you very much for all your support, and the quick answers!!!

Please Log in or Create an account to join the conversation.

4 years 10 months ago - 4 years 10 months ago #3481 by ua138
It is not working though for creating an element from a command. Is there any way of enabling this when you create an element from a command? (Right button and selecting it in the tree view of the model).

Besides, would it be possible to share some of the most relevant property names?
For example, when you use the code:
dnode.setProperty("REPMODE", "IMAGE");

sharing a list that is similar to:

Representation mode: REPMODE
Fill mode: FILL_MODE
Fill color: FILL_COLOR
Line color: LINE_COLOR
...
...

which are the codes used for acessing these properties?

Thank you very much again for your time.

Please Log in or Create an account to join the conversation.

4 years 10 months ago #3483 by ebr
That's an issue the only way I found was to try or look into Modelio sources...

Please Log in or Create an account to join the conversation.

4 years 10 months ago #3493 by ua138
I have managed to solve it as follows:
if ((graph != null) && (graph.size() > 0) && (graph.get(0) instanceof IDiagramNode)){
            IDiagramNode dnode = (IDiagramNode)graph.get(0);                    
            dnode.setProperty("FILLCOLOR", "117,36,155"); //The numbers are RGB colors
            dnode.setProperty("FILLMODE", "SOLID");
            dnode.setProperty("LINECOLOR", "0,28,155");
        }

The rest of types can be taken from the MetaKey.java class here attached.

File Attachment:

File Name: Types.zip
File Size:4 KB


Thank you for your response.
Attachments:

Please Log in or Create an account to join the conversation.

4 years 10 months ago #3494 by ua138
But still, I am wondering how can be a stereotype customized not only for tools but for commands. I see when I create a block into the sysml module from the command, it still keeps the rounded shape. How is this done?

Thank you very much again

Please Log in or Create an account to join the conversation.

Moderators: tmachmaab
Time to create page: 0.064 seconds
^ Back to Top