Engineering System Design

Java API Questions regarding GraphicalElements

  • 1.  Java API Questions regarding GraphicalElements

    Posted Tue December 17, 2024 01:21 PM

    Hello community,

    I'm currently creating a helper tool which checks two ports for common interface contracts and then creates a connector with flows that convey all information for which the ports have common contracts. All fine yet, works basically quite well.

    But two topics remain finally:

    1. the name of the connector is displayed in the diagram. I want to hide it. I can access the name via 
      IRPCollection graphElements = myDiagram.getCorrespondingGraphicalElements(connector);
      for (int i=1; i<=graphElements.getCount();i++) {
          IRPGraphicalElement ge = (IRPGraphElement) graphElements.getItem(i);
          ge.getGraphicalPropertyOfText("Label", "Text").getValue();   // shows the name of the connector
      }
      but I can't change the visibility. Found no real snippet how to do so, e.g. property "isVisible", "ShowElementNames" seem not not work. Does anyone know how to get the name of the connector (i.e. "Label" of the line) invisible?
    2. The text box with the conveyed flow might get quite large (i.e. very wide). Does anyone know, how I can access its size (width, height) to ajdust it at least in a way that I do not have to scroll always to adjust the Conveyed text box manually?

    Thank you.

    Best regards

    Robert 



    ------------------------------
    Robert Fromm
    ------------------------------