Exemplo n.º 1
0
  /**
   *
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * Update the srcCount Label
   *
   * @generated NOT
   */
  private void updateSrcCountLabel() {
    Label srcCount = (Label) ((AssociationFigure) getFigure()).getsrcCountEdgeObjectFigure();

    Association association = (Association) Utils.getElement(getGraphEdge());
    if (association != null) {
      String lowerBound = null;
      String upperBound = null;
      if (association.getFirstEnd() != null) {
        lowerBound = association.getFirstEnd().getCardMin();
        upperBound = association.getFirstEnd().getCardMax();
      }

      if (upperBound == null) {
        upperBound = new String("0");
      }

      if (lowerBound == null) {
        lowerBound = new String("0");
      }

      if (upperBound.equals("-1")) {
        upperBound = "*";
      }

      if (lowerBound.equals(upperBound)) {
        if (!(lowerBound.equals("1"))) srcCount.setText(lowerBound);
        else srcCount.setText("");
      } else {
        srcCount.setText(lowerBound + ".." + upperBound);
      }
    }
  }
Exemplo n.º 2
0
  /** Update the source decoration */
  private void updateSourceDecoration() {
    Association association = (Association) Utils.getElement(getGraphEdge());

    boolean isNavigable = false;
    if (association.getFirstEnd() != null) {
      isNavigable = association.getFirstEnd().isNavigable();
    }

    if (!(isNavigable)) {
      if (association.getAssociationType() == AssociationType.COMPOSITION) {
        srcDecor = createCompositionDecoration();
      } else if (association.getAssociationType() == AssociationType.AGGREGATION) {
        srcDecor = createAggregationDecoration();
      } else {
        srcDecor = null;
      }
    } else {
      srcDecor = createNavigableDecoration();
    }
    ((PolylineConnection) figure).setSourceDecoration(srcDecor);
  }
Exemplo n.º 3
0
  /**
   *
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * Update the srcName Label
   *
   * @generated NOT
   */
  private void updateSrcNameLabel() {
    Label srcName = (Label) ((AssociationFigure) getFigure()).getsrcNameEdgeObjectFigure();

    Association association = (Association) Utils.getElement(getGraphEdge());
    srcName.setText(association.getFirstEnd().getName());
  }