IC5Notice: We have upgraded developerWorks Community to the latest version of IBM Connections. For more information, read our upgrade FAQ.
Topic
  • 1 reply
  • Latest Post - ‏2013-10-21T08:54:28Z by oskarsaiz
swethamouni
swethamouni
1 Post

Pinned topic How to hide all ports in class diagram through API methods

‏2013-05-20T08:12:52Z |

I want to hide  ports that are displayed in the class Diagram. There is an menu option to hide all ports in class diagram manually. I want hide these ports while creating class diagrams using API. Kindly help me which Interface/method to use , since there is no such option with IRPGraphNode/IRPGraphElement.

Please see the attached Snapshot for more details

Attachments

  • oskarsaiz
    oskarsaiz
    1 Post

    Re: How to hide all ports in class diagram through API methods

    ‏2013-10-21T08:54:28Z  

    Hello.

    You can use the API call 'setGraphicalProperty' to set the graphical property 'isVisible' to 'FALSE' in order to hide (remove from view) Port(s).

     

    Below is a sample code for your reference:

    Iterator myIter = RhapsodyAppServer.getActiveRhapsodyApplication().getSelectedGraphElements().toList().iterator();
    while(myIter.hasNext()) {

     IRPGraphElement myGrEle = (IRPGraphElement) myIter.next();
     if(myGrEle.getModelObject().getMetaClass().equals("Port"))
      myGrEle.setGraphicalProperty("isVisible", "FALSE"); }

     

    Hope this helps

    Oskar