Examples of UmlRelation


Examples of org.tinyuml.model.UmlRelation

  private void myPostInit() {
    getRootPane().setDefaultButton(okButton);
    assocNameTextField.setText(association.getModelElement().getName());
    showMultiplicitiesCb.setSelected(association.showMultiplicities());
    nameVisibilityCb.setSelected(association.showName());
    UmlRelation relation = (UmlRelation) association.getModelElement();
    ReadingDirection direction = relation.getNameReadingDirection();
    switch (direction) {
      case LEFT_RIGHT:
        l2rRadioButton.setSelected(true);
        break;
      case RIGHT_LEFT:
        r2lRadioButton.setSelected(true);
        break;
      default:
        noDirectionRadioButton.setSelected(true);
        break;
    }
    showRolesCb.setEnabled(false);
    roleANameTextField.setEnabled(false);
    roleBNameTextField.setEnabled(false);
    multiplicityACb.setSelectedItem(
      relation.getElement1Multiplicity().toString());
    multiplicityBCb.setSelectedItem(
      relation.getElement2Multiplicity().toString());
  }
View Full Code Here

Examples of org.tinyuml.model.UmlRelation

  /**
   * Transfers the data to the association object.
   */
  private void transferDataToAssociation() {
    UmlRelation relation = (UmlRelation) association.getModelElement();
    relation.setName(getAssociationName());
    association.setShowName(nameVisibilityCb.isSelected());
    setReadingDirection(relation);
    association.setShowMultiplicities(showMultiplicitiesCb.isSelected());
    try {
      relation.setElement1Multiplicity(Multiplicity.getInstanceFromString(
        multiplicityACb.getSelectedItem().toString()));
      relation.setElement2Multiplicity(Multiplicity.getInstanceFromString(
        multiplicityBCb.getSelectedItem().toString()));
    } catch (ParseException ignore) {
      // do not catch it here, but in the verification
      ignore.printStackTrace();
    }
View Full Code Here

Examples of org.tinyuml.model.UmlRelation

  protected Map<RelationType, UmlConnection> setupConnectionPrototypeMap() {
    Map<RelationType, UmlConnection> connectionPrototypes =
      new HashMap<RelationType, UmlConnection>();
    connectionPrototypes.put(RelationType.NOTE_CONNECTOR,
      NoteConnection.getPrototype());
    UmlRelation messageRelation = new UmlRelation();
    messageRelation.setName("message()");
    SynchronousMessageConnection msgConn = (SynchronousMessageConnection)
      SynchronousMessageConnection.getPrototype().clone();
    msgConn.setRelation(messageRelation);
    connectionPrototypes.put(RelationType.MESSAGE, msgConn);
    return connectionPrototypes;
View Full Code Here

Examples of org.tinyuml.model.UmlRelation

   */
  protected Map<RelationType, UmlConnection> setupConnectionPrototypeMap() {
    Map<RelationType, UmlConnection> connectionPrototypes =
      new HashMap<RelationType, UmlConnection>();

    UmlRelation notnavigable = new UmlRelation();
    notnavigable.setCanSetElement1Navigability(false);
    notnavigable.setCanSetElement2Navigability(false);
    UmlRelation fullnavigable = new UmlRelation();
    fullnavigable.setCanSetElement1Navigability(true);
    fullnavigable.setCanSetElement2Navigability(true);
    UmlRelation targetnavigable = new UmlRelation();
    targetnavigable.setCanSetElement1Navigability(false);
    targetnavigable.setCanSetElement2Navigability(true);

    Dependency depPrototype = (Dependency) Dependency.getPrototype().clone();
    depPrototype.setRelation((Relation) notnavigable.clone());
    connectionPrototypes.put(RelationType.DEPENDENCY, depPrototype);

    Association assocPrototype = (Association)
      Association.getPrototype().clone();
    assocPrototype.setRelation((Relation) fullnavigable.clone());
    connectionPrototypes.put(RelationType.ASSOCIATION, assocPrototype);

    Association compPrototype = (Association)
      Association.getPrototype().clone();
    compPrototype.setAssociationType(AssociationType.COMPOSITION);
    compPrototype.setRelation((Relation) targetnavigable.clone());
    connectionPrototypes.put(RelationType.COMPOSITION, compPrototype);

    Association aggrPrototype = (Association)
      Association.getPrototype().clone();
    aggrPrototype.setAssociationType(AssociationType.AGGREGATION);
    aggrPrototype.setRelation((Relation) targetnavigable.clone());
    connectionPrototypes.put(RelationType.AGGREGATION, aggrPrototype);

    Inheritance inheritPrototype = (Inheritance)
      Inheritance.getPrototype().clone();
    inheritPrototype.setRelation((Relation) notnavigable.clone());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.