code: function(constraint)
  	{
  		var result = 0;
  		
  		result = (constraint & mxConstants.DIRECTION_MASK_WEST) << 3;
  		result |= (constraint & mxConstants.DIRECTION_MASK_NORTH) << 1;
  		result |= (constraint & mxConstants.DIRECTION_MASK_SOUTH) >> 1;
  		result |= (constraint & mxConstants.DIRECTION_MASK_EAST) >> 3;
  		
  		return result;
  	}
docs: Function: reversePortConstraints
  
  Reverse the port constraint bitmask. For example, north | east
  becomes south | west