public boolean tryCreatePackageRelationshipAt(int screenX, int screenY,
      ERelationshipKind relationshipKind, String kind) {
    ShapeFullVarious<?> shapeVarFull = getShapeFullAt(screenX, screenY);
    if(shapeVarFull != null) {
      double realX = UtilsGraphMath.toRealX(getHolderApp().getSettingsGraphicUml(), screenX);
      double realY = UtilsGraphMath.toRealY(getHolderApp().getSettingsGraphicUml(), screenY);
      IAsmElementUmlInteractive<RelationshipBinaryVarious, DRI, SD, PRI> relBinVar = 
          factoryAsmRelationshipBinVar.createAsmElementUml();
      relBinVar.getElementUml().setKind(relationshipKind);
      relBinVar.getElementUml().getShapeRelationshipStart().setShapeFull(shapeVarFull);
      shapeVarFull.getRelationshipsVariousStart().add(relBinVar.getElementUml().getShapeRelationshipStart());
      relBinVar.getElementUml().getShapeRelationshipStart().setEndType(ERelationshipEndType.END);
      relBinVar.getElementUml().getShapeRelationshipStart().getPointJoint().setX(realX);
      relBinVar.getElementUml().getShapeRelationshipStart().getPointJoint().setY(realY);
      relBinVar.getElementUml().getShapeRelationshipEnd().getPointJoint().setX(shapeVarFull.getShape().getPointStart().getX() +
          shapeVarFull.getShape().getWidth() +
          getHolderApp().getSettingsGraphicUml().fromInchToCurrentMeasure(1));
      relBinVar.getElementUml().getShapeRelationshipEnd().getPointJoint().setY(realY);
      makeElementSelected(relBinVar);
      tryToAddIntoContainer(relBinVar, screenX, screenY);
      asmListAsmRelationshipsBinVar.addElementUml(relBinVar);
      IAsmElementUmlInteractive<TextUml, DRI, SD, PRI> asmText = getFactoryAsmText().createAsmElementUml();
      asmText.getElementUml().setItsText(kind);
      asmText.getElementUml().getPointStart().setX(shapeVarFull.getShape().getPointStart().getX() +
          shapeVarFull.getShape().getWidth() +
          getHolderApp().getSettingsGraphicUml().fromInchToCurrentMeasure(1));
      asmText.getElementUml().getPointStart().setY(realY);
      tryToAddIntoContainer(asmText, screenX, screenY);
      getAsmListAsmTexts().addElementUml(asmText);
      setIsChanged(true);
      refreshGui();
      return true;
    }
    return false;
  }
public boolean tryCreatePackageRelationshipAt ( int screenX , int screenY , ERelationshipKind relationshipKind , String kind ) { ShapeFullVarious < ? > shapeVarFull = getShapeFullAt ( screenX , screenY ) ; if ( shapeVarFull != null ) { double realX = UtilsGraphMath . toRealX ( getHolderApp ( ) . getSettingsGraphicUml ( ) , screenX ) ; double realY = UtilsGraphMath . toRealY ( getHolderApp ( ) . getSettingsGraphicUml ( ) , screenY ) ; IAsmElementUmlInteractive < RelationshipBinaryVarious , DRI , SD , PRI > relBinVar = factoryAsmRelationshipBinVar . createAsmElementUml ( ) ; relBinVar . getElementUml ( ) . setKind ( relationshipKind ) ; relBinVar . getElementUml ( ) . getShapeRelationshipStart ( ) . setShapeFull ( shapeVarFull ) ; shapeVarFull . getRelationshipsVariousStart ( ) . add ( relBinVar . getElementUml ( ) . getShapeRelationshipStart ( ) ) ; relBinVar . getElementUml ( ) . getShapeRelationshipStart ( ) . setEndType ( ERelationshipEndType . END ) ; relBinVar . getElementUml ( ) . getShapeRelationshipStart ( ) . getPointJoint ( ) . setX ( realX ) ; relBinVar . getElementUml ( ) . getShapeRelationshipStart ( ) . getPointJoint ( ) . setY ( realY ) ; relBinVar . getElementUml ( ) . getShapeRelationshipEnd ( ) . getPointJoint ( ) . setX ( shapeVarFull . getShape ( ) . getPointStart ( ) . getX ( ) + shapeVarFull . getShape ( ) . getWidth ( ) + getHolderApp ( ) . getSettingsGraphicUml ( ) . fromInchToCurrentMeasure ( 1 ) ) ; relBinVar . getElementUml ( ) . getShapeRelationshipEnd ( ) . getPointJoint ( ) . setY ( realY ) ; makeElementSelected ( relBinVar ) ; tryToAddIntoContainer ( relBinVar , screenX , screenY ) ; asmListAsmRelationshipsBinVar . addElementUml ( relBinVar ) ; IAsmElementUmlInteractive < TextUml , DRI , SD , PRI > asmText = getFactoryAsmText ( ) . createAsmElementUml ( ) ; asmText . getElementUml ( ) . setItsText ( kind ) ; asmText . getElementUml ( ) . getPointStart ( ) . setX ( shapeVarFull . getShape ( ) . getPointStart ( ) . getX ( ) + shapeVarFull . getShape ( ) . getWidth ( ) + getHolderApp ( ) . getSettingsGraphicUml ( ) . fromInchToCurrentMeasure ( 1 ) ) ; asmText . getElementUml ( ) . getPointStart ( ) . setY ( realY ) ; tryToAddIntoContainer ( asmText , screenX , screenY ) ; getAsmListAsmTexts ( ) . addElementUml ( asmText ) ; setIsChanged ( true ) ; refreshGui ( ) ; return true ; } return false ; }
Utils: