mxConnectionConstraint.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /**
  2. * Copyright (c) 2006-2015, JGraph Ltd
  3. * Copyright (c) 2006-2015, Gaudenz Alder
  4. */
  5. /**
  6. * Class: mxConnectionConstraint
  7. *
  8. * Defines an object that contains the constraints about how to connect one
  9. * side of an edge to its terminal.
  10. *
  11. * Constructor: mxConnectionConstraint
  12. *
  13. * Constructs a new connection constraint for the given point and boolean
  14. * arguments.
  15. *
  16. * Parameters:
  17. *
  18. * point - Optional <mxPoint> that specifies the fixed location of the point
  19. * in relative coordinates. Default is null.
  20. * perimeter - Optional boolean that specifies if the fixed point should be
  21. * projected onto the perimeter of the terminal. Default is true.
  22. */
  23. function mxConnectionConstraint(point, perimeter, name, dx, dy)
  24. {
  25. this.point = point;
  26. this.perimeter = (perimeter != null) ? perimeter : true;
  27. this.name = name;
  28. this.dx = dx? dx : 0;
  29. this.dy = dy? dy : 0;
  30. };
  31. /**
  32. * Variable: point
  33. *
  34. * <mxPoint> that specifies the fixed location of the connection point.
  35. */
  36. mxConnectionConstraint.prototype.point = null;
  37. /**
  38. * Variable: perimeter
  39. *
  40. * Boolean that specifies if the point should be projected onto the perimeter
  41. * of the terminal.
  42. */
  43. mxConnectionConstraint.prototype.perimeter = null;
  44. /**
  45. * Variable: name
  46. *
  47. * Optional string that specifies the name of the constraint.
  48. */
  49. mxConnectionConstraint.prototype.name = null;
  50. /**
  51. * Variable: dx
  52. *
  53. * Optional float that specifies the horizontal offset of the constraint.
  54. */
  55. mxConnectionConstraint.prototype.dx = null;
  56. /**
  57. * Variable: dy
  58. *
  59. * Optional float that specifies the vertical offset of the constraint.
  60. */
  61. mxConnectionConstraint.prototype.dy = null;
  62. __mxOutput.mxConnectionConstraint = typeof mxConnectionConstraint !== 'undefined' ? mxConnectionConstraint : undefined;